Merge lp:~cimi/overlay-scrollbar/deal-with-small-heights into lp:overlay-scrollbar

Proposed by Andrea Cimitan
Status: Merged
Approved by: Ted Gould
Approved revision: 267
Merged at revision: 267
Proposed branch: lp:~cimi/overlay-scrollbar/deal-with-small-heights
Merge into: lp:overlay-scrollbar
Diff against target: 100 lines (+42/-4)
3 files modified
os/os-private.h (+4/-0)
os/os-scrollbar.c (+20/-4)
os/os-thumb.c (+18/-0)
To merge this branch: bzr merge lp:~cimi/overlay-scrollbar/deal-with-small-heights
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+66027@code.launchpad.net

Description of the change

See the commit

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-private.h'
--- os/os-private.h 2011-06-15 12:07:47 +0000
+++ os/os-private.h 2011-06-27 17:07:42 +0000
@@ -175,6 +175,10 @@
175175
176GtkWidget* os_thumb_new (GtkOrientation orientation);176GtkWidget* os_thumb_new (GtkOrientation orientation);
177177
178void os_thumb_resize (OsThumb *thumb,
179 gint width,
180 gint height);
181
178void os_thumb_set_detached (OsThumb *thumb,182void os_thumb_set_detached (OsThumb *thumb,
179 gboolean detached);183 gboolean detached);
180184
181185
=== modified file 'os/os-scrollbar.c'
--- os/os-scrollbar.c 2011-06-27 13:37:17 +0000
+++ os/os-scrollbar.c 2011-06-27 17:07:42 +0000
@@ -2310,7 +2310,11 @@
2310 if (priv->orientation == GTK_ORIENTATION_VERTICAL)2310 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
2311 *minimal_width = *natural_width = 0;2311 *minimal_width = *natural_width = 0;
2312 else2312 else
2313 GTK_WIDGET_CLASS (os_scrollbar_parent_class)->get_preferred_width (widget, minimal_width, natural_width);2313 {
2314 /* smaller than 35 pixels the thumb looks weird. */
2315 *minimal_width = 35;
2316 *natural_width = THUMB_HEIGHT;
2317 }
2314}2318}
23152319
2316static void2320static void
@@ -2327,7 +2331,11 @@
2327 if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)2331 if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
2328 *minimal_height = *natural_height = 0;2332 *minimal_height = *natural_height = 0;
2329 else2333 else
2330 GTK_WIDGET_CLASS (os_scrollbar_parent_class)->get_preferred_height (widget, minimal_height, natural_height);2334 {
2335 /* smaller than 35 pixels the thumb looks weird. */
2336 *minimal_height = 35;
2337 *natural_height = THUMB_HEIGHT;
2338 }
2331}2339}
2332#endif2340#endif
23332341
@@ -2461,7 +2469,11 @@
2461 if (priv->orientation == GTK_ORIENTATION_VERTICAL)2469 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
2462 {2470 {
2463 priv->slider.width = THUMB_WIDTH;2471 priv->slider.width = THUMB_WIDTH;
2464 priv->slider.height = THUMB_HEIGHT;2472 if (priv->slider.height != MIN (THUMB_HEIGHT, allocation->height))
2473 {
2474 priv->slider.height = MIN (THUMB_HEIGHT, allocation->height);
2475 os_thumb_resize (OS_THUMB (priv->thumb), priv->slider.width, priv->slider.height);
2476 }
24652477
2466 priv->pager_all.x = allocation->x - PAGER_SIZE;2478 priv->pager_all.x = allocation->x - PAGER_SIZE;
2467 priv->pager_all.width = PAGER_SIZE;2479 priv->pager_all.width = PAGER_SIZE;
@@ -2473,8 +2485,12 @@
2473 }2485 }
2474 else2486 else
2475 {2487 {
2476 priv->slider.width = THUMB_HEIGHT;
2477 priv->slider.height = THUMB_WIDTH;2488 priv->slider.height = THUMB_WIDTH;
2489 if (priv->slider.width != MIN (THUMB_HEIGHT, allocation->width))
2490 {
2491 priv->slider.width = MIN (THUMB_HEIGHT, allocation->width);
2492 os_thumb_resize (OS_THUMB (priv->thumb), priv->slider.width, priv->slider.height);
2493 }
24782494
2479 priv->pager_all.y = allocation->y - PAGER_SIZE;2495 priv->pager_all.y = allocation->y - PAGER_SIZE;
2480 priv->pager_all.height = PAGER_SIZE;2496 priv->pager_all.height = PAGER_SIZE;
24812497
=== modified file 'os/os-thumb.c'
--- os/os-thumb.c 2011-06-27 16:02:50 +0000
+++ os/os-thumb.c 2011-06-27 17:07:42 +0000
@@ -855,6 +855,24 @@
855}855}
856856
857/**857/**
858 * os_thumb_resize:
859 * @thumb: a #OsThumb
860 * @width: width in pixels
861 * @height: height in pixels
862 *
863 * Resize the thumb.
864 **/
865void
866os_thumb_resize (OsThumb *thumb,
867 gint width,
868 gint height)
869{
870 g_return_if_fail (OS_THUMB (thumb));
871
872 gtk_window_resize (GTK_WINDOW (thumb), width, height);
873}
874
875/**
858 * os_thumb_set_detached:876 * os_thumb_set_detached:
859 * @thumb: a #OsThumb877 * @thumb: a #OsThumb
860 * @detached: a gboolean878 * @detached: a gboolean

Subscribers

People subscribed via source and target branches