Merge lp:~malaperle/overlay-scrollbar/default into lp:overlay-scrollbar

Proposed by Marc-Andre Laperle
Status: Needs review
Proposed branch: lp:~malaperle/overlay-scrollbar/default
Merge into: lp:overlay-scrollbar
Diff against target: 64 lines (+23/-2)
1 file modified
os/os-scrollbar.c (+23/-2)
To merge this branch: bzr merge lp:~malaperle/overlay-scrollbar/default
Reviewer Review Type Date Requested Status
Adolfo Jayme Barrientos (community) Abstain
Ayatana Scrollbar Team Pending
Review via email: mp+175867@code.launchpad.net

This proposal supersedes a proposal from 2013-07-18.

Description of the change

Fix scrollbar not visible when it's the only child in a container.

To post a comment you must log in.
Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote : Posted in a previous version of this proposal

Please rebase your branch and resolve conflicts :-)

review: Needs Fixing
Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :

Thank you very much for sending this fix, and for keeping up with trunk! Looks sensible to me, but someone from the team must review this :-)

review: Abstain
Revision history for this message
Marc-Andre Laperle (malaperle) wrote :

Is there any way I can improve my fix or help with the review process? Should I add more comments to explain the issue?

Thanks!

Unmerged revisions

379. By Marc-Andre Laperle

Scrollbar not visible when it's the only child in a container (LP: #1188831)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'os/os-scrollbar.c'
--- os/os-scrollbar.c 2013-02-05 22:44:35 +0000
+++ os/os-scrollbar.c 2013-07-19 15:43:30 +0000
@@ -3712,6 +3712,8 @@
3712 if (priv->side == OS_SIDE_RIGHT)3712 if (priv->side == OS_SIDE_RIGHT)
3713 priv->bar_all.x = allocation->x - BAR_SIZE;3713 priv->bar_all.x = allocation->x - BAR_SIZE;
37143714
3715 priv->bar_all.x = MAX(priv->bar_all.x, 0);
3716
3715 priv->bar_all.width = BAR_SIZE;3717 priv->bar_all.width = BAR_SIZE;
37163718
3717 priv->thumb_all.width = THUMB_WIDTH;3719 priv->thumb_all.width = THUMB_WIDTH;
@@ -3721,6 +3723,8 @@
3721 else3723 else
3722 priv->thumb_all.x = allocation->x + priv->bar_all.width - priv->thumb_all.width;3724 priv->thumb_all.x = allocation->x + priv->bar_all.width - priv->thumb_all.width;
37233725
3726 priv->thumb_all.x = MAX(priv->thumb_all.x, 0);
3727
3724 allocation->width = 0;3728 allocation->width = 0;
3725 }3729 }
3726 else3730 else
@@ -3735,6 +3739,8 @@
3735 if (priv->side == OS_SIDE_BOTTOM)3739 if (priv->side == OS_SIDE_BOTTOM)
3736 priv->bar_all.y = allocation->y - BAR_SIZE;3740 priv->bar_all.y = allocation->y - BAR_SIZE;
37373741
3742 priv->bar_all.y = MAX(priv->bar_all.y, 0);
3743
3738 priv->bar_all.height = BAR_SIZE;3744 priv->bar_all.height = BAR_SIZE;
37393745
3740 priv->thumb_all.height = THUMB_WIDTH;3746 priv->thumb_all.height = THUMB_WIDTH;
@@ -3744,6 +3750,8 @@
3744 else3750 else
3745 priv->thumb_all.y = allocation->y + priv->bar_all.height - priv->thumb_all.height;3751 priv->thumb_all.y = allocation->y + priv->bar_all.height - priv->thumb_all.height;
37463752
3753 priv->thumb_all.y = MAX(priv->thumb_all.y, 0);
3754
3747 allocation->height = 0;3755 allocation->height = 0;
3748 }3756 }
37493757
@@ -3930,10 +3938,23 @@
39303938
3931 priv = get_private (widget);3939 priv = get_private (widget);
39323940
3941 int requested_bar_size = 0;
3942
3943 /* If the scrollbar is alone in a container, make sure it requests
3944 * some size so that it gets drawn */
3945 GtkWidget* parent = gtk_widget_get_parent (widget);
3946 if (!GTK_IS_SCROLLED_WINDOW (parent))
3947 {
3948 GList* list = gtk_container_get_children(GTK_CONTAINER(parent));
3949 if (!list->next)
3950 requested_bar_size = BAR_SIZE;
3951 g_list_free (list);
3952 }
3953
3933 if (priv->orientation == GTK_ORIENTATION_VERTICAL)3954 if (priv->orientation == GTK_ORIENTATION_VERTICAL)
3934 requisition->width = 0;3955 requisition->width = requested_bar_size;
3935 else3956 else
3936 requisition->height = 0;3957 requisition->height = requested_bar_size;
39373958
3938 widget->requisition = *requisition;3959 widget->requisition = *requisition;
39393960

Subscribers

People subscribed via source and target branches