From d1430c661d43ac5639b3c0cda019933ff3c7a883 Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Thu, 10 Sep 2026 10:59:34 +0200 Subject: [PATCH] tweaked the Networking icon --- README.md | 6 +++--- maturita.c | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 966a51f..f314a5d 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ GTK 4 interface. - **Deutsch** is open (round bubble with the German flag) and opens the German learning path - **Správa počítačových sítí / Computer Network Administration** is open too - (marked "IP") and leads to a 30-unit computer-networks path whose first - unit, **Výpočet IP adres / IP Address Calculation**, is playable; the rest - are locked placeholders + (shown with a Wi-Fi icon) and leads to a 30-unit computer-networks path + whose first unit, **Výpočet IP adres / IP Address Calculation**, is + playable; the rest are locked placeholders - the remaining subjects are dimmed/locked placeholders until their content is added - layout folds into multiple rows when the window is narrow diff --git a/maturita.c b/maturita.c index 0438469..2b5e24b 100644 --- a/maturita.c +++ b/maturita.c @@ -187,6 +187,15 @@ static Rgb color_from_hex(unsigned int hex) { return c; } +/* Linear blend of two colours: t = 0 keeps a, t = 1 returns b. */ +static Rgb mix_rgb(Rgb a, Rgb b, double t) { + Rgb c; + c.r = a.r + (b.r - a.r) * t; + c.g = a.g + (b.g - a.g) * t; + c.b = a.b + (b.b - a.b) * t; + return c; +} + static ThemePalette theme_palette(ThemeId id, ColorMode mode) { /* Catppuccin Mocha / Latte */ static const ThemePalette cat_dark = { @@ -2017,18 +2026,22 @@ static void draw_wifi_icon(GtkDrawingArea *area, cairo_t *cr, int width, int height, gpointer data) { const double s = MIN(width, height); const double cx = width / 2.0; - const double cy = height * 0.80; - const double dot_r = s * 0.075; - const double radii[3] = {s * 0.17, s * 0.28, s * 0.40}; - const double phi = 0.88; - const Rgb c = color_from_hex(app_theme.on_accent); + const double cy = height * 0.68; + const double dot_r = s * 0.06; + const double radii[3] = {s * 0.15, s * 0.27, s * 0.39}; + const double phi = 0.75; + /* Keep the icon legible on the accent-gradient bubble while giving it a + * hint of the active theme: blend the contrasting on-accent colour a + * little way towards the palette's middle accent. */ + const Rgb c = mix_rgb(color_from_hex(app_theme.on_accent), + color_from_hex(app_theme.accent2), 0.22); (void)area; (void)data; cairo_set_source_rgb(cr, c.r, c.g, c.b); cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND); - cairo_set_line_width(cr, MAX(1.5, s * 0.10)); + cairo_set_line_width(cr, MAX(1.5, s * 0.07)); for (int i = 0; i < 3; i++) { double r = radii[i];