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

+21 -21
View File
@@ -118,40 +118,40 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
gemui_draw_header(app, cr, "\xef\x87\xab", "Geminux Network & Radios", st->status_text);
int pad = 20;
int top = 80;
int top = 92;
int tab_w = (w - pad * 2 - 3 * 12) / 4;
static const char *tabs[4] = {"Wi-Fi", "4G / CCCI", "Bluetooth", "USB & HDMI"};
for (int i = 0; i < 4; i++) {
gemui_draw_button(app, cr, (gemui_rect_t){pad + i * (tab_w + 12), top, tab_w, 60},
gemui_draw_button(app, cr, (gemui_rect_t){pad + i * (tab_w + 12), top, tab_w, 66},
tabs[i], HIT_TAB, i, false, st->tab == i, false);
}
int cy = top + 76;
int cy = top + 82;
int ctrl_w = (w - pad * 2 - 12) / 2;
if (st->tab == 0) {
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 66},
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 72},
"Wi-Fi Radio", st->wifi_on, HIT_TOGGLE, 0, false);
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 66},
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 72},
"Rescan Networks", HIT_ACTION, 0, true, false, false);
} else if (st->tab == 1) {
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 66},
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 72},
"MT6797 Modem Active", st->cellular_on, HIT_TOGGLE, 1, false);
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 66},
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 72},
"Reset CCCI Modem", HIT_ACTION, 1, false, false, false);
} else if (st->tab == 2) {
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 66},
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 72},
"Bluetooth Radio", st->bt_on, HIT_TOGGLE, 2, false);
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 66},
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 72},
"Scan 10s", HIT_ACTION, 2, true, false, false);
} else {
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 66},
gemui_draw_toggle(app, cr, (gemui_rect_t){pad, cy, ctrl_w, 72},
"SiI9024 HDMI Extend", st->hdmi_on, HIT_TOGGLE, 3, false);
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 66},
gemui_draw_button(app, cr, (gemui_rect_t){pad + ctrl_w + 12, cy, ctrl_w, 72},
"Mirror Primary Display", HIT_ACTION, 3, true, false, false);
}
int foot_h = (st->tab == 0) ? 84 : 0;
gemui_rect_t box = {pad, cy + 80, w - pad * 2, h - (cy + 80) - pad - foot_h};
int foot_h = (st->tab == 0) ? 94 : 0;
gemui_rect_t box = {pad, cy + 88, w - pad * 2, h - (cy + 88) - pad - foot_h};
gemui_fill_round(cr, box, 12, t->bg_bar);
gemui_stroke_round(cr, box, 12, 1.5, t->border);
@@ -159,19 +159,19 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
gemui_draw_text(cr, t, box, "No interfaces or scan results available", 0, false,
GEMUI_ALIGN_CENTER, t->fg_muted);
} else {
int rh = 64;
int rh = 72;
for (int i = 0; i < st->num_rows; i++) {
gemui_rect_t rr = {box.x + 10, box.y + 8 + i * rh, box.w - 20, rh - 6};
if (rr.y + rr.h > box.y + box.h) break;
bool sel = (i == st->sel_row);
gemui_fill_round(cr, rr, 10, sel ? t->sel_bg : (i % 2 ? t->bg_alt_odd : t->bg_alt_even));
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + 16, rr.y, rr.w - 320, rr.h},
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + 16, rr.y, rr.w - 360, rr.h},
st->rows[i].col1, -1, true, GEMUI_ALIGN_LEFT,
sel ? t->sel_fg : t->fg_bright);
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + rr.w - 300, rr.y, 160, rr.h},
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + rr.w - 340, rr.y, 190, rr.h},
st->rows[i].col2, -2, false, GEMUI_ALIGN_RIGHT,
sel ? t->sel_fg : t->accent_alt);
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + rr.w - 130, rr.y, 116, rr.h},
gemui_draw_text(cr, t, (gemui_rect_t){rr.x + rr.w - 140, rr.y, 126, rr.h},
st->rows[i].col3, -2, false, GEMUI_ALIGN_RIGHT,
sel ? t->sel_fg : t->fg_muted);
gemui_hit_add(app, rr, HIT_ROW, i);
@@ -179,11 +179,11 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
}
if (st->tab == 0) {
int cw = 220;
gemui_draw_input(app, cr, (gemui_rect_t){pad, h - 84, w - pad * 2 - cw - 12, 64},
int cw = 260;
gemui_draw_input(app, cr, (gemui_rect_t){pad, h - 92, w - pad * 2 - cw - 12, 72},
"Wi-Fi passphrase (if connecting to secured SSID)...",
st->psk, true, st->focus_psk, HIT_PSK, 0);
gemui_draw_button(app, cr, (gemui_rect_t){w - pad - cw, h - 84, cw, 64},
gemui_draw_button(app, cr, (gemui_rect_t){w - pad - cw, h - 92, cw, 72},
"Connect Wi-Fi", HIT_CONNECT, 0, true, false, false);
}
}
@@ -293,7 +293,7 @@ int main(void) {
st.sel_row = -1;
refresh_tab(&st);
st.app = gemui_create("geminux-net", "Geminux Network & Radios", 1680, 920, false);
st.app = gemui_create("geminux-net", "Geminux Network & Radios", 1920, 940, false);
if (!st.app) return 1;
gemui_handlers_t h = { .on_draw = on_draw, .on_key = on_key, .on_ptr = on_ptr };