Merge lp:~cimi/overlay-scrollbar/proximity-separate-function into lp:overlay-scrollbar
- proximity-separate-function
- Merge into trunk
Proposed by
Andrea Cimitan
Status: | Superseded |
---|---|
Proposed branch: | lp:~cimi/overlay-scrollbar/proximity-separate-function |
Merge into: | lp:overlay-scrollbar |
Diff against target: |
969 lines (+176/-208) 4 files modified
os/os-pager.c (+1/-1) os/os-private.h (+4/-4) os/os-scrollbar.c (+169/-195) os/os-thumb.c (+2/-8) |
To merge this branch: | bzr merge lp:~cimi/overlay-scrollbar/proximity-separate-function |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ayatana Scrollbar Team | Pending | ||
Review via email: mp+64684@code.launchpad.net |
This proposal has been superseded by a proposal from 2011-06-15.
Commit message
Description of the change
fork of lp:~cimi/ayatana-scrollbar/various-namings-and-refactoring, this branch contains a separate proximity function that can be easily extended to support scrollbars on other sides of the scrolled window
To post a comment you must log in.
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'os/os-pager.c' | |||
2 | --- os/os-pager.c 2011-06-12 23:21:09 +0000 | |||
3 | +++ os/os-pager.c 2011-06-15 13:28:34 +0000 | |||
4 | @@ -315,7 +315,7 @@ | |||
5 | 315 | * | 315 | * |
6 | 316 | * Returns: the new #OsPager instance. | 316 | * Returns: the new #OsPager instance. |
7 | 317 | */ | 317 | */ |
9 | 318 | GObject* | 318 | OsPager* |
10 | 319 | os_pager_new (void) | 319 | os_pager_new (void) |
11 | 320 | { | 320 | { |
12 | 321 | return g_object_new (OS_TYPE_PAGER, NULL); | 321 | return g_object_new (OS_TYPE_PAGER, NULL); |
13 | 322 | 322 | ||
14 | === modified file 'os/os-private.h' | |||
15 | --- os/os-private.h 2011-06-10 10:32:53 +0000 | |||
16 | +++ os/os-private.h 2011-06-15 13:28:34 +0000 | |||
17 | @@ -30,9 +30,9 @@ | |||
18 | 30 | #pragma GCC visibility push(hidden) | 30 | #pragma GCC visibility push(hidden) |
19 | 31 | #endif /* __GNUC__ */ | 31 | #endif /* __GNUC__ */ |
20 | 32 | 32 | ||
24 | 33 | /* Default size of the thumb in pixels. */ | 33 | /* Size of the thumb in pixels. */ |
25 | 34 | #define DEFAULT_THUMB_WIDTH 17 | 34 | #define THUMB_WIDTH 17 |
26 | 35 | #define DEFAULT_THUMB_HEIGHT 69 | 35 | #define THUMB_HEIGHT 69 |
27 | 36 | 36 | ||
28 | 37 | G_BEGIN_DECLS | 37 | G_BEGIN_DECLS |
29 | 38 | 38 | ||
30 | @@ -208,7 +208,7 @@ | |||
31 | 208 | 208 | ||
32 | 209 | GType os_pager_get_type (void) G_GNUC_CONST; | 209 | GType os_pager_get_type (void) G_GNUC_CONST; |
33 | 210 | 210 | ||
35 | 211 | GObject* os_pager_new (void); | 211 | OsPager* os_pager_new (void); |
36 | 212 | 212 | ||
37 | 213 | void os_pager_hide (OsPager *overlay); | 213 | void os_pager_hide (OsPager *overlay); |
38 | 214 | 214 | ||
39 | 215 | 215 | ||
40 | === modified file 'os/os-scrollbar.c' | |||
41 | --- os/os-scrollbar.c 2011-06-14 17:20:10 +0000 | |||
42 | +++ os/os-scrollbar.c 2011-06-15 13:28:34 +0000 | |||
43 | @@ -32,14 +32,14 @@ | |||
44 | 32 | #include <X11/extensions/XInput2.h> | 32 | #include <X11/extensions/XInput2.h> |
45 | 33 | #include "math.h" | 33 | #include "math.h" |
46 | 34 | 34 | ||
49 | 35 | /* Default size of the pager in pixels. */ | 35 | /* Size of the pager in pixels. */ |
50 | 36 | #define DEFAULT_PAGER_WIDTH 3 | 36 | #define PAGER_SIZE 3 |
51 | 37 | 37 | ||
53 | 38 | /* Default thumb allocation shift in pixels. */ | 38 | /* Thumb allocation shift in pixels. */ |
54 | 39 | #define THUMB_ALLOCATION_SHIFT -3 | 39 | #define THUMB_ALLOCATION_SHIFT -3 |
55 | 40 | 40 | ||
58 | 41 | /* Width of the proximity effect in pixels. */ | 41 | /* Size of the proximity effect in pixels. */ |
59 | 42 | #define PROXIMITY_WIDTH 30 | 42 | #define PROXIMITY_SIZE 30 |
60 | 43 | 43 | ||
61 | 44 | /* Timeout assumed for PropertyNotify _NET_ACTIVE_WINDOW event. */ | 44 | /* Timeout assumed for PropertyNotify _NET_ACTIVE_WINDOW event. */ |
62 | 45 | #define TIMEOUT_PRESENT_WINDOW 400 | 45 | #define TIMEOUT_PRESENT_WINDOW 400 |
63 | @@ -50,18 +50,26 @@ | |||
64 | 50 | /* Timeout before hiding in ms, after leaving the toplevel. */ | 50 | /* Timeout before hiding in ms, after leaving the toplevel. */ |
65 | 51 | #define TIMEOUT_TOPLEVEL_HIDE 200 | 51 | #define TIMEOUT_TOPLEVEL_HIDE 200 |
66 | 52 | 52 | ||
67 | 53 | typedef enum | ||
68 | 54 | { | ||
69 | 55 | OS_SIDE_TOP, | ||
70 | 56 | OS_SIDE_BOTTOM, | ||
71 | 57 | OS_SIDE_LEFT, | ||
72 | 58 | OS_SIDE_RIGHT | ||
73 | 59 | } OsSide; | ||
74 | 60 | |||
75 | 53 | struct _OsScrollbarPrivate | 61 | struct _OsScrollbarPrivate |
76 | 54 | { | 62 | { |
77 | 55 | GdkRectangle trough; | 63 | GdkRectangle trough; |
78 | 56 | GdkRectangle overlay; | 64 | GdkRectangle overlay; |
79 | 57 | GdkRectangle slider; | 65 | GdkRectangle slider; |
81 | 58 | GtkAllocation overlay_all; | 66 | GtkAllocation pager_all; |
82 | 59 | GtkAllocation thumb_all; | 67 | GtkAllocation thumb_all; |
83 | 60 | GObject *pager; | ||
84 | 61 | GtkWidget *thumb; | 68 | GtkWidget *thumb; |
85 | 62 | GtkAdjustment *adjustment; | 69 | GtkAdjustment *adjustment; |
86 | 63 | GtkOrientation orientation; | 70 | GtkOrientation orientation; |
87 | 64 | GtkWindowGroup *window_group; | 71 | GtkWindowGroup *window_group; |
88 | 72 | OsPager *pager; | ||
89 | 65 | gboolean button_press_event; | 73 | gboolean button_press_event; |
90 | 66 | gboolean enter_notify_event; | 74 | gboolean enter_notify_event; |
91 | 67 | gboolean motion_notify_event; | 75 | gboolean motion_notify_event; |
92 | @@ -137,74 +145,56 @@ | |||
93 | 137 | 145 | ||
94 | 138 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 146 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
95 | 139 | { | 147 | { |
104 | 140 | gint y, bottom, top, height; | 148 | gint y, trough_length, height; |
105 | 141 | 149 | ||
106 | 142 | top = priv->trough.y; | 150 | trough_length = priv->trough.height; |
99 | 143 | bottom = priv->trough.y + priv->trough.height; | ||
100 | 144 | |||
101 | 145 | /* overlay height is the fraction (page_size / | ||
102 | 146 | * total_adjustment_range) times the trough height in pixels | ||
103 | 147 | */ | ||
107 | 148 | 151 | ||
108 | 149 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) | 152 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) |
112 | 150 | height = ((bottom - top) * (gtk_adjustment_get_page_size (priv->adjustment) / | 153 | height = (trough_length * (gtk_adjustment_get_page_size (priv->adjustment) / |
113 | 151 | (gtk_adjustment_get_upper (priv->adjustment) - | 154 | (gtk_adjustment_get_upper (priv->adjustment) - |
114 | 152 | gtk_adjustment_get_lower (priv->adjustment)))); | 155 | gtk_adjustment_get_lower (priv->adjustment)))); |
115 | 153 | else | 156 | else |
116 | 154 | height = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); | 157 | height = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); |
117 | 155 | 158 | ||
118 | 156 | height = MAX (height, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); | 159 | height = MAX (height, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); |
119 | 157 | 160 | ||
120 | 158 | height = MIN (height, priv->trough.height); | ||
121 | 159 | |||
122 | 160 | y = top; | ||
123 | 161 | |||
124 | 162 | if (gtk_adjustment_get_upper (priv->adjustment) - | 161 | if (gtk_adjustment_get_upper (priv->adjustment) - |
125 | 163 | gtk_adjustment_get_lower (priv->adjustment) - | 162 | gtk_adjustment_get_lower (priv->adjustment) - |
126 | 164 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 163 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
128 | 165 | y += (bottom - top - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 164 | y = (trough_length - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
129 | 166 | (gtk_adjustment_get_upper (priv->adjustment) - | 165 | (gtk_adjustment_get_upper (priv->adjustment) - |
130 | 167 | gtk_adjustment_get_lower (priv->adjustment) - | 166 | gtk_adjustment_get_lower (priv->adjustment) - |
131 | 168 | gtk_adjustment_get_page_size (priv->adjustment))); | 167 | gtk_adjustment_get_page_size (priv->adjustment))); |
132 | 169 | 168 | ||
134 | 170 | y = CLAMP (y, top, bottom); | 169 | y = CLAMP (y, 0, trough_length); |
135 | 171 | 170 | ||
136 | 172 | priv->overlay.y = y; | 171 | priv->overlay.y = y; |
137 | 173 | priv->overlay.height = height; | 172 | priv->overlay.height = height; |
138 | 174 | } | 173 | } |
139 | 175 | else | 174 | else |
140 | 176 | { | 175 | { |
149 | 177 | gint x, left, right, width; | 176 | gint x, trough_length, width; |
150 | 178 | 177 | ||
151 | 179 | left = priv->trough.x; | 178 | trough_length = priv->trough.width; |
144 | 180 | right = priv->trough.x + priv->trough.width; | ||
145 | 181 | |||
146 | 182 | /* overlay width is the fraction (page_size / | ||
147 | 183 | * total_adjustment_range) times the trough width in pixels | ||
148 | 184 | */ | ||
152 | 185 | 179 | ||
153 | 186 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) | 180 | if (gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_lower (priv->adjustment) != 0) |
157 | 187 | width = ((right - left) * (gtk_adjustment_get_page_size (priv->adjustment) / | 181 | width = (trough_length * (gtk_adjustment_get_page_size (priv->adjustment) / |
158 | 188 | (gtk_adjustment_get_upper (priv->adjustment) - | 182 | (gtk_adjustment_get_upper (priv->adjustment) - |
159 | 189 | gtk_adjustment_get_lower (priv->adjustment)))); | 183 | gtk_adjustment_get_lower (priv->adjustment)))); |
160 | 190 | else | 184 | else |
161 | 191 | width = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); | 185 | width = gtk_range_get_min_slider_size (GTK_RANGE (scrollbar)); |
162 | 192 | 186 | ||
163 | 193 | width = MAX (width, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); | 187 | width = MAX (width, gtk_range_get_min_slider_size (GTK_RANGE (scrollbar))); |
164 | 194 | 188 | ||
165 | 195 | width = MIN (width, priv->trough.width); | ||
166 | 196 | |||
167 | 197 | x = left; | ||
168 | 198 | |||
169 | 199 | if (gtk_adjustment_get_upper (priv->adjustment) - | 189 | if (gtk_adjustment_get_upper (priv->adjustment) - |
170 | 200 | gtk_adjustment_get_lower (priv->adjustment) - | 190 | gtk_adjustment_get_lower (priv->adjustment) - |
171 | 201 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 191 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
173 | 202 | x += (right - left - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 192 | x = (trough_length - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
174 | 203 | (gtk_adjustment_get_upper (priv->adjustment) - | 193 | (gtk_adjustment_get_upper (priv->adjustment) - |
175 | 204 | gtk_adjustment_get_lower (priv->adjustment) - | 194 | gtk_adjustment_get_lower (priv->adjustment) - |
176 | 205 | gtk_adjustment_get_page_size (priv->adjustment))); | 195 | gtk_adjustment_get_page_size (priv->adjustment))); |
177 | 206 | 196 | ||
179 | 207 | x = CLAMP (x, left, right); | 197 | x = CLAMP (x, 0, trough_length); |
180 | 208 | 198 | ||
181 | 209 | priv->overlay.x = x; | 199 | priv->overlay.x = x; |
182 | 210 | priv->overlay.width = width; | 200 | priv->overlay.width = width; |
183 | @@ -222,52 +212,40 @@ | |||
184 | 222 | 212 | ||
185 | 223 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 213 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
186 | 224 | { | 214 | { |
192 | 225 | gint y, bottom, top, height; | 215 | gint y, trough_length, height; |
193 | 226 | 216 | ||
194 | 227 | top = priv->trough.y; | 217 | trough_length = priv->trough.height; |
190 | 228 | bottom = priv->trough.y + priv->trough.height; | ||
191 | 229 | |||
195 | 230 | height = priv->slider.height; | 218 | height = priv->slider.height; |
196 | 231 | 219 | ||
197 | 232 | height = MIN (height, priv->trough.height); | ||
198 | 233 | |||
199 | 234 | y = top; | ||
200 | 235 | |||
201 | 236 | if (gtk_adjustment_get_upper (priv->adjustment) - | 220 | if (gtk_adjustment_get_upper (priv->adjustment) - |
202 | 237 | gtk_adjustment_get_lower (priv->adjustment) - | 221 | gtk_adjustment_get_lower (priv->adjustment) - |
203 | 238 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 222 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
205 | 239 | y += (bottom - top - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 223 | y = (trough_length - height) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
206 | 240 | (gtk_adjustment_get_upper (priv->adjustment) - | 224 | (gtk_adjustment_get_upper (priv->adjustment) - |
207 | 241 | gtk_adjustment_get_lower (priv->adjustment) - | 225 | gtk_adjustment_get_lower (priv->adjustment) - |
208 | 242 | gtk_adjustment_get_page_size (priv->adjustment))); | 226 | gtk_adjustment_get_page_size (priv->adjustment))); |
209 | 243 | 227 | ||
211 | 244 | y = CLAMP (y, top, bottom); | 228 | y = CLAMP (y, 0, trough_length); |
212 | 245 | 229 | ||
213 | 246 | priv->slider.y = y; | 230 | priv->slider.y = y; |
214 | 247 | priv->slider.height = height; | 231 | priv->slider.height = height; |
215 | 248 | } | 232 | } |
216 | 249 | else | 233 | else |
217 | 250 | { | 234 | { |
223 | 251 | gint x, left, right, width; | 235 | gint x, trough_length, width; |
224 | 252 | 236 | ||
225 | 253 | left = priv->trough.x; | 237 | trough_length = priv->trough.width; |
221 | 254 | right = priv->trough.x + priv->trough.width; | ||
222 | 255 | |||
226 | 256 | width = priv->slider.width; | 238 | width = priv->slider.width; |
227 | 257 | 239 | ||
228 | 258 | width = MIN (width, priv->trough.width); | ||
229 | 259 | |||
230 | 260 | x = left; | ||
231 | 261 | |||
232 | 262 | if (gtk_adjustment_get_upper (priv->adjustment) - | 240 | if (gtk_adjustment_get_upper (priv->adjustment) - |
233 | 263 | gtk_adjustment_get_lower (priv->adjustment) - | 241 | gtk_adjustment_get_lower (priv->adjustment) - |
234 | 264 | gtk_adjustment_get_page_size (priv->adjustment) != 0) | 242 | gtk_adjustment_get_page_size (priv->adjustment) != 0) |
236 | 265 | x += (right - left - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / | 243 | x = (trough_length - width) * ((adjustment_value - gtk_adjustment_get_lower (priv->adjustment)) / |
237 | 266 | (gtk_adjustment_get_upper (priv->adjustment) - | 244 | (gtk_adjustment_get_upper (priv->adjustment) - |
238 | 267 | gtk_adjustment_get_lower (priv->adjustment) - | 245 | gtk_adjustment_get_lower (priv->adjustment) - |
239 | 268 | gtk_adjustment_get_page_size (priv->adjustment))); | 246 | gtk_adjustment_get_page_size (priv->adjustment))); |
240 | 269 | 247 | ||
242 | 270 | x = CLAMP (x, left, right); | 248 | x = CLAMP (x, 0, trough_length); |
243 | 271 | 249 | ||
244 | 272 | priv->slider.x = x; | 250 | priv->slider.x = x; |
245 | 273 | priv->slider.width = width; | 251 | priv->slider.width = width; |
246 | @@ -333,7 +311,7 @@ | |||
247 | 333 | priv = scrollbar->priv; | 311 | priv = scrollbar->priv; |
248 | 334 | 312 | ||
249 | 335 | if (priv->pager != NULL && priv->can_deactivate_pager) | 313 | if (priv->pager != NULL && priv->can_deactivate_pager) |
251 | 336 | os_pager_set_active (OS_PAGER (priv->pager), FALSE, TRUE); | 314 | os_pager_set_active (priv->pager, FALSE, TRUE); |
252 | 337 | } | 315 | } |
253 | 338 | 316 | ||
254 | 339 | /* timeout before deactivating the pager */ | 317 | /* timeout before deactivating the pager */ |
255 | @@ -365,7 +343,7 @@ | |||
256 | 365 | if (priv->can_hide) | 343 | if (priv->can_hide) |
257 | 366 | { | 344 | { |
258 | 367 | priv->value_changed_event = FALSE; | 345 | priv->value_changed_event = FALSE; |
260 | 368 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 346 | gtk_widget_hide (priv->thumb); |
261 | 369 | } | 347 | } |
262 | 370 | } | 348 | } |
263 | 371 | 349 | ||
264 | @@ -398,7 +376,7 @@ | |||
265 | 398 | { | 376 | { |
266 | 399 | mask.x = 0; | 377 | mask.x = 0; |
267 | 400 | mask.y = priv->overlay.y; | 378 | mask.y = priv->overlay.y; |
269 | 401 | mask.width = DEFAULT_PAGER_WIDTH; | 379 | mask.width = priv->pager_all.width; |
270 | 402 | mask.height = priv->overlay.height; | 380 | mask.height = priv->overlay.height; |
271 | 403 | } | 381 | } |
272 | 404 | else | 382 | else |
273 | @@ -406,10 +384,10 @@ | |||
274 | 406 | mask.x = priv->overlay.x; | 384 | mask.x = priv->overlay.x; |
275 | 407 | mask.y = 0; | 385 | mask.y = 0; |
276 | 408 | mask.width = priv->overlay.width; | 386 | mask.width = priv->overlay.width; |
278 | 409 | mask.height = DEFAULT_PAGER_WIDTH; | 387 | mask.height = priv->pager_all.height; |
279 | 410 | } | 388 | } |
280 | 411 | 389 | ||
282 | 412 | os_pager_move_resize (OS_PAGER (priv->pager), mask); | 390 | os_pager_move_resize (priv->pager, mask); |
283 | 413 | } | 391 | } |
284 | 414 | 392 | ||
285 | 415 | /* sanitize x coordinate of thumb window */ | 393 | /* sanitize x coordinate of thumb window */ |
286 | @@ -463,7 +441,7 @@ | |||
287 | 463 | 441 | ||
288 | 464 | if (priv->orientation == GTK_ORIENTATION_VERTICAL && | 442 | if (priv->orientation == GTK_ORIENTATION_VERTICAL && |
289 | 465 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x - 1 + priv->slider.width, y) || | 443 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x - 1 + priv->slider.width, y) || |
291 | 466 | (x - 1 + priv->slider.width) >= screen_width)) | 444 | x - 1 + priv->slider.width >= screen_width)) |
292 | 467 | { | 445 | { |
293 | 468 | priv->internal = TRUE; | 446 | priv->internal = TRUE; |
294 | 469 | return MAX (x - priv->slider.width, screen_width - priv->slider.width); | 447 | return MAX (x - priv->slider.width, screen_width - priv->slider.width); |
295 | @@ -526,7 +504,7 @@ | |||
296 | 526 | 504 | ||
297 | 527 | if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && | 505 | if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && |
298 | 528 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x, y - 1 + priv->slider.height) || | 506 | (n_monitor != gdk_screen_get_monitor_at_point (screen, x, y - 1 + priv->slider.height) || |
300 | 529 | (y - 1 + priv->slider.height) >= screen_height)) | 507 | y - 1 + priv->slider.height >= screen_height)) |
301 | 530 | { | 508 | { |
302 | 531 | priv->internal = TRUE; | 509 | priv->internal = TRUE; |
303 | 532 | return MAX (y - priv->slider.height, screen_height - priv->slider.height); | 510 | return MAX (y - priv->slider.height, screen_height - priv->slider.height); |
304 | @@ -707,19 +685,19 @@ | |||
305 | 707 | * hidden a pager that is meant to be hidden/shown. | 685 | * hidden a pager that is meant to be hidden/shown. |
306 | 708 | * I don't want to see pagers reappearing because | 686 | * I don't want to see pagers reappearing because |
307 | 709 | * of a change in the adjustment of an invisible pager or viceversa. */ | 687 | * of a change in the adjustment of an invisible pager or viceversa. */ |
309 | 710 | if ((gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) > | 688 | if (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment) > |
310 | 711 | gtk_adjustment_get_page_size (adjustment)) | 689 | gtk_adjustment_get_page_size (adjustment)) |
311 | 712 | { | 690 | { |
312 | 713 | priv->fullsize = FALSE; | 691 | priv->fullsize = FALSE; |
313 | 714 | if (priv->proximity != FALSE) | 692 | if (priv->proximity != FALSE) |
315 | 715 | os_pager_show (OS_PAGER (priv->pager)); | 693 | os_pager_show (priv->pager); |
316 | 716 | } | 694 | } |
317 | 717 | else | 695 | else |
318 | 718 | { | 696 | { |
319 | 719 | priv->fullsize = TRUE; | 697 | priv->fullsize = TRUE; |
320 | 720 | if (priv->proximity != FALSE) | 698 | if (priv->proximity != FALSE) |
321 | 721 | { | 699 | { |
323 | 722 | os_pager_hide (OS_PAGER (priv->pager)); | 700 | os_pager_hide (priv->pager); |
324 | 723 | 701 | ||
325 | 724 | gtk_widget_hide (priv->thumb); | 702 | gtk_widget_hide (priv->thumb); |
326 | 725 | } | 703 | } |
327 | @@ -729,7 +707,7 @@ | |||
328 | 729 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); | 707 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); |
329 | 730 | 708 | ||
330 | 731 | if (!priv->motion_notify_event && !priv->enter_notify_event) | 709 | if (!priv->motion_notify_event && !priv->enter_notify_event) |
332 | 732 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 710 | gtk_widget_hide (priv->thumb); |
333 | 733 | 711 | ||
334 | 734 | move_pager (scrollbar); | 712 | move_pager (scrollbar); |
335 | 735 | } | 713 | } |
336 | @@ -748,20 +726,20 @@ | |||
337 | 748 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); | 726 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (adjustment)); |
338 | 749 | 727 | ||
339 | 750 | if (!priv->motion_notify_event && !priv->enter_notify_event) | 728 | if (!priv->motion_notify_event && !priv->enter_notify_event) |
341 | 751 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 729 | gtk_widget_hide (priv->thumb); |
342 | 752 | 730 | ||
344 | 753 | if (gtk_widget_get_mapped (GTK_WIDGET (priv->thumb))) | 731 | if (gtk_widget_get_mapped (priv->thumb)) |
345 | 754 | { | 732 | { |
346 | 755 | /* if we're dragging the thumb, it can't be detached. */ | 733 | /* if we're dragging the thumb, it can't be detached. */ |
347 | 756 | if (priv->motion_notify_event) | 734 | if (priv->motion_notify_event) |
348 | 757 | { | 735 | { |
350 | 758 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 736 | os_pager_set_detached (priv->pager, FALSE); |
351 | 759 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 737 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
352 | 760 | } | 738 | } |
353 | 761 | else | 739 | else |
354 | 762 | { | 740 | { |
355 | 763 | gint x_pos, y_pos; | 741 | gint x_pos, y_pos; |
357 | 764 | gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (priv->thumb)), &x_pos, &y_pos); | 742 | gdk_window_get_origin (gtk_widget_get_window (priv->thumb), &x_pos, &y_pos); |
358 | 765 | 743 | ||
359 | 766 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 744 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
360 | 767 | { | 745 | { |
361 | @@ -771,11 +749,11 @@ | |||
362 | 771 | 749 | ||
363 | 772 | mask.x = 0; | 750 | mask.x = 0; |
364 | 773 | mask.y = y_pos + priv->slider.height / 2 - priv->win_y; | 751 | mask.y = y_pos + priv->slider.height / 2 - priv->win_y; |
366 | 774 | mask.width = DEFAULT_PAGER_WIDTH; | 752 | mask.width = priv->pager_all.width; |
367 | 775 | mask.height = priv->overlay.y - mask.y; | 753 | mask.height = priv->overlay.y - mask.y; |
368 | 776 | 754 | ||
371 | 777 | os_pager_connect (OS_PAGER (priv->pager), mask); | 755 | os_pager_connect (priv->pager, mask); |
372 | 778 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 756 | os_pager_set_detached (priv->pager, TRUE); |
373 | 779 | 757 | ||
374 | 780 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); | 758 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); |
375 | 781 | } | 759 | } |
376 | @@ -785,17 +763,17 @@ | |||
377 | 785 | 763 | ||
378 | 786 | mask.x = 0; | 764 | mask.x = 0; |
379 | 787 | mask.y = priv->overlay.y + priv->overlay.height; | 765 | mask.y = priv->overlay.y + priv->overlay.height; |
381 | 788 | mask.width = DEFAULT_PAGER_WIDTH; | 766 | mask.width = priv->pager_all.width; |
382 | 789 | mask.height = y_pos + priv->slider.height / 2 - priv->win_y - mask.y; | 767 | mask.height = y_pos + priv->slider.height / 2 - priv->win_y - mask.y; |
383 | 790 | 768 | ||
386 | 791 | os_pager_connect (OS_PAGER (priv->pager), mask); | 769 | os_pager_connect (priv->pager, mask); |
387 | 792 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 770 | os_pager_set_detached (priv->pager, TRUE); |
388 | 793 | 771 | ||
389 | 794 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); | 772 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); |
390 | 795 | } | 773 | } |
391 | 796 | else | 774 | else |
392 | 797 | { | 775 | { |
394 | 798 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 776 | os_pager_set_detached (priv->pager, FALSE); |
395 | 799 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 777 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
396 | 800 | } | 778 | } |
397 | 801 | } | 779 | } |
398 | @@ -808,10 +786,10 @@ | |||
399 | 808 | mask.x = x_pos + priv->slider.width / 2 - priv->win_x; | 786 | mask.x = x_pos + priv->slider.width / 2 - priv->win_x; |
400 | 809 | mask.y = 0; | 787 | mask.y = 0; |
401 | 810 | mask.width = priv->overlay.x - mask.x; | 788 | mask.width = priv->overlay.x - mask.x; |
403 | 811 | mask.height = DEFAULT_PAGER_WIDTH; | 789 | mask.height = priv->pager_all.height; |
404 | 812 | 790 | ||
407 | 813 | os_pager_connect (OS_PAGER (priv->pager), mask); | 791 | os_pager_connect (priv->pager, mask); |
408 | 814 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 792 | os_pager_set_detached (priv->pager, TRUE); |
409 | 815 | 793 | ||
410 | 816 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); | 794 | os_thumb_set_detached (OS_THUMB (priv->thumb), TRUE); |
411 | 817 | } | 795 | } |
412 | @@ -822,14 +800,14 @@ | |||
413 | 822 | mask.x = priv->overlay.y + priv->overlay.height; | 800 | mask.x = priv->overlay.y + priv->overlay.height; |
414 | 823 | mask.y = 0; | 801 | mask.y = 0; |
415 | 824 | mask.width = x_pos + priv->slider.width / 2 - priv->win_x - mask.x; | 802 | mask.width = x_pos + priv->slider.width / 2 - priv->win_x - mask.x; |
417 | 825 | mask.height = DEFAULT_PAGER_WIDTH; | 803 | mask.height = priv->pager_all.height; |
418 | 826 | 804 | ||
421 | 827 | os_pager_connect (OS_PAGER (priv->pager), mask); | 805 | os_pager_connect (priv->pager, mask); |
422 | 828 | os_pager_set_detached (OS_PAGER (priv->pager), TRUE); | 806 | os_pager_set_detached (priv->pager, TRUE); |
423 | 829 | } | 807 | } |
424 | 830 | else | 808 | else |
425 | 831 | { | 809 | { |
427 | 832 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 810 | os_pager_set_detached (priv->pager, FALSE); |
428 | 833 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 811 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
429 | 834 | } | 812 | } |
430 | 835 | } | 813 | } |
431 | @@ -860,12 +838,12 @@ | |||
432 | 860 | (y > allocation.y && y < allocation.y + allocation.height)) | 838 | (y > allocation.y && y < allocation.y + allocation.height)) |
433 | 861 | { | 839 | { |
434 | 862 | priv->can_deactivate_pager = FALSE; | 840 | priv->can_deactivate_pager = FALSE; |
436 | 863 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, TRUE); | 841 | os_pager_set_active (priv->pager, TRUE, TRUE); |
437 | 864 | } | 842 | } |
438 | 865 | else | 843 | else |
439 | 866 | { | 844 | { |
440 | 867 | priv->can_deactivate_pager = TRUE; | 845 | priv->can_deactivate_pager = TRUE; |
442 | 868 | os_pager_set_active (OS_PAGER (priv->pager), FALSE, TRUE); | 846 | os_pager_set_active (priv->pager, FALSE, TRUE); |
443 | 869 | } | 847 | } |
444 | 870 | } | 848 | } |
445 | 871 | 849 | ||
446 | @@ -899,7 +877,7 @@ | |||
447 | 899 | priv->active_window = TRUE; | 877 | priv->active_window = TRUE; |
448 | 900 | 878 | ||
449 | 901 | priv->can_deactivate_pager = FALSE; | 879 | priv->can_deactivate_pager = FALSE; |
451 | 902 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, TRUE); | 880 | os_pager_set_active (priv->pager, TRUE, TRUE); |
452 | 903 | } | 881 | } |
453 | 904 | else if (priv->active_window) | 882 | else if (priv->active_window) |
454 | 905 | { | 883 | { |
455 | @@ -938,7 +916,7 @@ | |||
456 | 938 | { | 916 | { |
457 | 939 | /* if the pointer is outside of the window, set it inactive. */ | 917 | /* if the pointer is outside of the window, set it inactive. */ |
458 | 940 | priv->can_deactivate_pager = TRUE; | 918 | priv->can_deactivate_pager = TRUE; |
460 | 941 | os_pager_set_active (OS_PAGER (priv->pager), FALSE, TRUE); | 919 | os_pager_set_active (priv->pager, FALSE, TRUE); |
461 | 942 | } | 920 | } |
462 | 943 | 921 | ||
463 | 944 | if ((current_time > end_time) && priv->thumb != NULL) | 922 | if ((current_time > end_time) && priv->thumb != NULL) |
464 | @@ -1196,7 +1174,7 @@ | |||
465 | 1196 | 1174 | ||
466 | 1197 | /* immediately set the pager to be active. */ | 1175 | /* immediately set the pager to be active. */ |
467 | 1198 | priv->can_deactivate_pager = FALSE; | 1176 | priv->can_deactivate_pager = FALSE; |
469 | 1199 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, FALSE); | 1177 | os_pager_set_active (priv->pager, TRUE, FALSE); |
470 | 1200 | 1178 | ||
471 | 1201 | xid = GDK_WINDOW_XID (gtk_widget_get_window (widget)); | 1179 | xid = GDK_WINDOW_XID (gtk_widget_get_window (widget)); |
472 | 1202 | xid_parent = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (scrollbar))); | 1180 | xid_parent = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (scrollbar))); |
473 | @@ -1267,7 +1245,6 @@ | |||
474 | 1267 | gdouble frac; | 1245 | gdouble frac; |
475 | 1268 | gdouble value; | 1246 | gdouble value; |
476 | 1269 | gint trough_length; | 1247 | gint trough_length; |
477 | 1270 | gint trough_start; | ||
478 | 1271 | gint slider_length; | 1248 | gint slider_length; |
479 | 1272 | 1249 | ||
480 | 1273 | priv = scrollbar->priv; | 1250 | priv = scrollbar->priv; |
481 | @@ -1275,21 +1252,18 @@ | |||
482 | 1275 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1252 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
483 | 1276 | { | 1253 | { |
484 | 1277 | trough_length = priv->trough.height; | 1254 | trough_length = priv->trough.height; |
485 | 1278 | trough_start = priv->trough.y; | ||
486 | 1279 | slider_length = MAX (priv->slider.height, priv->overlay.height); | 1255 | slider_length = MAX (priv->slider.height, priv->overlay.height); |
487 | 1280 | } | 1256 | } |
488 | 1281 | else | 1257 | else |
489 | 1282 | { | 1258 | { |
490 | 1283 | trough_length = priv->trough.width; | 1259 | trough_length = priv->trough.width; |
491 | 1284 | trough_start = priv->trough.y; | ||
492 | 1285 | slider_length = MAX (priv->slider.width, priv->overlay.width); | 1260 | slider_length = MAX (priv->slider.width, priv->overlay.width); |
493 | 1286 | } | 1261 | } |
494 | 1287 | 1262 | ||
495 | 1288 | if (trough_length == slider_length) | 1263 | if (trough_length == slider_length) |
496 | 1289 | frac = 1.0; | 1264 | frac = 1.0; |
497 | 1290 | else | 1265 | else |
500 | 1291 | frac = (MAX (0, coord - trough_start) / | 1266 | frac = (MAX (0, coord) / (gdouble) (trough_length - slider_length)); |
499 | 1292 | (gdouble) (trough_length - slider_length)); | ||
501 | 1293 | 1267 | ||
502 | 1294 | value = gtk_adjustment_get_lower (priv->adjustment) + frac * (gtk_adjustment_get_upper (priv->adjustment) - | 1268 | value = gtk_adjustment_get_lower (priv->adjustment) + frac * (gtk_adjustment_get_upper (priv->adjustment) - |
503 | 1295 | gtk_adjustment_get_lower (priv->adjustment) - | 1269 | gtk_adjustment_get_lower (priv->adjustment) - |
504 | @@ -1357,7 +1331,7 @@ | |||
505 | 1357 | } | 1331 | } |
506 | 1358 | 1332 | ||
507 | 1359 | /* FIXME(Cimi) seems useless. */ | 1333 | /* FIXME(Cimi) seems useless. */ |
509 | 1360 | capture_movement (scrollbar, event->x_root, event->y_root); | 1334 | // capture_movement (scrollbar, event->x_root, event->y_root); |
510 | 1361 | priv->value_changed_event = FALSE; | 1335 | priv->value_changed_event = FALSE; |
511 | 1362 | } | 1336 | } |
512 | 1363 | 1337 | ||
513 | @@ -1379,9 +1353,9 @@ | |||
514 | 1379 | priv->slide_initial_slider_position = 0; | 1353 | priv->slide_initial_slider_position = 0; |
515 | 1380 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); | 1354 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); |
516 | 1381 | } | 1355 | } |
518 | 1382 | else if (priv->overlay.y + priv->overlay.height >= priv->trough.y + priv->trough.height) | 1356 | else if (priv->overlay.y + priv->overlay.height >= priv->trough.height) |
519 | 1383 | { | 1357 | { |
521 | 1384 | priv->slide_initial_slider_position = priv->trough.y + priv->trough.height - priv->overlay.height; | 1358 | priv->slide_initial_slider_position = priv->trough.height - priv->overlay.height; |
522 | 1385 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); | 1359 | priv->slide_initial_coordinate = MAX (event->y_root, priv->win_y + priv->pointer_y); |
523 | 1386 | } | 1360 | } |
524 | 1387 | } | 1361 | } |
525 | @@ -1405,9 +1379,9 @@ | |||
526 | 1405 | priv->slide_initial_slider_position = 0; | 1379 | priv->slide_initial_slider_position = 0; |
527 | 1406 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); | 1380 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); |
528 | 1407 | } | 1381 | } |
530 | 1408 | else if (priv->overlay.x + priv->overlay.width >= priv->trough.x + priv->trough.width) | 1382 | else if (priv->overlay.x + priv->overlay.width >= priv->trough.width) |
531 | 1409 | { | 1383 | { |
533 | 1410 | priv->slide_initial_slider_position = priv->trough.x + priv->trough.width - priv->overlay.width; | 1384 | priv->slide_initial_slider_position = priv->trough.width - priv->overlay.width; |
534 | 1411 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); | 1385 | priv->slide_initial_coordinate = MAX (event->x_root, priv->win_x + priv->pointer_x); |
535 | 1412 | } | 1386 | } |
536 | 1413 | } | 1387 | } |
537 | @@ -1482,7 +1456,7 @@ | |||
538 | 1482 | priv->motion_notify_event = FALSE; | 1456 | priv->motion_notify_event = FALSE; |
539 | 1483 | priv->enter_notify_event = FALSE; | 1457 | priv->enter_notify_event = FALSE; |
540 | 1484 | 1458 | ||
542 | 1485 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 1459 | os_pager_set_detached (priv->pager, FALSE); |
543 | 1486 | } | 1460 | } |
544 | 1487 | 1461 | ||
545 | 1488 | /* toplevel functions */ | 1462 | /* toplevel functions */ |
546 | @@ -1492,24 +1466,16 @@ | |||
547 | 1492 | store_toplevel_position (OsScrollbar *scrollbar) | 1466 | store_toplevel_position (OsScrollbar *scrollbar) |
548 | 1493 | { | 1467 | { |
549 | 1494 | OsScrollbarPrivate *priv; | 1468 | OsScrollbarPrivate *priv; |
551 | 1495 | gint win_x, win_y; | 1469 | gint x_pos, y_pos; |
552 | 1496 | 1470 | ||
553 | 1497 | priv = scrollbar->priv; | 1471 | priv = scrollbar->priv; |
554 | 1498 | 1472 | ||
555 | 1499 | /* In reality, I'm storing widget's window, not the toplevel. | 1473 | /* In reality, I'm storing widget's window, not the toplevel. |
556 | 1500 | * Is that the same with gdk_window_get_origin? */ | 1474 | * Is that the same with gdk_window_get_origin? */ |
558 | 1501 | gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (scrollbar)), &win_x, &win_y); | 1475 | gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (scrollbar)), &x_pos, &y_pos); |
559 | 1502 | 1476 | ||
570 | 1503 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1477 | priv->win_x = x_pos + priv->thumb_all.x; |
571 | 1504 | { | 1478 | priv->win_y = y_pos + priv->thumb_all.y; |
562 | 1505 | priv->win_x = win_x + priv->thumb_all.x; | ||
563 | 1506 | priv->win_y = win_y + priv->thumb_all.y; | ||
564 | 1507 | } | ||
565 | 1508 | else | ||
566 | 1509 | { | ||
567 | 1510 | priv->win_x = win_x + priv->thumb_all.x; | ||
568 | 1511 | priv->win_y = win_y + priv->thumb_all.y; | ||
569 | 1512 | } | ||
572 | 1513 | } | 1479 | } |
573 | 1514 | 1480 | ||
574 | 1515 | static gboolean | 1481 | static gboolean |
575 | @@ -1560,12 +1526,12 @@ | |||
576 | 1560 | else | 1526 | else |
577 | 1561 | { | 1527 | { |
578 | 1562 | priv->can_deactivate_pager = FALSE; | 1528 | priv->can_deactivate_pager = FALSE; |
580 | 1563 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, TRUE); | 1529 | os_pager_set_active (priv->pager, TRUE, TRUE); |
581 | 1564 | } | 1530 | } |
582 | 1565 | } | 1531 | } |
583 | 1566 | 1532 | ||
584 | 1567 | if (current_time > end_time) | 1533 | if (current_time > end_time) |
586 | 1568 | gtk_widget_hide (GTK_WIDGET (priv->thumb)); | 1534 | gtk_widget_hide (priv->thumb); |
587 | 1569 | 1535 | ||
588 | 1570 | priv->lock_position = FALSE; | 1536 | priv->lock_position = FALSE; |
589 | 1571 | 1537 | ||
590 | @@ -1577,6 +1543,41 @@ | |||
591 | 1577 | return FALSE; | 1543 | return FALSE; |
592 | 1578 | } | 1544 | } |
593 | 1579 | 1545 | ||
594 | 1546 | /* checks if the pointer is in the proximity area. */ | ||
595 | 1547 | static gboolean | ||
596 | 1548 | check_proximity (OsScrollbar *scrollbar, | ||
597 | 1549 | gint x, | ||
598 | 1550 | gint y, | ||
599 | 1551 | OsSide side) | ||
600 | 1552 | { | ||
601 | 1553 | OsScrollbarPrivate *priv; | ||
602 | 1554 | |||
603 | 1555 | priv = scrollbar->priv; | ||
604 | 1556 | |||
605 | 1557 | switch (side) | ||
606 | 1558 | { | ||
607 | 1559 | case OS_SIDE_RIGHT: | ||
608 | 1560 | return (x >= priv->pager_all.x + priv->pager_all.width - PROXIMITY_SIZE && | ||
609 | 1561 | x <= priv->pager_all.x + priv->pager_all.width) && | ||
610 | 1562 | (y >= priv->pager_all.y + priv->overlay.y && | ||
611 | 1563 | y <= priv->pager_all.y + priv->overlay.y + priv->overlay.height); | ||
612 | 1564 | break; | ||
613 | 1565 | case OS_SIDE_BOTTOM: | ||
614 | 1566 | return (y >= priv->pager_all.y + priv->pager_all.height - PROXIMITY_SIZE && | ||
615 | 1567 | y <= priv->pager_all.y + priv->pager_all.height) && | ||
616 | 1568 | (x >= priv->pager_all.x + priv->overlay.x && | ||
617 | 1569 | x <= priv->pager_all.x + priv->overlay.x + priv->overlay.width); | ||
618 | 1570 | break; | ||
619 | 1571 | case OS_SIDE_LEFT: | ||
620 | 1572 | case OS_SIDE_TOP: | ||
621 | 1573 | /* FIXME not implemented yet. | ||
622 | 1574 | * Add support for different scrollbar positions here. */ | ||
623 | 1575 | break; | ||
624 | 1576 | } | ||
625 | 1577 | |||
626 | 1578 | return FALSE; | ||
627 | 1579 | } | ||
628 | 1580 | |||
629 | 1580 | /* filter function applied to the toplevel window */ | 1581 | /* filter function applied to the toplevel window */ |
630 | 1581 | #ifdef USE_GTK3 | 1582 | #ifdef USE_GTK3 |
631 | 1582 | static GdkFilterReturn | 1583 | static GdkFilterReturn |
632 | @@ -1591,8 +1592,8 @@ | |||
633 | 1591 | g_return_val_if_fail (OS_SCROLLBAR (user_data), GDK_FILTER_CONTINUE); | 1592 | g_return_val_if_fail (OS_SCROLLBAR (user_data), GDK_FILTER_CONTINUE); |
634 | 1592 | 1593 | ||
635 | 1593 | scrollbar = OS_SCROLLBAR (user_data); | 1594 | scrollbar = OS_SCROLLBAR (user_data); |
636 | 1594 | |||
637 | 1595 | priv = scrollbar->priv; | 1595 | priv = scrollbar->priv; |
638 | 1596 | |||
639 | 1596 | xev = gdkxevent; | 1597 | xev = gdkxevent; |
640 | 1597 | 1598 | ||
641 | 1598 | g_return_val_if_fail (priv->pager != NULL, GDK_FILTER_CONTINUE); | 1599 | g_return_val_if_fail (priv->pager != NULL, GDK_FILTER_CONTINUE); |
642 | @@ -1619,10 +1620,7 @@ | |||
643 | 1619 | /* proximity area */ | 1620 | /* proximity area */ |
644 | 1620 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1621 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
645 | 1621 | { | 1622 | { |
650 | 1622 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x <= PROXIMITY_WIDTH && | 1623 | if (check_proximity (scrollbar, xiev->event_x, xiev->event_y, OS_SIDE_RIGHT)) |
647 | 1623 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x >= 0) && | ||
648 | 1624 | (xiev->event_y >= priv->overlay_all.y + priv->overlay.y && | ||
649 | 1625 | xiev->event_y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | ||
651 | 1626 | { | 1624 | { |
652 | 1627 | priv->can_hide = FALSE; | 1625 | priv->can_hide = FALSE; |
653 | 1628 | 1626 | ||
654 | @@ -1647,15 +1645,12 @@ | |||
655 | 1647 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1645 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
656 | 1648 | } | 1646 | } |
657 | 1649 | 1647 | ||
659 | 1650 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1648 | gtk_widget_show (priv->thumb); |
660 | 1651 | } | 1649 | } |
661 | 1652 | } | 1650 | } |
662 | 1653 | else | 1651 | else |
663 | 1654 | { | 1652 | { |
668 | 1655 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y <= PROXIMITY_WIDTH && | 1653 | if (check_proximity (scrollbar, xiev->event_x, xiev->event_y, OS_SIDE_BOTTOM)) |
665 | 1656 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y >= 0) && | ||
666 | 1657 | (xiev->event_x >= priv->overlay_all.x + priv->overlay.x && | ||
667 | 1658 | xiev->event_x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | ||
669 | 1659 | { | 1654 | { |
670 | 1660 | priv->can_hide = FALSE; | 1655 | priv->can_hide = FALSE; |
671 | 1661 | 1656 | ||
672 | @@ -1680,7 +1675,7 @@ | |||
673 | 1680 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1675 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
674 | 1681 | } | 1676 | } |
675 | 1682 | 1677 | ||
677 | 1683 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1678 | gtk_widget_show (priv->thumb); |
678 | 1684 | } | 1679 | } |
679 | 1685 | } | 1680 | } |
680 | 1686 | } | 1681 | } |
681 | @@ -1746,10 +1741,7 @@ | |||
682 | 1746 | /* proximity area */ | 1741 | /* proximity area */ |
683 | 1747 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1742 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
684 | 1748 | { | 1743 | { |
689 | 1749 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x <= PROXIMITY_WIDTH && | 1744 | if (check_proximity (scrollbar, xiev->event_x, xiev->event_y, OS_SIDE_RIGHT)) |
686 | 1750 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xiev->event_x >= 0) && | ||
687 | 1751 | (xiev->event_y >= priv->overlay_all.y + priv->overlay.y && | ||
688 | 1752 | xiev->event_y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | ||
690 | 1753 | { | 1745 | { |
691 | 1754 | priv->can_hide = FALSE; | 1746 | priv->can_hide = FALSE; |
692 | 1755 | 1747 | ||
693 | @@ -1774,9 +1766,9 @@ | |||
694 | 1774 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1766 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
695 | 1775 | } | 1767 | } |
696 | 1776 | 1768 | ||
698 | 1777 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 1769 | os_pager_set_detached (priv->pager, FALSE); |
699 | 1778 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 1770 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
701 | 1779 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1771 | gtk_widget_show (priv->thumb); |
702 | 1780 | } | 1772 | } |
703 | 1781 | else | 1773 | else |
704 | 1782 | { | 1774 | { |
705 | @@ -1787,10 +1779,7 @@ | |||
706 | 1787 | } | 1779 | } |
707 | 1788 | else | 1780 | else |
708 | 1789 | { | 1781 | { |
713 | 1790 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y <= PROXIMITY_WIDTH && | 1782 | if (check_proximity (scrollbar, xiev->event_x, xiev->event_y, OS_SIDE_BOTTOM)) |
710 | 1791 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xiev->event_y >= 0) && | ||
711 | 1792 | (xiev->event_x >= priv->overlay_all.x + priv->overlay.x && | ||
712 | 1793 | xiev->event_x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | ||
714 | 1794 | { | 1783 | { |
715 | 1795 | priv->can_hide = FALSE; | 1784 | priv->can_hide = FALSE; |
716 | 1796 | 1785 | ||
717 | @@ -1815,9 +1804,9 @@ | |||
718 | 1815 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); | 1804 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); |
719 | 1816 | } | 1805 | } |
720 | 1817 | 1806 | ||
722 | 1818 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 1807 | os_pager_set_detached (priv->pager, FALSE); |
723 | 1819 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 1808 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
725 | 1820 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1809 | gtk_widget_show (priv->thumb); |
726 | 1821 | } | 1810 | } |
727 | 1822 | else | 1811 | else |
728 | 1823 | { | 1812 | { |
729 | @@ -1845,8 +1834,8 @@ | |||
730 | 1845 | g_return_val_if_fail (OS_SCROLLBAR (user_data), GDK_FILTER_CONTINUE); | 1834 | g_return_val_if_fail (OS_SCROLLBAR (user_data), GDK_FILTER_CONTINUE); |
731 | 1846 | 1835 | ||
732 | 1847 | scrollbar = OS_SCROLLBAR (user_data); | 1836 | scrollbar = OS_SCROLLBAR (user_data); |
733 | 1848 | |||
734 | 1849 | priv = scrollbar->priv; | 1837 | priv = scrollbar->priv; |
735 | 1838 | |||
736 | 1850 | xev = gdkxevent; | 1839 | xev = gdkxevent; |
737 | 1851 | 1840 | ||
738 | 1852 | g_return_val_if_fail (priv->pager != NULL, GDK_FILTER_CONTINUE); | 1841 | g_return_val_if_fail (priv->pager != NULL, GDK_FILTER_CONTINUE); |
739 | @@ -1867,10 +1856,7 @@ | |||
740 | 1867 | /* proximity area */ | 1856 | /* proximity area */ |
741 | 1868 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1857 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
742 | 1869 | { | 1858 | { |
747 | 1870 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xbutton.x <= PROXIMITY_WIDTH && | 1859 | if (check_proximity (scrollbar, xev->xbutton.x, xev->xbutton.y, OS_SIDE_RIGHT)) |
744 | 1871 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xbutton.x >= 0) && | ||
745 | 1872 | (xev->xbutton.y >= priv->overlay_all.y + priv->overlay.y && | ||
746 | 1873 | xev->xbutton.y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | ||
748 | 1874 | { | 1860 | { |
749 | 1875 | priv->can_hide = FALSE; | 1861 | priv->can_hide = FALSE; |
750 | 1876 | 1862 | ||
751 | @@ -1895,15 +1881,12 @@ | |||
752 | 1895 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1881 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
753 | 1896 | } | 1882 | } |
754 | 1897 | 1883 | ||
756 | 1898 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1884 | gtk_widget_show (priv->thumb); |
757 | 1899 | } | 1885 | } |
758 | 1900 | } | 1886 | } |
759 | 1901 | else | 1887 | else |
760 | 1902 | { | 1888 | { |
765 | 1903 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xbutton.y <= PROXIMITY_WIDTH && | 1889 | if (check_proximity (scrollbar, xev->xbutton.x, xev->xbutton.y, OS_SIDE_BOTTOM)) |
762 | 1904 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xbutton.y >= 0) && | ||
763 | 1905 | (xev->xbutton.x >= priv->overlay_all.x + priv->overlay.x && | ||
764 | 1906 | xev->xbutton.x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | ||
766 | 1907 | { | 1890 | { |
767 | 1908 | priv->can_hide = FALSE; | 1891 | priv->can_hide = FALSE; |
768 | 1909 | 1892 | ||
769 | @@ -1928,7 +1911,7 @@ | |||
770 | 1928 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1911 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
771 | 1929 | } | 1912 | } |
772 | 1930 | 1913 | ||
774 | 1931 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 1914 | gtk_widget_show (priv->thumb); |
775 | 1932 | } | 1915 | } |
776 | 1933 | } | 1916 | } |
777 | 1934 | } | 1917 | } |
778 | @@ -1991,10 +1974,7 @@ | |||
779 | 1991 | /* proximity area */ | 1974 | /* proximity area */ |
780 | 1992 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 1975 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
781 | 1993 | { | 1976 | { |
786 | 1994 | if ((priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xmotion.x <= PROXIMITY_WIDTH && | 1977 | if (check_proximity (scrollbar, xev->xmotion.x, xev->xmotion.y, OS_SIDE_RIGHT)) |
783 | 1995 | priv->overlay_all.x + DEFAULT_PAGER_WIDTH - xev->xmotion.x >= 0) && | ||
784 | 1996 | (xev->xmotion.y >= priv->overlay_all.y + priv->overlay.y && | ||
785 | 1997 | xev->xmotion.y <= priv->overlay_all.y + priv->overlay.y + priv->overlay.height)) | ||
787 | 1998 | { | 1978 | { |
788 | 1999 | priv->can_hide = FALSE; | 1979 | priv->can_hide = FALSE; |
789 | 2000 | 1980 | ||
790 | @@ -2019,9 +1999,9 @@ | |||
791 | 2019 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); | 1999 | move_thumb (scrollbar, priv->win_x, priv->win_y + priv->slider.y); |
792 | 2020 | } | 2000 | } |
793 | 2021 | 2001 | ||
795 | 2022 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 2002 | os_pager_set_detached (priv->pager, FALSE); |
796 | 2023 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 2003 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
798 | 2024 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 2004 | gtk_widget_show (priv->thumb); |
799 | 2025 | } | 2005 | } |
800 | 2026 | else | 2006 | else |
801 | 2027 | { | 2007 | { |
802 | @@ -2032,10 +2012,7 @@ | |||
803 | 2032 | } | 2012 | } |
804 | 2033 | else | 2013 | else |
805 | 2034 | { | 2014 | { |
810 | 2035 | if ((priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xmotion.y <= PROXIMITY_WIDTH && | 2015 | if (check_proximity (scrollbar, xev->xmotion.x, xev->xmotion.y, OS_SIDE_BOTTOM)) |
807 | 2036 | priv->overlay_all.y + DEFAULT_PAGER_WIDTH - xev->xmotion.y >= 0) && | ||
808 | 2037 | (xev->xmotion.x >= priv->overlay_all.x + priv->overlay.x && | ||
809 | 2038 | xev->xmotion.x <= priv->overlay_all.x + priv->overlay.x + priv->overlay.width)) | ||
811 | 2039 | { | 2016 | { |
812 | 2040 | priv->can_hide = FALSE; | 2017 | priv->can_hide = FALSE; |
813 | 2041 | 2018 | ||
814 | @@ -2060,9 +2037,9 @@ | |||
815 | 2060 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); | 2037 | move_thumb (scrollbar, priv->win_x + priv->slider.x, priv->win_y); |
816 | 2061 | } | 2038 | } |
817 | 2062 | 2039 | ||
819 | 2063 | os_pager_set_detached (OS_PAGER (priv->pager), FALSE); | 2040 | os_pager_set_detached (priv->pager, FALSE); |
820 | 2064 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); | 2041 | os_thumb_set_detached (OS_THUMB (priv->thumb), FALSE); |
822 | 2065 | gtk_widget_show (GTK_WIDGET (priv->thumb)); | 2042 | gtk_widget_show (priv->thumb); |
823 | 2066 | } | 2043 | } |
824 | 2067 | else | 2044 | else |
825 | 2068 | { | 2045 | { |
826 | @@ -2347,11 +2324,11 @@ | |||
827 | 2347 | /* on map-event of an active window, | 2324 | /* on map-event of an active window, |
828 | 2348 | * the pager should be active. */ | 2325 | * the pager should be active. */ |
829 | 2349 | priv->can_deactivate_pager = FALSE; | 2326 | priv->can_deactivate_pager = FALSE; |
831 | 2350 | os_pager_set_active (OS_PAGER (priv->pager), TRUE, FALSE); | 2327 | os_pager_set_active (priv->pager, TRUE, FALSE); |
832 | 2351 | } | 2328 | } |
833 | 2352 | 2329 | ||
834 | 2353 | if (priv->fullsize == FALSE) | 2330 | if (priv->fullsize == FALSE) |
836 | 2354 | os_pager_show (OS_PAGER (priv->pager)); | 2331 | os_pager_show (priv->pager); |
837 | 2355 | 2332 | ||
838 | 2356 | if (gtk_widget_get_realized (widget) && priv->filter == FALSE) | 2333 | if (gtk_widget_get_realized (widget) && priv->filter == FALSE) |
839 | 2357 | { | 2334 | { |
840 | @@ -2388,7 +2365,7 @@ | |||
841 | 2388 | 2365 | ||
842 | 2389 | calc_layout_pager (scrollbar, gtk_adjustment_get_value (priv->adjustment)); | 2366 | calc_layout_pager (scrollbar, gtk_adjustment_get_value (priv->adjustment)); |
843 | 2390 | 2367 | ||
845 | 2391 | os_pager_set_parent (OS_PAGER (priv->pager), widget); | 2368 | os_pager_set_parent (priv->pager, widget); |
846 | 2392 | 2369 | ||
847 | 2393 | store_toplevel_position (scrollbar); | 2370 | store_toplevel_position (scrollbar); |
848 | 2394 | } | 2371 | } |
849 | @@ -2403,46 +2380,43 @@ | |||
850 | 2403 | os_scrollbar_size_allocate (GtkWidget *widget, | 2380 | os_scrollbar_size_allocate (GtkWidget *widget, |
851 | 2404 | GdkRectangle *allocation) | 2381 | GdkRectangle *allocation) |
852 | 2405 | { | 2382 | { |
853 | 2406 | GdkRectangle rect; | ||
854 | 2407 | OsScrollbar *scrollbar; | 2383 | OsScrollbar *scrollbar; |
855 | 2408 | OsScrollbarPrivate *priv; | 2384 | OsScrollbarPrivate *priv; |
856 | 2409 | 2385 | ||
857 | 2410 | scrollbar = OS_SCROLLBAR (widget); | 2386 | scrollbar = OS_SCROLLBAR (widget); |
858 | 2411 | priv = scrollbar->priv; | 2387 | priv = scrollbar->priv; |
859 | 2412 | 2388 | ||
862 | 2413 | priv->trough.x = 0; | 2389 | priv->trough.x = allocation->x; |
863 | 2414 | priv->trough.y = 0; | 2390 | priv->trough.y = allocation->y; |
864 | 2415 | priv->trough.width = allocation->width; | 2391 | priv->trough.width = allocation->width; |
865 | 2416 | priv->trough.height = allocation->height; | 2392 | priv->trough.height = allocation->height; |
866 | 2417 | 2393 | ||
868 | 2418 | priv->overlay_all = *allocation; | 2394 | priv->pager_all = *allocation; |
869 | 2419 | priv->thumb_all = *allocation; | 2395 | priv->thumb_all = *allocation; |
870 | 2420 | 2396 | ||
871 | 2421 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 2397 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
872 | 2422 | { | 2398 | { |
876 | 2423 | priv->slider.width = DEFAULT_THUMB_WIDTH; | 2399 | priv->slider.width = THUMB_WIDTH; |
877 | 2424 | priv->slider.height = DEFAULT_THUMB_HEIGHT; | 2400 | priv->slider.height = THUMB_HEIGHT; |
878 | 2425 | priv->overlay_all.x = allocation->x - DEFAULT_PAGER_WIDTH; | 2401 | |
879 | 2402 | priv->pager_all.x = allocation->x - PAGER_SIZE; | ||
880 | 2403 | priv->pager_all.width = PAGER_SIZE; | ||
881 | 2404 | |||
882 | 2426 | priv->thumb_all.x = allocation->x + THUMB_ALLOCATION_SHIFT; | 2405 | priv->thumb_all.x = allocation->x + THUMB_ALLOCATION_SHIFT; |
888 | 2427 | 2406 | priv->thumb_all.width = THUMB_WIDTH; | |
884 | 2428 | rect.x = priv->overlay_all.x; | ||
885 | 2429 | rect.y = priv->overlay_all.y; | ||
886 | 2430 | rect.width = DEFAULT_PAGER_WIDTH; | ||
887 | 2431 | rect.height = priv->overlay_all.height; | ||
889 | 2432 | 2407 | ||
890 | 2433 | allocation->width = 0; | 2408 | allocation->width = 0; |
891 | 2434 | } | 2409 | } |
892 | 2435 | else | 2410 | else |
893 | 2436 | { | 2411 | { |
897 | 2437 | priv->slider.width = DEFAULT_THUMB_HEIGHT; | 2412 | priv->slider.width = THUMB_HEIGHT; |
898 | 2438 | priv->slider.height = DEFAULT_THUMB_WIDTH; | 2413 | priv->slider.height = THUMB_WIDTH; |
899 | 2439 | priv->overlay_all.y = allocation->y - DEFAULT_PAGER_WIDTH; | 2414 | |
900 | 2415 | priv->pager_all.y = allocation->y - PAGER_SIZE; | ||
901 | 2416 | priv->pager_all.height = PAGER_SIZE; | ||
902 | 2417 | |||
903 | 2440 | priv->thumb_all.y = allocation->y + THUMB_ALLOCATION_SHIFT; | 2418 | priv->thumb_all.y = allocation->y + THUMB_ALLOCATION_SHIFT; |
909 | 2441 | 2419 | priv->thumb_all.height = THUMB_HEIGHT; | |
905 | 2442 | rect.x = priv->overlay_all.x; | ||
906 | 2443 | rect.y = priv->overlay_all.y; | ||
907 | 2444 | rect.width = priv->overlay_all.width; | ||
908 | 2445 | rect.height = DEFAULT_PAGER_WIDTH; | ||
910 | 2446 | 2420 | ||
911 | 2447 | allocation->height = 0; | 2421 | allocation->height = 0; |
912 | 2448 | } | 2422 | } |
913 | @@ -2453,7 +2427,7 @@ | |||
914 | 2453 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (priv->adjustment)); | 2427 | calc_layout_slider (scrollbar, gtk_adjustment_get_value (priv->adjustment)); |
915 | 2454 | } | 2428 | } |
916 | 2455 | 2429 | ||
918 | 2456 | os_pager_size_allocate (OS_PAGER (priv->pager), rect); | 2430 | os_pager_size_allocate (priv->pager, priv->pager_all); |
919 | 2457 | 2431 | ||
920 | 2458 | move_pager (scrollbar); | 2432 | move_pager (scrollbar); |
921 | 2459 | 2433 | ||
922 | @@ -2496,7 +2470,7 @@ | |||
923 | 2496 | 2470 | ||
924 | 2497 | priv->proximity = FALSE; | 2471 | priv->proximity = FALSE; |
925 | 2498 | 2472 | ||
927 | 2499 | os_pager_hide (OS_PAGER (priv->pager)); | 2473 | os_pager_hide (priv->pager); |
928 | 2500 | 2474 | ||
929 | 2501 | gtk_widget_hide (priv->thumb); | 2475 | gtk_widget_hide (priv->thumb); |
930 | 2502 | 2476 | ||
931 | @@ -2517,7 +2491,7 @@ | |||
932 | 2517 | scrollbar = OS_SCROLLBAR (widget); | 2491 | scrollbar = OS_SCROLLBAR (widget); |
933 | 2518 | priv = scrollbar->priv; | 2492 | priv = scrollbar->priv; |
934 | 2519 | 2493 | ||
936 | 2520 | os_pager_hide (OS_PAGER (priv->pager)); | 2494 | os_pager_hide (priv->pager); |
937 | 2521 | 2495 | ||
938 | 2522 | gtk_widget_hide (priv->thumb); | 2496 | gtk_widget_hide (priv->thumb); |
939 | 2523 | 2497 | ||
940 | @@ -2527,7 +2501,7 @@ | |||
941 | 2527 | g_signal_handlers_disconnect_by_func (G_OBJECT (gtk_widget_get_toplevel (widget)), | 2501 | g_signal_handlers_disconnect_by_func (G_OBJECT (gtk_widget_get_toplevel (widget)), |
942 | 2528 | G_CALLBACK (toplevel_configure_event_cb), scrollbar); | 2502 | G_CALLBACK (toplevel_configure_event_cb), scrollbar); |
943 | 2529 | 2503 | ||
945 | 2530 | os_pager_set_parent (OS_PAGER (priv->pager), NULL); | 2504 | os_pager_set_parent (priv->pager, NULL); |
946 | 2531 | 2505 | ||
947 | 2532 | window_group_list = gtk_window_group_list_windows (priv->window_group); | 2506 | window_group_list = gtk_window_group_list_windows (priv->window_group); |
948 | 2533 | 2507 | ||
949 | 2534 | 2508 | ||
950 | === modified file 'os/os-thumb.c' | |||
951 | --- os/os-thumb.c 2011-06-09 11:19:20 +0000 | |||
952 | +++ os/os-thumb.c 2011-06-15 13:28:34 +0000 | |||
953 | @@ -828,15 +828,9 @@ | |||
954 | 828 | { | 828 | { |
955 | 829 | priv->orientation = g_value_get_enum (value); | 829 | priv->orientation = g_value_get_enum (value); |
956 | 830 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) | 830 | if (priv->orientation == GTK_ORIENTATION_VERTICAL) |
961 | 831 | { | 831 | gtk_window_resize (GTK_WINDOW (object), THUMB_WIDTH, THUMB_HEIGHT); |
958 | 832 | gtk_window_resize (GTK_WINDOW (object), DEFAULT_THUMB_WIDTH, | ||
959 | 833 | DEFAULT_THUMB_HEIGHT); | ||
960 | 834 | } | ||
962 | 835 | else | 832 | else |
967 | 836 | { | 833 | gtk_window_resize (GTK_WINDOW (object), THUMB_HEIGHT, THUMB_WIDTH); |
964 | 837 | gtk_window_resize (GTK_WINDOW (object), DEFAULT_THUMB_HEIGHT, | ||
965 | 838 | DEFAULT_THUMB_WIDTH); | ||
966 | 839 | } | ||
968 | 840 | break; | 834 | break; |
969 | 841 | } | 835 | } |
970 | 842 | 836 |