fix: kernel and desktop bug fixes

This commit is contained in:
2026-05-14 11:31:14 +02:00
parent 2abee0c634
commit 4fde39397a
11 changed files with 507 additions and 106 deletions
+7 -5
View File
@@ -10,14 +10,16 @@ void gui::desktop_draw_panel(DesktopState* ds) {
Framebuffer& fb = ds->fb;
int sw = ds->screen_w;
// Panel gradient background (slightly lighter at top)
// Panel gradient background (slightly lighter at top).
// Saturating add so light panel colors don't wrap around to dark via uint8_t overflow.
Color pc = ds->settings.panel_color;
for (int y = 0; y < PANEL_HEIGHT; y++) {
int t = y * 255 / PANEL_HEIGHT;
uint8_t r = pc.r + (10 - t * 10 / 255);
uint8_t g = pc.g + (10 - t * 10 / 255);
uint8_t b = pc.b + (10 - t * 10 / 255);
fb.fill_rect(0, y, sw, 1, Color::from_rgb(r, g, b));
int delta = 10 - t * 10 / 255;
int r = (int)pc.r + delta; if (r > 255) r = 255;
int g = (int)pc.g + delta; if (g > 255) g = 255;
int b = (int)pc.b + delta; if (b > 255) b = 255;
fb.fill_rect(0, y, sw, 1, Color::from_rgb((uint8_t)r, (uint8_t)g, (uint8_t)b));
}
// Bottom highlight line (skip when wallpaper is set — the white bleeds through)