diff options
author | monsta <[email protected]> | 2016-01-21 11:43:02 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-01-21 11:43:02 +0300 |
commit | 63e53e66fec956af3d4920d9a9a4cd56483413fe (patch) | |
tree | 3de860a5bc26d2337fda14cec4ae4bb1c12e7a32 /mate-window-picker-applet/task-title.c | |
parent | 20a203e9eb09e3e8410e1043f245052d24dd5b93 (diff) | |
download | mate-netbook-63e53e66fec956af3d4920d9a9a4cd56483413fe.tar.bz2 mate-netbook-63e53e66fec956af3d4920d9a9a4cd56483413fe.tar.xz |
window picker: less #if's again
Diffstat (limited to 'mate-window-picker-applet/task-title.c')
-rw-r--r-- | mate-window-picker-applet/task-title.c | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/mate-window-picker-applet/task-title.c b/mate-window-picker-applet/task-title.c index c423dc2..bcc594f 100644 --- a/mate-window-picker-applet/task-title.c +++ b/mate-window-picker-applet/task-title.c @@ -107,15 +107,11 @@ on_leave_notify (GtkWidget *widget, return FALSE; } -static gboolean #if GTK_CHECK_VERSION (3, 0, 0) +static gboolean on_button_draw (GtkWidget *widget, cairo_t *cr, -#else -on_button_expose (GtkWidget *widget, - GdkEventExpose *event, -#endif - TaskTitle *title) + TaskTitle *title) { g_return_val_if_fail (TASK_IS_TITLE (title), FALSE); @@ -125,7 +121,6 @@ on_button_expose (GtkWidget *widget, if (priv->mouse_in_close_button) { GtkStyle *style = gtk_widget_get_style (widget); -#if GTK_CHECK_VERSION (3, 0, 0) GdkRectangle area; gdouble x1, y1, x2, y2; cairo_clip_extents (cr, &x1, &y1, &x2, &y2); @@ -133,34 +128,50 @@ on_button_expose (GtkWidget *widget, area.y = floor (y1); area.width = ceil (x2) - area.x; area.height = ceil (y2) - area.y; -#endif + gtk_paint_box (style, -#if GTK_CHECK_VERSION (3, 0, 0) cr, -#else - event->window, -#endif GTK_STATE_PRELIGHT, GTK_SHADOW_NONE, -#if !GTK_CHECK_VERSION (3, 0, 0) NULL, -#endif NULL, - NULL, -#if GTK_CHECK_VERSION (3, 0, 0) area.x, area.y + 2, area.width, area.height - 4); + } + return FALSE; +} #else +static gboolean +on_button_expose (GtkWidget *widget, + GdkEventExpose *event, + TaskTitle *title) +{ + g_return_val_if_fail (TASK_IS_TITLE (title), FALSE); + + TaskTitlePrivate *priv; + priv = title->priv; + + if (priv->mouse_in_close_button) + { + GtkStyle *style = gtk_widget_get_style (widget); + + gtk_paint_box (style, + event->window, + GTK_STATE_PRELIGHT, + GTK_SHADOW_NONE, + NULL, + NULL, + NULL, event->area.x, event->area.y + 2, event->area.width, event->area.height - 4); -#endif } return FALSE; } +#endif static void on_name_changed (WnckWindow *window, TaskTitle *title) |