summaryrefslogtreecommitdiff
path: root/applets/clock
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-23 12:08:15 +0100
committerinfirit <[email protected]>2014-11-23 12:08:15 +0100
commit2db41271af1f4db0be8d6fa68bb4b06d23967eb9 (patch)
treed5661dbfa15fa52dc183382fcc307077479868f6 /applets/clock
parentedeebeed64b1ececdf66d5263f073e8090553961 (diff)
downloadmate-panel-2db41271af1f4db0be8d6fa68bb4b06d23967eb9.tar.bz2
mate-panel-2db41271af1f4db0be8d6fa68bb4b06d23967eb9.tar.xz
Gtk3: clock-map: Port to GtkStyleContext
Based on gnome-panel commit: 40391453286cce55039932d6dc3f741bb74e385f From: Germán Póo-Caamaño <[email protected]>
Diffstat (limited to 'applets/clock')
-rw-r--r--applets/clock/clock-map.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/applets/clock/clock-map.c b/applets/clock/clock-map.c
index 8e02b273..adfe137a 100644
--- a/applets/clock/clock-map.c
+++ b/applets/clock/clock-map.c
@@ -241,17 +241,23 @@ clock_map_expose (GtkWidget *this, GdkEventExpose *event)
#endif
{
ClockMapPrivate *priv = PRIVATE (this);
- GtkStyle *style;
#if GTK_CHECK_VERSION (3, 0, 0)
int width, height;
+ GtkStyleContext *context;
+ GdkRGBA color;
+
+ context = gtk_widget_get_style_context (this);
+ gtk_style_context_get_color (context, GTK_STATE_FLAG_ACTIVE, &color);
#else
+ GtkStyle *style;
GdkWindow *window;
GtkAllocation allocation;
GdkRectangle region;
cairo_t *cr;
-#endif
style = gtk_widget_get_style (this);
+#endif
+
#if !GTK_CHECK_VERSION (3, 0, 0)
window = gtk_widget_get_window (this);
gtk_widget_get_allocation (this, &allocation);
@@ -294,7 +300,7 @@ clock_map_expose (GtkWidget *this, GdkEventExpose *event)
/* draw a simple outline */
#if GTK_CHECK_VERSION (3, 0, 0)
cairo_rectangle (cr, 0.5, 0.5, width - 1, height - 1);
- gdk_cairo_set_source_color (cr, &style->mid [GTK_STATE_ACTIVE]);
+ gdk_cairo_set_source_rgba (cr, &color);
#else
cairo_rectangle (
cr,