summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigifab <[email protected]>2025-03-13 19:45:52 +0100
committerLuke from DC <[email protected]>2025-04-06 07:08:05 +0000
commit0a653c1a5bf3de9a2ba36d7c4225846332a1921e (patch)
tree85f6e68cf8b0a9c5995c950b12580a930d4adc2c
parentc4497b9414a70050d89a0bdce52d42c77ee87adb (diff)
downloadmate-notification-daemon-0a653c1a5bf3de9a2ba36d7c4225846332a1921e.tar.bz2
mate-notification-daemon-0a653c1a5bf3de9a2ba36d7c4225846332a1921e.tar.xz
Allow to set countdown color from CSS
-rw-r--r--src/themes/coco/coco-theme.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/themes/coco/coco-theme.c b/src/themes/coco/coco-theme.c
index b96c52f..f18e9a5 100644
--- a/src/themes/coco/coco-theme.c
+++ b/src/themes/coco/coco-theme.c
@@ -172,7 +172,17 @@ draw_pie(GtkWidget *pie, WindowData *windata, cairo_t *cr)
return;
gdouble arc_angle = 1.0 - (gdouble)windata->remaining / (gdouble)windata->timeout;
- cairo_set_source_rgba (cr, 1.0, 0.4, 0.0, 0.3);
+
+ // .notification-box .countdown:active { color:#aabbcc; }
+ GdkRGBA colorFront, colorBack;
+ GtkStyleContext *context = gtk_widget_get_style_context (pie);
+ gtk_style_context_get_color (context, GTK_STATE_FLAG_ACTIVE, &colorFront);
+ gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &colorBack);
+ if (gdk_rgba_equal (&colorFront, &colorBack))
+ cairo_set_source_rgba (cr, 1.0, 0.4, 0.0, 0.3);
+ else
+ cairo_set_source_rgba (cr, colorFront.red, colorFront.green, colorFront.blue, colorFront.alpha);
+
cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS);
cairo_arc_negative(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS,
-G_PI/2, (-0.25 + arc_angle)*2*G_PI);