[Xfce4-commits] <xfce4-indicator-plugin:master> Use "single-row" property

Andrzej noreply at xfce.org
Fri Sep 6 01:58:02 CEST 2013


Updating branch refs/heads/master
         to 7187abbc56d80a790a6dd9df518dd62184e2387e (commit)
       from 2df49bb8778cc823dc4bb3147e152d777dce53bd (commit)

commit 7187abbc56d80a790a6dd9df518dd62184e2387e
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Fri Sep 6 00:54:31 2013 +0100

    Use "single-row" property

 panel-plugin/indicator-box.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 7dc744c..c0fa328 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -324,6 +324,7 @@ xfce_indicator_box_get_preferred_length (GtkWidget *widget,
   GtkStyleContext     *ctx;
   GtkBorder            padding, border;
   gint                 border_thickness;
+  gboolean             allow_small;
 
   /* check border thickness of the first button */
   li = gtk_container_get_children (GTK_CONTAINER (box));
@@ -340,6 +341,7 @@ xfce_indicator_box_get_preferred_length (GtkWidget *widget,
   size = ICON_SIZE + border_thickness;
   panel_size = indicator_config_get_panel_size (box->config);
   nrows = MAX (1, panel_size / size);
+  allow_small = !((nrows == 1) || indicator_config_get_single_row (box->config));
 
   panel_orientation = indicator_config_get_panel_orientation (box->config);
 
@@ -361,7 +363,7 @@ xfce_indicator_box_get_preferred_length (GtkWidget *widget,
 
           gtk_widget_get_preferred_size (GTK_WIDGET (button), NULL, &child_req);
 
-          is_small = xfce_indicator_button_is_small (button);
+          is_small = allow_small && xfce_indicator_button_is_small (button);
 
           /* wrap rows if column is overflowing or a label is encountered */
           if (row > 0 && (row >= nrows || !is_small))
@@ -469,6 +471,7 @@ xfce_indicator_box_size_allocate (GtkWidget     *widget,
   GtkStyleContext     *ctx;
   GtkBorder            padding, border;
   gint                 border_thickness;
+  gboolean             allow_small;
 
   row = 0;
   length = 0;
@@ -496,6 +499,7 @@ xfce_indicator_box_size_allocate (GtkWidget     *widget,
   nrows = panel_size / size;
   //full_size = ((nrows-1)*panel_size + nrows*size) / nrows; // regular pitch, margins
   full_size = panel_size; // irregular pitch, no margins
+  allow_small = !((nrows == 1) || indicator_config_get_single_row (box->config));
 
   panel_orientation = indicator_config_get_panel_orientation (box->config);
 
@@ -513,7 +517,7 @@ xfce_indicator_box_size_allocate (GtkWidget     *widget,
 
           gtk_widget_get_preferred_size (GTK_WIDGET (button), NULL, &child_req);
 
-          is_small = xfce_indicator_button_is_small (button);
+          is_small = allow_small && xfce_indicator_button_is_small (button);
 
           /* wrap rows if column is overflowing or a label is encountered */
           if (row > 0 && (row >= nrows || !is_small))


More information about the Xfce4-commits mailing list