Merge lp:~brandontschaefer/overlay-scrollbar/lp.907837-v-resize-fix into lp:overlay-scrollbar

Proposed by Brandon Schaefer
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 368
Merged at revision: 369
Proposed branch: lp:~brandontschaefer/overlay-scrollbar/lp.907837-v-resize-fix
Merge into: lp:overlay-scrollbar
Prerequisite: lp:~azzar1/overlay-scrollbar/fix-907837
Diff against target: 64 lines (+32/-21)
1 file modified
os/os-scrollbar.c (+32/-21)
To merge this branch: bzr merge lp:~brandontschaefer/overlay-scrollbar/lp.907837-v-resize-fix
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+146247@code.launchpad.net

Commit message

HPaned boxes must only be able to be resized by a vertical scroll bar and a VPaned box must only be able to be resized by a horizontal scroll bar.

Description of the change

=== Problem ===

When grabbing an overlay thumb that goes LEFT-RIGHT, resizing must only work on GtkVPaned boxes, otherwise it will attempt to resize an HPaned box.. which is bad.

To post a comment you must log in.
368. By Brandon Schaefer

* Extra new line

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'os/os-scrollbar.c'
2--- os/os-scrollbar.c 2013-02-01 23:53:21 +0000
3+++ os/os-scrollbar.c 2013-02-01 23:53:21 +0000
4@@ -3639,29 +3639,40 @@
5
6 priv->allow_resize_paned = FALSE;
7 priv->resizing_paned = FALSE;
8-
9+
10 /* Check if the thumb is next to a paned handle,
11 * if that's the case, set the allow_resize_paned gboolean. */
12- switch (priv->side)
13- {
14- case OS_SIDE_RIGHT:
15- if (x + gdk_window_get_width (handle_window) - x_pos <= THUMB_WIDTH)
16- priv->allow_resize_paned = TRUE;
17- break;
18- case OS_SIDE_BOTTOM:
19- if (y + gdk_window_get_height (handle_window) - y_pos <= THUMB_WIDTH)
20- priv->allow_resize_paned = TRUE;
21- break;
22- case OS_SIDE_LEFT:
23- if (x_pos - x <= THUMB_WIDTH)
24- priv->allow_resize_paned = TRUE;
25- break;
26- case OS_SIDE_TOP:
27- if (y_pos - y <= THUMB_WIDTH)
28- priv->allow_resize_paned = TRUE;
29- break;
30- default:
31- break;
32+ if (GTK_IS_HPANED(paned))
33+ {
34+ switch (priv->side)
35+ {
36+ case OS_SIDE_RIGHT:
37+ if (x + gdk_window_get_width (handle_window) - x_pos <= THUMB_WIDTH)
38+ priv->allow_resize_paned = TRUE;
39+ break;
40+ case OS_SIDE_LEFT:
41+ if (x_pos - x <= THUMB_WIDTH)
42+ priv->allow_resize_paned = TRUE;
43+ break;
44+ default:
45+ break;
46+ }
47+ }
48+ else if (GTK_IS_VPANED(paned))
49+ {
50+ switch (priv->side)
51+ {
52+ case OS_SIDE_BOTTOM:
53+ if (y + gdk_window_get_height (handle_window) - y_pos <= THUMB_WIDTH)
54+ priv->allow_resize_paned = TRUE;
55+ break;
56+ case OS_SIDE_TOP:
57+ if (y_pos - y <= THUMB_WIDTH)
58+ priv->allow_resize_paned = TRUE;
59+ break;
60+ default:
61+ break;
62+ }
63 }
64 }
65

Subscribers

People subscribed via source and target branches