[Xfce4-commits] [xfce/xfce4-panel] 63/73: Fixes to the panel sizing.

noreply at xfce.org noreply at xfce.org
Sun Feb 26 16:34:44 CET 2017


This is an automated email from the git hooks/post-receive script.

andrzejr pushed a commit to branch master
in repository xfce/xfce4-panel.

commit ea02b70707ee796848d28b9b676a112e32ee6e77
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sat Oct 29 00:33:37 2016 +0100

    Fixes to the panel sizing.
    
    Issue exposed by the pager plugin, which somehow forces
    use of width_for_height and height_for_width functions.
---
 panel/panel-itembar.c |  7 ++++---
 panel/panel-window.c  | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c
index 2a25429..6f646a4 100644
--- a/panel/panel-itembar.c
+++ b/panel/panel-itembar.c
@@ -344,7 +344,6 @@ panel_itembar_get_preferred_length (GtkWidget      *widget,
             gtk_widget_get_preferred_width (child->widget, &child_len_min, &child_len);
           else
             gtk_widget_get_preferred_height (child->widget, &child_len_min, &child_len);
-
           /* check if the small child fits in a row */
           if (child->option == CHILD_OPTION_SMALL
               && itembar->nrows > 1)
@@ -388,12 +387,14 @@ panel_itembar_get_preferred_length (GtkWidget      *widget,
 
   /* return the total size */
   border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
+  total_len += border_width;
+  total_len_min += border_width;
 
   if (natural_length != NULL)
-    *natural_length = total_len + border_width;
+    *natural_length = total_len;
 
   if (minimum_length != NULL)
-    *minimum_length = total_len + border_width;
+    *minimum_length = total_len_min;
 }
 
 
diff --git a/panel/panel-window.c b/panel/panel-window.c
index b090eb7..cd96dd1 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -115,6 +115,14 @@ static void         panel_window_get_preferred_width        (GtkWidget        *w
 static void         panel_window_get_preferred_height       (GtkWidget        *widget,
                                                              gint             *minimum_height,
                                                              gint             *natural_height);
+static void         panel_window_get_preferred_width_for_height (GtkWidget        *widget,
+                                                                 gint              height,
+                                                                 gint             *minimum_width,
+                                                                 gint             *natural_width);
+static void         panel_window_get_preferred_height_for_width (GtkWidget        *widget,
+                                                                 gint              width,
+                                                                 gint             *minimum_height,
+                                                                 gint             *natural_height);
 static void         panel_window_size_allocate              (GtkWidget        *widget,
                                                              GtkAllocation    *alloc);
 static void         panel_window_size_allocate_set_xy       (PanelWindow      *window,
@@ -352,6 +360,8 @@ panel_window_class_init (PanelWindowClass *klass)
   gtkwidget_class->grab_notify = panel_window_grab_notify;
   gtkwidget_class->get_preferred_width = panel_window_get_preferred_width;
   gtkwidget_class->get_preferred_height = panel_window_get_preferred_height;
+  gtkwidget_class->get_preferred_width_for_height = panel_window_get_preferred_width_for_height;
+  gtkwidget_class->get_preferred_height_for_width = panel_window_get_preferred_height_for_width;
   gtkwidget_class->size_allocate = panel_window_size_allocate;
   gtkwidget_class->screen_changed = panel_window_screen_changed;
   gtkwidget_class->style_set = panel_window_style_set;
@@ -1257,6 +1267,28 @@ panel_window_get_preferred_height (GtkWidget *widget,
 
 
 static void
+panel_window_get_preferred_width_for_height (GtkWidget *widget,
+                                             gint       height,
+                                             gint      *minimum_width,
+                                             gint      *natural_width)
+{
+  panel_window_get_preferred_width (widget, minimum_width, natural_width);
+}
+
+
+
+static void
+panel_window_get_preferred_height_for_width (GtkWidget *widget,
+                                             gint       width,
+                                             gint      *minimum_height,
+                                             gint      *natural_height)
+{
+  panel_window_get_preferred_height (widget, minimum_height, natural_height);
+}
+
+
+
+static void
 panel_window_size_allocate (GtkWidget     *widget,
                             GtkAllocation *alloc)
 {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list