summaryrefslogtreecommitdiff
path: root/typing-break
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-01-13 15:33:26 +0300
committermonsta <[email protected]>2016-01-13 15:33:26 +0300
commit7d1067354abbce7fd9e562e3592a5b538d608fb5 (patch)
tree6a617626cee1ca4074195be79138e4cfad9d876e /typing-break
parentc640230c14b4c414124291429b7512fbe7ac89df (diff)
downloadmate-control-center-7d1067354abbce7fd9e562e3592a5b538d608fb5.tar.bz2
mate-control-center-7d1067354abbce7fd9e562e3592a5b538d608fb5.tar.xz
typing-break: less #if's
Diffstat (limited to 'typing-break')
-rw-r--r--typing-break/drw-break-window.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index 4ddbef52..21305c4d 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -590,30 +590,48 @@ get_layout_location (GtkLabel *label,
}
}
-static gboolean
#if GTK_CHECK_VERSION (3, 0, 0)
-label_draw_event_cb (GtkLabel *label,
- cairo_t *cr,
+static gboolean
+label_draw_event_cb (GtkLabel *label,
+ cairo_t *cr,
+ gpointer user_data)
+{
+ gint x, y;
+ GtkWidget *widget;
+
+ get_layout_location (label, &x, &y);
+
+ widget = GTK_WIDGET (label);
+
+ pango_cairo_show_layout (cr, gtk_label_get_layout (label));
+
+ gtk_paint_layout (gtk_widget_get_style (widget),
+ cr,
+ gtk_widget_get_state (widget),
+ FALSE,
+ widget,
+ "label",
+ x, y,
+ gtk_label_get_layout (label));
+
+ return TRUE;
+}
#else
+static gboolean
label_expose_event_cb (GtkLabel *label,
- GdkEventExpose *event,
-#endif
- gpointer user_data)
+ GdkEventExpose *event,
+ gpointer user_data)
{
gint x, y;
GtkWidget *widget;
GdkWindow *window;
-#if !GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr;
-#endif
+
get_layout_location (label, &x, &y);
widget = GTK_WIDGET (label);
window = gtk_widget_get_window (widget);
-#if GTK_CHECK_VERSION (3, 0, 0)
- pango_cairo_show_layout (cr, gtk_label_get_layout (label));
-#else
cr = gdk_cairo_create (window);
gdk_cairo_rectangle (cr, &event->area);
@@ -626,19 +644,12 @@ label_expose_event_cb (GtkLabel *label,
cairo_fill (cr);
cairo_destroy (cr);
-#endif
gtk_paint_layout (gtk_widget_get_style (widget),
-#if GTK_CHECK_VERSION (3, 0, 0)
- cr,
-#else
window,
-#endif
gtk_widget_get_state (widget),
FALSE,
-#if !GTK_CHECK_VERSION (3, 0, 0)
&event->area,
-#endif
widget,
"label",
x, y,
@@ -646,6 +657,7 @@ label_expose_event_cb (GtkLabel *label,
return TRUE;
}
+#endif
static void
label_size_request_cb (GtkLabel *label,