Merge lp:~cimi/overlay-scrollbar/proximity-over-pager into lp:overlay-scrollbar

Proposed by Andrea Cimitan
Status: Merged
Approved by: Ted Gould
Approved revision: 252
Merged at revision: 252
Proposed branch: lp:~cimi/overlay-scrollbar/proximity-over-pager
Merge into: lp:overlay-scrollbar
Diff against target: 122 lines (+32/-32)
1 file modified
os/os-scrollbar.c (+32/-32)
To merge this branch: bzr merge lp:~cimi/overlay-scrollbar/proximity-over-pager
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+64578@code.launchpad.net

Description of the change

The idea is to have proximity also over the pager, that means the thumb will appear immediately when approaching from the right (now, you need to go on the left of the pager, then right again)

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

I was unclear on DEFAULT_PAGER_WIDTH as I thought it was the size of it, but I asked Cimi over IM and he explained that it is more like that spacing for the proximity area from the end of the visible items.

review: Approve
Revision history for this message
Andrea Cimitan (cimi) wrote :

in reality is the width/size in pixels of the pager, but I'll open a new branch with better namings :D

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 2011-06-14 16:37:12 +0000
3+++ os/os-scrollbar.c 2011-06-14 17:23:31 +0000
4@@ -1619,10 +1619,10 @@
5 /* proximity area */
6 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
7 {
8- if ((priv->thumb_all.x - xiev->event_x <= PROXIMITY_WIDTH &&
9- priv->thumb_all.x - xiev->event_x >= 0) &&
10- (xiev->event_y >= priv->thumb_all.y + priv->overlay.y &&
11- xiev->event_y <= priv->thumb_all.y + priv->overlay.y + priv->overlay.height))
12+ if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x <= PROXIMITY_WIDTH &&
13+ priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x >= 0) &&
14+ (xiev->event_y >= priv->overlay_all.y + priv->overlay.y &&
15+ xiev->event_y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height))
16 {
17 priv->can_hide = FALSE;
18
19@@ -1652,10 +1652,10 @@
20 }
21 else
22 {
23- if ((priv->thumb_all.y - xiev->event_y <= PROXIMITY_WIDTH &&
24- priv->thumb_all.y - xiev->event_y >= 0) &&
25- (xiev->event_x >= priv->thumb_all.x + priv->overlay.x &&
26- xiev->event_x <= priv->thumb_all.x + priv->overlay.x + priv->overlay.width))
27+ if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y <= PROXIMITY_WIDTH &&
28+ priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y >= 0) &&
29+ (xiev->event_x >= priv->overlay_all.x + priv->overlay.x &&
30+ xiev->event_x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width))
31 {
32 priv->can_hide = FALSE;
33
34@@ -1746,10 +1746,10 @@
35 /* proximity area */
36 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
37 {
38- if ((priv->thumb_all.x - xiev->event_x <= PROXIMITY_WIDTH &&
39- priv->thumb_all.x - xiev->event_x >= 0) &&
40- (xiev->event_y >= priv->thumb_all.y + priv->overlay.y &&
41- xiev->event_y <= priv->thumb_all.y + priv->overlay.y + priv->overlay.height))
42+ if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x <= PROXIMITY_WIDTH &&
43+ priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x >= 0) &&
44+ (xiev->event_y >= priv->overlay_all.y + priv->overlay.y &&
45+ xiev->event_y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height))
46 {
47 priv->can_hide = FALSE;
48
49@@ -1787,10 +1787,10 @@
50 }
51 else
52 {
53- if ((priv->thumb_all.y - xiev->event_y <= PROXIMITY_WIDTH &&
54- priv->thumb_all.y - xiev->event_y >= 0) &&
55- (xiev->event_x >= priv->thumb_all.x + priv->overlay.x &&
56- xiev->event_x <= priv->thumb_all.x + priv->overlay.x + priv->overlay.width))
57+ if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y <= PROXIMITY_WIDTH &&
58+ priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y >= 0) &&
59+ (xiev->event_x >= priv->overlay_all.x + priv->overlay.x &&
60+ xiev->event_x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width))
61 {
62 priv->can_hide = FALSE;
63
64@@ -1867,10 +1867,10 @@
65 /* proximity area */
66 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
67 {
68- if ((priv->thumb_all.x - xev->xbutton.x <= PROXIMITY_WIDTH &&
69- priv->thumb_all.x - xev->xbutton.x >= 0) &&
70- (xev->xbutton.y >= priv->thumb_all.y + priv->overlay.y &&
71- xev->xbutton.y <= priv->thumb_all.y + priv->overlay.y + priv->overlay.height))
72+ if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xbutton.x <= PROXIMITY_WIDTH &&
73+ priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xbutton.x >= 0) &&
74+ (xev->xbutton.y >= priv->overlay_all.y + priv->overlay.y &&
75+ xev->xbutton.y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height))
76 {
77 priv->can_hide = FALSE;
78
79@@ -1900,10 +1900,10 @@
80 }
81 else
82 {
83- if ((priv->thumb_all.y - xev->xbutton.y <= PROXIMITY_WIDTH &&
84- priv->thumb_all.y - xev->xbutton.y >= 0) &&
85- (xev->xbutton.x >= priv->thumb_all.x + priv->overlay.x &&
86- xev->xbutton.x <= priv->thumb_all.x + priv->overlay.x + priv->overlay.width))
87+ if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xbutton.y <= PROXIMITY_WIDTH &&
88+ priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xbutton.y >= 0) &&
89+ (xev->xbutton.x >= priv->overlay_all.x + priv->overlay.x &&
90+ xev->xbutton.x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width))
91 {
92 priv->can_hide = FALSE;
93
94@@ -1991,10 +1991,10 @@
95 /* proximity area */
96 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
97 {
98- if ((priv->thumb_all.x - xev->xmotion.x <= PROXIMITY_WIDTH &&
99- priv->thumb_all.x - xev->xmotion.x >= 0) &&
100- (xev->xmotion.y >= priv->thumb_all.y + priv->overlay.y &&
101- xev->xmotion.y <= priv->thumb_all.y + priv->overlay.y + priv->overlay.height))
102+ if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xmotion.x <= PROXIMITY_WIDTH &&
103+ priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xmotion.x >= 0) &&
104+ (xev->xmotion.y >= priv->overlay_all.y + priv->overlay.y &&
105+ xev->xmotion.y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height))
106 {
107 priv->can_hide = FALSE;
108
109@@ -2032,10 +2032,10 @@
110 }
111 else
112 {
113- if ((priv->thumb_all.y - xev->xmotion.y <= PROXIMITY_WIDTH &&
114- priv->thumb_all.y - xev->xmotion.y >= 0) &&
115- (xev->xmotion.x >= priv->thumb_all.x + priv->overlay.x &&
116- xev->xmotion.x <= priv->thumb_all.x + priv->overlay.x + priv->overlay.width))
117+ if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xmotion.y <= PROXIMITY_WIDTH &&
118+ priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xmotion.y >= 0) &&
119+ (xev->xmotion.x >= priv->overlay_all.x + priv->overlay.x &&
120+ xev->xmotion.x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width))
121 {
122 priv->can_hide = FALSE;
123

Subscribers

People subscribed via source and target branches