Bring up SSD2092 display/touch, USB NCM, HiDPI XLibre/DWM, and USB charging

This commit is contained in:
Luxferre committed 2026-11-22 15:49:38 +02:00
1 parent 034c1f61b1
commit 9db15e30ce
150 files changed
+2356 -446

No files matched your search

+15 -15
View File
@@ -147,18 +147,18 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
"Tab: Switch Field | Enter: Send");
int pad = 20;
int top = 80;
int left_w = 520;
int top = 92;
int left_w = 560;
if (left_w > w / 3) left_w = w / 3;
int right_x = pad * 2 + left_w;
int right_w = w - right_x - pad;
/* Left pane: recipient input + thread list */
gemui_draw_input(app, cr, (gemui_rect_t){pad, top, left_w, 60},
gemui_draw_input(app, cr, (gemui_rect_t){pad, top, left_w, 68},
"New recipient number...", st->new_peer, false,
st->focus_mode == 1, HIT_NEW, 0);
gemui_rect_t pane = {pad, top + 74, left_w, h - (top + 74) - pad};
gemui_rect_t pane = {pad, top + 82, left_w, h - (top + 82) - pad};
gemui_fill_round(cr, pane, 12, t->bg_bar);
gemui_stroke_round(cr, pane, 12, 1.5, t->border);
@@ -166,18 +166,18 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
gemui_draw_text(cr, t, pane, "No SMS threads yet", 0, false,
GEMUI_ALIGN_CENTER, t->fg_muted);
} else {
int rh = 76;
int rh = 84;
for (int i = 0; i < st->num_threads; i++) {
gemui_rect_t rr = {pane.x + 10, pane.y + 10 + i * rh, pane.w - 20, rh - 8};
if (rr.y + rr.h > pane.y + pane.h) break;
bool sel = (i == st->sel_thread);
gemui_fill_round(cr, rr, 10, sel ? t->sel_bg : (i % 2 ? t->bg_alt_odd : t->bg_alt_even));
thread_t *th = &st->threads[i];
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + 14, rr.y + 4, rr.w - 28, 32},
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + 14, rr.y + 4, rr.w - 28, 38},
th->peer, -1, true, GEMUI_ALIGN_LEFT,
sel ? t->sel_fg : t->fg_bright);
const char *preview = (th->num_msgs > 0) ? th->msgs[th->num_msgs - 1].text : "";
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + 14, rr.y + 34, rr.w - 28, 28},
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + 14, rr.y + 42, rr.w - 28, 34},
preview, -2, false, GEMUI_ALIGN_LEFT,
sel ? t->sel_fg : t->fg_muted);
gemui_hit_add(app, rr, HIT_THREAD, i);
@@ -185,13 +185,13 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
}
/* Right pane: chat history bubbles + compose bar */
gemui_rect_t chat = {right_x, top, right_w, h - top - 104};
gemui_rect_t chat = {right_x, top, right_w, h - top - 114};
gemui_fill_round(cr, chat, 12, t->bg_overlay);
gemui_stroke_round(cr, chat, 12, 1.5, t->border);
if (st->sel_thread >= 0 && st->sel_thread < st->num_threads) {
thread_t *th = &st->threads[st->sel_thread];
int bh = 84;
int bh = 94;
int cap = (chat.h - 24) / bh;
int start = (th->num_msgs > cap) ? (th->num_msgs - cap) : 0;
int y = chat.y + 12;
@@ -201,9 +201,9 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
int bx = m->outgoing ? (chat.x + chat.w - bw - 16) : (chat.x + 16);
gemui_rect_t br = {bx, y, bw, bh - 10};
gemui_fill_round(cr, br, 12, m->outgoing ? t->bg_bubble_out : t->bg_bubble_in);
gemui_draw_text(cr, t, (gemui_rect_t){br.x + 14, br.y + 6, br.w - 28, 34},
gemui_draw_text(cr, t, (gemui_rect_t){br.x + 14, br.y + 6, br.w - 28, 42},
m->text, -1, false, GEMUI_ALIGN_LEFT, t->fg_bright);
gemui_draw_text(cr, t, (gemui_rect_t){br.x + 14, br.y + 42, br.w - 28, 22},
gemui_draw_text(cr, t, (gemui_rect_t){br.x + 14, br.y + 50, br.w - 28, 28},
m->ts, -4, false, m->outgoing ? GEMUI_ALIGN_RIGHT : GEMUI_ALIGN_LEFT, t->fg_muted);
y += bh;
}
@@ -212,11 +212,11 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
false, GEMUI_ALIGN_CENTER, t->fg_muted);
}
int send_w = 180;
gemui_draw_input(app, cr, (gemui_rect_t){right_x, h - 88, right_w - send_w - 12, 68},
int send_w = 210;
gemui_draw_input(app, cr, (gemui_rect_t){right_x, h - 94, right_w - send_w - 12, 74},
"Type SMS message...", st->compose, false,
st->focus_mode == 0, HIT_INPUT, 0);
gemui_draw_button(app, cr, (gemui_rect_t){right_x + right_w - send_w, h - 88, send_w, 68},
gemui_draw_button(app, cr, (gemui_rect_t){right_x + right_w - send_w, h - 94, send_w, 74},
"Send", HIT_SEND, 0, true, false, false);
}
@@ -295,7 +295,7 @@ int main(int argc, char **argv) {
}
load_threads(&st);
st.app = gemui_create("geminux-sms", "Geminux SMS Messages", 1640, 900, false);
st.app = gemui_create("geminux-sms", "Geminux SMS Messages", 1920, 940, false);
if (!st.app) return 1;
st.inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);