Merge lp:~cimi/overlay-scrollbar/visual-connection into lp:overlay-scrollbar

Proposed by Andrea Cimitan
Status: Merged
Merged at revision: 233
Proposed branch: lp:~cimi/overlay-scrollbar/visual-connection
Merge into: lp:overlay-scrollbar
Diff against target: 543 lines (+253/-28)
4 files modified
os/os-pager.c (+174/-5)
os/os-private.h (+6/-0)
os/os-scrollbar.c (+73/-14)
os/os-thumb.c (+0/-9)
To merge this branch: bzr merge lp:~cimi/overlay-scrollbar/visual-connection
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+60852@code.launchpad.net

Description of the change

Add a visual connection between pager and thumb when detached

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'os/os-pager.c'
--- os/os-pager.c 2011-04-27 00:44:09 +0000
+++ os/os-pager.c 2011-05-12 23:41:31 +0000
@@ -39,11 +39,14 @@
3939
40struct _OsPagerPrivate {40struct _OsPagerPrivate {
41 GdkWindow *pager_window;41 GdkWindow *pager_window;
42 GdkWindow *connection_window;
42 GtkWidget *parent;43 GtkWidget *parent;
43 GdkRectangle mask;44 GdkRectangle mask;
45 GdkRectangle connection_mask; /* in theory not needed, but easier to read. */
44 GdkRectangle allocation;46 GdkRectangle allocation;
45 OsAnimation *animation;47 OsAnimation *animation;
46 gboolean active;48 gboolean active;
49 gboolean detached;
47 gboolean visible;50 gboolean visible;
48 gfloat weight;51 gfloat weight;
49 gint width;52 gint width;
@@ -57,6 +60,7 @@
57static void os_pager_change_state_cb (gfloat weight, gpointer user_data);60static void os_pager_change_state_cb (gfloat weight, gpointer user_data);
58static void os_pager_create (OsPager *pager);61static void os_pager_create (OsPager *pager);
59static void os_pager_draw (OsPager *pager);62static void os_pager_draw (OsPager *pager);
63static void os_pager_draw_connection (OsPager *pager);
60static void os_pager_mask (OsPager *pager);64static void os_pager_mask (OsPager *pager);
61static void os_pager_notify_gtk_theme_name_cb (GObject *object, GParamSpec* pspec, gpointer user_data);65static void os_pager_notify_gtk_theme_name_cb (GObject *object, GParamSpec* pspec, gpointer user_data);
6266
@@ -85,7 +89,21 @@
8589
86 /* Instead reparenting,90 /* Instead reparenting,
87 * which doesn't seem to work well,91 * which doesn't seem to work well,
88 * destroy the window. */92 * destroy the two windows. */
93 if (priv->connection_window != NULL)
94 {
95 /* From the Gdk documentation:
96 * "Note that a window will not be destroyed
97 * automatically when its reference count
98 * reaches zero. You must call
99 * gdk_window_destroy ()
100 * yourself before that happens". */
101 gdk_window_destroy (priv->connection_window);
102
103 g_object_unref (priv->connection_window);
104 priv->connection_window = NULL;
105 }
106
89 if (priv->pager_window != NULL)107 if (priv->pager_window != NULL)
90 {108 {
91 /* From the Gdk documentation:109 /* From the Gdk documentation:
@@ -107,14 +125,30 @@
107 attributes.visual = gtk_widget_get_visual (priv->parent);125 attributes.visual = gtk_widget_get_visual (priv->parent);
108 attributes.colormap = gtk_widget_get_colormap (priv->parent);126 attributes.colormap = gtk_widget_get_colormap (priv->parent);
109127
128 /* connection_window */
129 priv->connection_window = gdk_window_new (gtk_widget_get_window (priv->parent),
130 &attributes,
131 GDK_WA_VISUAL | GDK_WA_COLORMAP);
132
133 g_object_ref_sink (priv->connection_window);
134
135 gdk_window_set_transient_for (priv->connection_window,
136 gtk_widget_get_window (priv->parent));
137
138 gdk_window_input_shape_combine_region (priv->connection_window,
139 gdk_region_new (),
140 0, 0);
141
142 /* pager_window */
110 priv->pager_window = gdk_window_new (gtk_widget_get_window (priv->parent),143 priv->pager_window = gdk_window_new (gtk_widget_get_window (priv->parent),
111 &attributes,144 &attributes,
112 GDK_WA_VISUAL | GDK_WA_COLORMAP);145 GDK_WA_VISUAL | GDK_WA_COLORMAP);
113146
114 g_object_ref_sink (priv->pager_window);147 g_object_ref_sink (priv->pager_window);
115148
149 /* stay above the connection_window */
116 gdk_window_set_transient_for (priv->pager_window,150 gdk_window_set_transient_for (priv->pager_window,
117 gtk_widget_get_window (priv->parent));151 priv->connection_window);
118152
119 gdk_window_input_shape_combine_region (priv->pager_window,153 gdk_window_input_shape_combine_region (priv->pager_window,
120 gdk_region_new (),154 gdk_region_new (),
@@ -137,10 +171,11 @@
137 if (priv->parent == NULL)171 if (priv->parent == NULL)
138 return;172 return;
139173
174 os_pager_draw_connection (pager);
140 os_pager_draw (pager);175 os_pager_draw (pager);
141}176}
142177
143/* Draw on the pager. */178/* Draw on the pager_window. */
144static void179static void
145os_pager_draw (OsPager *pager)180os_pager_draw (OsPager *pager)
146{181{
@@ -179,7 +214,30 @@
179 gdk_window_invalidate_rect (gtk_widget_get_window (priv->parent), &priv->allocation, TRUE);214 gdk_window_invalidate_rect (gtk_widget_get_window (priv->parent), &priv->allocation, TRUE);
180}215}
181216
182/* Mask the pager. */217/* Draw on the connection_window. */
218static void
219os_pager_draw_connection (OsPager *pager)
220{
221 GdkColor color;
222 OsPagerPrivate *priv;
223
224 priv = pager->priv;
225
226 /* 0.6 is taken from os_thumb_expose. */
227 color.red = 65535 * 0.6;
228 color.green = 65535 * 0.6;
229 color.blue = 65535 * 0.6;
230
231 gdk_colormap_alloc_color (gdk_drawable_get_colormap (priv->connection_window), &color, FALSE, TRUE);
232
233 gdk_window_set_background (priv->connection_window, &color);
234
235 gdk_window_clear (priv->connection_window);
236
237 gdk_window_invalidate_rect (gtk_widget_get_window (priv->parent), &priv->allocation, TRUE);
238}
239
240/* Mask the pager_window. */
183static void241static void
184os_pager_mask (OsPager *pager)242os_pager_mask (OsPager *pager)
185{243{
@@ -194,6 +252,21 @@
194 gdk_window_clear (priv->pager_window);252 gdk_window_clear (priv->pager_window);
195}253}
196254
255/* Mask the connection_window. */
256static void
257os_pager_mask_connection (OsPager *pager)
258{
259 OsPagerPrivate *priv;
260
261 priv = pager->priv;
262
263 gdk_window_shape_combine_region (priv->connection_window,
264 gdk_region_rectangle (&priv->connection_mask),
265 0, 0);
266
267 gdk_window_clear (priv->connection_window);
268}
269
197static void270static void
198os_pager_notify_gtk_theme_name_cb (GObject* gobject,271os_pager_notify_gtk_theme_name_cb (GObject* gobject,
199 GParamSpec* pspec,272 GParamSpec* pspec,
@@ -205,9 +278,12 @@
205 pager = OS_PAGER (user_data);278 pager = OS_PAGER (user_data);
206 priv = pager->priv;279 priv = pager->priv;
207280
208 if (priv->parent == NULL || priv->pager_window == NULL)281 if (priv->parent == NULL ||
282 priv->pager_window == NULL ||
283 priv->connection_window == NULL)
209 return;284 return;
210285
286 os_pager_draw_connection (pager);
211 os_pager_draw (pager);287 os_pager_draw (pager);
212}288}
213289
@@ -249,9 +325,11 @@
249 mask.width = 1;325 mask.width = 1;
250 mask.height = 1;326 mask.height = 1;
251327
328 priv->connection_mask = mask;
252 priv->mask = mask;329 priv->mask = mask;
253330
254 priv->active = FALSE;331 priv->active = FALSE;
332 priv->detached = FALSE;
255 priv->visible = FALSE;333 priv->visible = FALSE;
256334
257 priv->weight = 1.0f;335 priv->weight = 1.0f;
@@ -278,6 +356,20 @@
278 priv->animation = NULL;356 priv->animation = NULL;
279 }357 }
280358
359 if (priv->connection_window != NULL)
360 {
361 /* From the Gdk documentation:
362 * "Note that a window will not be destroyed
363 * automatically when its reference count
364 * reaches zero. You must call
365 * gdk_window_destroy ()
366 * yourself before that happens". */
367 gdk_window_destroy (priv->connection_window);
368
369 g_object_unref (priv->connection_window);
370 priv->connection_window = NULL;
371 }
372
281 if (priv->pager_window != NULL)373 if (priv->pager_window != NULL)
282 {374 {
283 /* From the Gdk documentation:375 /* From the Gdk documentation:
@@ -322,6 +414,34 @@
322}414}
323415
324/**416/**
417 * os_pager_connect:
418 * @pager: a #OsPager
419 * @mask: a #GdkRectangle with the position and dimension of the connection
420 *
421 * Moves and resizes connection.
422 **/
423void
424os_pager_connect (OsPager *pager,
425 GdkRectangle mask)
426{
427 OsPagerPrivate *priv;
428
429 g_return_if_fail (OS_PAGER (pager));
430
431 priv = pager->priv;
432
433 if (!rectangle_changed (priv->connection_mask, mask))
434 return;
435
436 priv->connection_mask = mask;
437
438 if (priv->parent == NULL)
439 return;
440
441 os_pager_mask_connection (pager);
442}
443
444/**
325 * os_pager_hide:445 * os_pager_hide:
326 * @pager: a #OsPager446 * @pager: a #OsPager
327 *447 *
@@ -344,6 +464,7 @@
344 /* if there's an animation currently running, stop it. */464 /* if there's an animation currently running, stop it. */
345 os_animation_stop (priv->animation);465 os_animation_stop (priv->animation);
346466
467 gdk_window_hide (priv->connection_window);
347 gdk_window_hide (priv->pager_window);468 gdk_window_hide (priv->pager_window);
348}469}
349470
@@ -419,6 +540,41 @@
419}540}
420541
421/**542/**
543 * os_pager_set_detached:
544 * @pager: a #OsPager
545 * @detached: whether the pager is detached or not
546 *
547 * Changes the detached state of @pager.
548 **/
549void
550os_pager_set_detached (OsPager *pager,
551 gboolean detached)
552{
553 OsPagerPrivate *priv;
554
555 g_return_if_fail (OS_PAGER (pager));
556
557 priv = pager->priv;
558
559 if (priv->detached != detached)
560 {
561 priv->detached = detached;
562
563 if (priv->parent == NULL)
564 return;
565
566 if (priv->detached)
567 {
568 gdk_window_show (priv->connection_window);
569
570 gdk_window_clear (priv->connection_window);
571 }
572 else
573 gdk_window_hide (priv->connection_window);
574 }
575}
576
577/**
422 * os_pager_set_parent:578 * os_pager_set_parent:
423 * @pager: a #OsPager579 * @pager: a #OsPager
424 * @parent: a #GtkWidget580 * @parent: a #GtkWidget
@@ -453,9 +609,16 @@
453 priv->weight = 1.0f;609 priv->weight = 1.0f;
454610
455 os_pager_create (pager);611 os_pager_create (pager);
612 os_pager_draw_connection (pager);
456 os_pager_draw (pager);613 os_pager_draw (pager);
457 os_pager_mask (pager);614 os_pager_mask (pager);
458615
616 gdk_window_move_resize (priv->connection_window,
617 priv->allocation.x,
618 priv->allocation.y,
619 priv->allocation.width,
620 priv->allocation.height);
621
459 gdk_window_move_resize (priv->pager_window,622 gdk_window_move_resize (priv->pager_window,
460 priv->allocation.x,623 priv->allocation.x,
461 priv->allocation.y,624 priv->allocation.y,
@@ -521,6 +684,12 @@
521 if (priv->parent == NULL)684 if (priv->parent == NULL)
522 return;685 return;
523686
687 gdk_window_move_resize (priv->connection_window,
688 rectangle.x,
689 rectangle.y,
690 rectangle.width,
691 rectangle.height);
692
524 gdk_window_move_resize (priv->pager_window,693 gdk_window_move_resize (priv->pager_window,
525 rectangle.x,694 rectangle.x,
526 rectangle.y,695 rectangle.y,
527696
=== modified file 'os/os-private.h'
--- os/os-private.h 2011-05-06 15:46:50 +0000
+++ os/os-private.h 2011-05-12 23:41:31 +0000
@@ -208,12 +208,18 @@
208208
209void os_pager_hide (OsPager *overlay);209void os_pager_hide (OsPager *overlay);
210210
211void os_pager_connect (OsPager *overlay,
212 GdkRectangle mask);
213
211void os_pager_move_resize (OsPager *overlay,214void os_pager_move_resize (OsPager *overlay,
212 GdkRectangle mask);215 GdkRectangle mask);
213216
214void os_pager_set_active (OsPager *overlay,217void os_pager_set_active (OsPager *overlay,
215 gboolean active);218 gboolean active);
216219
220void os_pager_set_detached (OsPager *overlay,
221 gboolean detached);
222
217void os_pager_set_parent (OsPager *pager,223void os_pager_set_parent (OsPager *pager,
218 GtkWidget *parent);224 GtkWidget *parent);
219225
220226
=== modified file 'os/os-scrollbar.c'
--- os/os-scrollbar.c 2011-05-08 14:06:01 +0000
+++ os/os-scrollbar.c 2011-05-12 23:41:31 +0000
@@ -494,10 +494,8 @@
494 gpointer user_data)494 gpointer user_data)
495{495{
496 OsScrollbar *scrollbar;496 OsScrollbar *scrollbar;
497 OsScrollbarPrivate *priv;
498497
499 scrollbar = OS_SCROLLBAR (object);498 scrollbar = OS_SCROLLBAR (object);
500 priv = scrollbar->priv;
501499
502 os_scrollbar_swap_adjustment (scrollbar, gtk_range_get_adjustment (GTK_RANGE (object)));500 os_scrollbar_swap_adjustment (scrollbar, gtk_range_get_adjustment (GTK_RANGE (object)));
503}501}
@@ -854,14 +852,12 @@
854{852{
855 Display *display;853 Display *display;
856 OsScrollbar *scrollbar;854 OsScrollbar *scrollbar;
857 OsScrollbarPrivate *priv;
858 XWindowChanges changes;855 XWindowChanges changes;
859 guint32 xid, xid_parent;856 guint32 xid, xid_parent;
860 unsigned int value_mask = CWSibling | CWStackMode;857 unsigned int value_mask = CWSibling | CWStackMode;
861 int res;858 int res;
862859
863 scrollbar = OS_SCROLLBAR (user_data);860 scrollbar = OS_SCROLLBAR (user_data);
864 priv = scrollbar->priv;
865861
866 xid = GDK_WINDOW_XID (gtk_widget_get_window (widget));862 xid = GDK_WINDOW_XID (gtk_widget_get_window (widget));
867 xid_parent = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (scrollbar)));863 xid_parent = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (scrollbar)));
@@ -1027,6 +1023,8 @@
1027 scrollbar = OS_SCROLLBAR (user_data);1023 scrollbar = OS_SCROLLBAR (user_data);
1028 priv = scrollbar->priv;1024 priv = scrollbar->priv;
10291025
1026 priv->value_changed_event = TRUE;
1027
1030 delta = os_scrollbar_get_wheel_delta (scrollbar, event->direction);1028 delta = os_scrollbar_get_wheel_delta (scrollbar, event->direction);
10311029
1032 gtk_adjustment_set_value (priv->adjustment,1030 gtk_adjustment_set_value (priv->adjustment,
@@ -1051,6 +1049,8 @@
1051 priv->button_press_event = FALSE;1049 priv->button_press_event = FALSE;
1052 priv->motion_notify_event = FALSE;1050 priv->motion_notify_event = FALSE;
1053 priv->enter_notify_event = FALSE;1051 priv->enter_notify_event = FALSE;
1052
1053 os_pager_set_detached (OS_PAGER (priv->pager), FALSE);
1054}1054}
10551055
1056/* Move the pager to the right position. */1056/* Move the pager to the right position. */
@@ -1169,7 +1169,10 @@
1169 {1169 {
1170 /* if we're dragging the thumb, it can't be detached. */1170 /* if we're dragging the thumb, it can't be detached. */
1171 if (priv->motion_notify_event)1171 if (priv->motion_notify_event)
1172 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);1172 {
1173 os_pager_set_detached (OS_PAGER (priv->pager), FALSE);
1174 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);
1175 }
1173 else1176 else
1174 {1177 {
1175 gint x_pos, y_pos;1178 gint x_pos, y_pos;
@@ -1177,19 +1180,73 @@
11771180
1178 if (priv->orientation == GTK_ORIENTATION_VERTICAL)1181 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
1179 {1182 {
1180 if ((priv->win_y + priv->overlay.y > y_pos + priv->slider.height) ||1183 if (priv->win_y + priv->overlay.y > y_pos + priv->slider.height)
1181 (priv->win_y + priv->overlay.y + priv->overlay.height < y_pos))1184 {
1182 os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE);1185 GdkRectangle mask;
1183 else1186
1184 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);1187 mask.x = 0;
1188 mask.y = y_pos + priv->slider.height / 2 - priv->win_y;
1189 mask.width = DEFAULT_PAGER_WIDTH;
1190 mask.height = priv->overlay.y - mask.y;
1191
1192 os_pager_connect (OS_PAGER (priv->pager), mask);
1193 os_pager_set_detached (OS_PAGER (priv->pager), TRUE);
1194
1195 os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE);
1196 }
1197 else if (priv->win_y + priv->overlay.y + priv->overlay.height < y_pos)
1198 {
1199 GdkRectangle mask;
1200
1201 mask.x = 0;
1202 mask.y = priv->overlay.y + priv->overlay.height;
1203 mask.width = DEFAULT_PAGER_WIDTH;
1204 mask.height = y_pos + priv->slider.height / 2 - priv->win_y - mask.y;
1205
1206 os_pager_connect (OS_PAGER (priv->pager), mask);
1207 os_pager_set_detached (OS_PAGER (priv->pager), TRUE);
1208
1209 os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE);
1210 }
1211 else
1212 {
1213 os_pager_set_detached (OS_PAGER (priv->pager), FALSE);
1214 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);
1215 }
1185 }1216 }
1186 else1217 else
1187 {1218 {
1188 if ((priv->win_x + priv->overlay.x > x_pos + priv->slider.width) ||1219 if (priv->win_x + priv->overlay.x > x_pos + priv->slider.width)
1189 (priv->win_x + priv->overlay.x + priv->overlay.width < x_pos))1220 {
1190 os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE);1221 GdkRectangle mask;
1222
1223 mask.x = x_pos + priv->slider.width / 2 - priv->win_x;
1224 mask.y = 0;
1225 mask.width = priv->overlay.x - mask.x;
1226 mask.height = DEFAULT_PAGER_WIDTH;
1227
1228 os_pager_connect (OS_PAGER (priv->pager), mask);
1229 os_pager_set_detached (OS_PAGER (priv->pager), TRUE);
1230
1231 os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE);
1232 }
1233 else if (priv->win_x + priv->overlay.x + priv->overlay.width < x_pos)
1234 {
1235 GdkRectangle mask;
1236
1237 mask.x = priv->overlay.y + priv->overlay.height;
1238 mask.y = 0;
1239 mask.width = x_pos + priv->slider.width / 2 - priv->win_x - mask.x;
1240 mask.height = DEFAULT_PAGER_WIDTH;
1241
1242 os_pager_connect (OS_PAGER (priv->pager), mask);
1243 os_pager_set_detached (OS_PAGER (priv->pager), TRUE);
1244 }
1191 else1245 else
1192 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);1246 {
1247 os_pager_set_detached (OS_PAGER (priv->pager), FALSE);
1248 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);
1249 }
1193 }1250 }
1194 }1251 }
1195 }1252 }
@@ -1431,6 +1488,7 @@
1431 os_scrollbar_move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y);1488 os_scrollbar_move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y);
1432 }1489 }
14331490
1491 os_pager_set_detached (OS_PAGER (priv->pager), FALSE);
1434 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);1492 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);
1435 gtk_widget_show (GTK_WIDGET (priv->thumb));1493 gtk_widget_show (GTK_WIDGET (priv->thumb));
1436 }1494 }
@@ -1471,6 +1529,7 @@
1471 os_scrollbar_move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y);1529 os_scrollbar_move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y);
1472 }1530 }
14731531
1532 os_pager_set_detached (OS_PAGER (priv->pager), FALSE);
1474 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);1533 os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE);
1475 gtk_widget_show (GTK_WIDGET (priv->thumb));1534 gtk_widget_show (GTK_WIDGET (priv->thumb));
1476 }1535 }
14771536
=== modified file 'os/os-thumb.c'
--- os/os-thumb.c 2011-05-08 14:06:01 +0000
+++ os/os-thumb.c 2011-05-12 23:41:31 +0000
@@ -138,12 +138,9 @@
138 gpointer user_data)138 gpointer user_data)
139{139{
140 OsThumb *thumb;140 OsThumb *thumb;
141 OsThumbPrivate *priv;
142141
143 thumb = OS_THUMB (user_data);142 thumb = OS_THUMB (user_data);
144143
145 priv = thumb->priv;
146
147 if (weight < 1.0f)144 if (weight < 1.0f)
148 gtk_window_set_opacity (GTK_WINDOW (thumb), fabs (weight - 1.0f));145 gtk_window_set_opacity (GTK_WINDOW (thumb), fabs (weight - 1.0f));
149 else146 else
@@ -379,7 +376,6 @@
379 GdkEventExpose *event)376 GdkEventExpose *event)
380{377{
381 GtkAllocation allocation;378 GtkAllocation allocation;
382 GtkStateType state_type_down, state_type_up;
383 GtkStyle *style;379 GtkStyle *style;
384 OsThumb *thumb;380 OsThumb *thumb;
385 OsThumbPrivate *priv;381 OsThumbPrivate *priv;
@@ -393,9 +389,6 @@
393 thumb = OS_THUMB (widget);389 thumb = OS_THUMB (widget);
394 priv = thumb->priv;390 priv = thumb->priv;
395391
396 state_type_down = GTK_STATE_NORMAL;
397 state_type_up = GTK_STATE_NORMAL;
398
399 gtk_widget_get_allocation (widget, &allocation);392 gtk_widget_get_allocation (widget, &allocation);
400393
401 x = 0;394 x = 0;
@@ -445,7 +438,6 @@
445 if ((priv->orientation == GTK_ORIENTATION_VERTICAL && (priv->pointer_y < height / 2)) ||438 if ((priv->orientation == GTK_ORIENTATION_VERTICAL && (priv->pointer_y < height / 2)) ||
446 (priv->orientation == GTK_ORIENTATION_HORIZONTAL && (priv->pointer_x < width / 2)))439 (priv->orientation == GTK_ORIENTATION_HORIZONTAL && (priv->pointer_x < width / 2)))
447 {440 {
448 state_type_up = GTK_STATE_ACTIVE;
449 cairo_pattern_add_color_stop_rgba (pat, 0.0, 0.8, 0.8, 0.8, 0.8);441 cairo_pattern_add_color_stop_rgba (pat, 0.0, 0.8, 0.8, 0.8, 0.8);
450 cairo_pattern_add_color_stop_rgba (pat, 0.49, 1.0, 1.0, 1.0, 0.0);442 cairo_pattern_add_color_stop_rgba (pat, 0.49, 1.0, 1.0, 1.0, 0.0);
451 cairo_pattern_add_color_stop_rgba (pat, 0.49, 0.8, 0.8, 0.8, 0.5);443 cairo_pattern_add_color_stop_rgba (pat, 0.49, 0.8, 0.8, 0.8, 0.5);
@@ -453,7 +445,6 @@
453 }445 }
454 else446 else
455 {447 {
456 state_type_down = GTK_STATE_ACTIVE;
457 cairo_pattern_add_color_stop_rgba (pat, 0.0, 1.0, 1.0, 1.0, 0.8);448 cairo_pattern_add_color_stop_rgba (pat, 0.0, 1.0, 1.0, 1.0, 0.8);
458 cairo_pattern_add_color_stop_rgba (pat, 0.49, 1.0, 1.0, 1.0, 0.0);449 cairo_pattern_add_color_stop_rgba (pat, 0.49, 1.0, 1.0, 1.0, 0.0);
459 cairo_pattern_add_color_stop_rgba (pat, 0.49, 0.8, 0.8, 0.8, 0.5);450 cairo_pattern_add_color_stop_rgba (pat, 0.49, 0.8, 0.8, 0.8, 0.5);

Subscribers

People subscribed via source and target branches