[gtk+] headerbar: Don't underallocate the label box
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] headerbar: Don't underallocate the label box
- Date: Sat, 2 Apr 2016 15:04:37 +0000 (UTC)
commit 58891c1fe5f10f9823a8b61f4df1a1db9c0fd479
Author: Timm Bäder <mail baedert org>
Date: Sat Apr 2 16:20:09 2016 +0200
headerbar: Don't underallocate the label box
We use a label_sizing_box to make sure the headerbar can always contain
both a title and a subtitle without resizing when showing/hiding either
of them, but we should only do that for the height; the min width of the
label_box can be larger than that of the label_sizing_box.
gtk/gtkheaderbar.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 819fc4a..ee7a34c 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -646,7 +646,12 @@ gtk_header_bar_get_size (GtkWidget *widget,
center_min = center_nat = 0;
if (priv->label_box != NULL)
{
- if (add_child_size (priv->label_sizing_box, orientation, ¢er_min, ¢er_nat))
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ add_child_size (priv->label_box, orientation, ¢er_min, ¢er_nat);
+ else
+ add_child_size (priv->label_sizing_box, orientation, ¢er_min, ¢er_nat);
+
+ if (_gtk_widget_get_visible (priv->label_sizing_box))
nvis_children += 1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]