tweaked the Networking icon

This commit is contained in:
Martin Dvořák 2026-09-10 10:59:34 +02:00
commit d1430c661d
2 changed files with 22 additions and 9 deletions

View file

@ -23,9 +23,9 @@ GTK 4 interface.
- **Deutsch** is open (round bubble with the German flag) and opens the - **Deutsch** is open (round bubble with the German flag) and opens the
German learning path German learning path
- **Správa počítačových sítí / Computer Network Administration** is open too - **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 (shown with a Wi-Fi icon) and leads to a 30-unit computer-networks path
unit, **Výpočet IP adres / IP Address Calculation**, is playable; the rest whose first unit, **Výpočet IP adres / IP Address Calculation**, is
are locked placeholders playable; the rest are locked placeholders
- the remaining subjects are dimmed/locked placeholders until their content - the remaining subjects are dimmed/locked placeholders until their content
is added is added
- layout folds into multiple rows when the window is narrow - layout folds into multiple rows when the window is narrow

View file

@ -187,6 +187,15 @@ static Rgb color_from_hex(unsigned int hex) {
return c; 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) { static ThemePalette theme_palette(ThemeId id, ColorMode mode) {
/* Catppuccin Mocha / Latte */ /* Catppuccin Mocha / Latte */
static const ThemePalette cat_dark = { 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) { int width, int height, gpointer data) {
const double s = MIN(width, height); const double s = MIN(width, height);
const double cx = width / 2.0; const double cx = width / 2.0;
const double cy = height * 0.80; const double cy = height * 0.68;
const double dot_r = s * 0.075; const double dot_r = s * 0.06;
const double radii[3] = {s * 0.17, s * 0.28, s * 0.40}; const double radii[3] = {s * 0.15, s * 0.27, s * 0.39};
const double phi = 0.88; const double phi = 0.75;
const Rgb c = color_from_hex(app_theme.on_accent); /* 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)area;
(void)data; (void)data;
cairo_set_source_rgb(cr, c.r, c.g, c.b); cairo_set_source_rgb(cr, c.r, c.g, c.b);
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND); 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++) { for (int i = 0; i < 3; i++) {
double r = radii[i]; double r = radii[i];