[Xfce4-commits] <xfce4-indicator-plugin:master> Layout fixes

Andrzej noreply at xfce.org
Thu Apr 18 01:40:01 CEST 2013


Updating branch refs/heads/master
         to 9804040922991c81ebd86632ae4abd207be16dbe (commit)
       from 54c2201a20bf5d1bc618133fcee634cb9c3ff8bf (commit)

commit 9804040922991c81ebd86632ae4abd207be16dbe
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Thu Apr 18 00:37:51 2013 +0100

    Layout fixes

 panel-plugin/indicator-box.c        |  130 +++++++++++++-------------
 panel-plugin/indicator-button.c     |  178 +++++++++++++++++++++++++++--------
 panel-plugin/indicator-config.c     |   34 ++++----
 panel-plugin/indicator-config.h     |    2 +-
 panel-plugin/indicator-dialog.c     |    4 +-
 panel-plugin/indicator-dialog.glade |    4 +-
 6 files changed, 225 insertions(+), 127 deletions(-)

diff --git a/panel-plugin/indicator-box.c b/panel-plugin/indicator-box.c
index 6651d3c..92e53ad 100644
--- a/panel-plugin/indicator-box.c
+++ b/panel-plugin/indicator-box.c
@@ -33,28 +33,29 @@
 #include "indicator-box.h"
 #include "indicator-button.h"
 
-static void                 xfce_indicator_box_finalize       (GObject          *object);
-static void                 xfce_indicator_box_list_changed   (XfceIndicatorBox *box,
-                                                               IndicatorConfig  *config);
-static void                 xfce_indicator_box_add            (GtkContainer     *container,
-                                                               GtkWidget        *child);
-static void                 xfce_indicator_box_remove         (GtkContainer     *container,
-                                                               GtkWidget        *child);
-static void                 xfce_indicator_box_forall         (GtkContainer     *container,
-                                                               gboolean          include_internals,
-                                                               GtkCallback       callback,
-                                                               gpointer          callback_data);
-static GType                xfce_indicator_box_child_type     (GtkContainer     *container);
-static void                 xfce_indicator_box_size_request   (GtkWidget        *widget,
-                                                               GtkRequisition   *requisition);
-static void                 xfce_indicator_box_get_preferred_width (GtkWidget   *widget,
-                                                                    gint        *minimal_width,
-                                                                    gint        *natural_width);
-static void                 xfce_indicator_box_get_preferred_height (GtkWidget   *widget,
-                                                                     gint        *minimal_height,
-                                                                     gint        *natural_height);
-static void                 xfce_indicator_box_size_allocate  (GtkWidget        *widget,
-                                                               GtkAllocation    *allocation);
+static void                 xfce_indicator_box_finalize             (GObject          *object);
+static void                 xfce_indicator_box_list_changed         (XfceIndicatorBox *box,
+                                                                     IndicatorConfig  *config);
+static void                 xfce_indicator_box_add                  (GtkContainer     *container,
+                                                                     GtkWidget        *child);
+static void                 xfce_indicator_box_remove               (GtkContainer     *container,
+                                                                     GtkWidget        *child);
+static void                 xfce_indicator_box_forall               (GtkContainer     *container,
+                                                                     gboolean          include_internals,
+                                                                     GtkCallback       callback,
+                                                                     gpointer          callback_data);
+static GType                xfce_indicator_box_child_type           (GtkContainer     *container);
+static void                 xfce_indicator_box_get_preferred_length (GtkWidget        *widget,
+                                                                     gint             *minimal_length,
+                                                                     gint             *natural_length);
+static void                 xfce_indicator_box_get_preferred_width  (GtkWidget        *widget,
+                                                                     gint             *minimal_width,
+                                                                     gint             *natural_width);
+static void                 xfce_indicator_box_get_preferred_height (GtkWidget        *widget,
+                                                                     gint             *minimal_height,
+                                                                     gint             *natural_height);
+static void                 xfce_indicator_box_size_allocate        (GtkWidget        *widget,
+                                                                     GtkAllocation    *allocation);
 
 
 struct _XfceIndicatorBox
@@ -65,14 +66,6 @@ struct _XfceIndicatorBox
 
   GHashTable           *children;
 
-  gint                  panel_size;
-  gint                  nrows;
-  gint                  icon_size_max;
-  gboolean              align_left;
-
-  GtkOrientation        panel_orientation;
-  GtkOrientation        orientation;
-
   gulong                indicator_list_changed_id;
 };
 
@@ -313,17 +306,9 @@ xfce_indicator_box_child_type (GtkContainer *container)
 static gint
 xfce_indicator_box_get_row_size (XfceIndicatorBox *box)
 {
-  gint                 border_thickness;
-  GtkStyle            *style;
-
-  g_return_val_if_fail (XFCE_IS_INDICATOR_BOX (box), 24);
-
-  style = gtk_widget_get_style (GTK_WIDGET (box));
-  border_thickness = 2 * MAX (style->xthickness, style->ythickness) + 2;
-
   return MIN (indicator_config_get_panel_size (box->config) /
               indicator_config_get_nrows (box->config),
-              indicator_config_get_icon_size_max (box->config) + border_thickness);
+              indicator_config_get_row_size_max (box->config));
 }
 
 
@@ -331,8 +316,9 @@ xfce_indicator_box_get_row_size (XfceIndicatorBox *box)
 
 
 static void
-xfce_indicator_box_size_request (GtkWidget      *widget,
-                                 GtkRequisition *requisition)
+xfce_indicator_box_get_preferred_length (GtkWidget *widget,
+                                         gint      *minimum_length,
+                                         gint      *natural_length)
 {
   XfceIndicatorBox    *box = XFCE_INDICATOR_BOX (widget);
   XfceIndicatorButton *button;
@@ -364,7 +350,7 @@ xfce_indicator_box_size_request (GtkWidget      *widget,
         {
           button = XFCE_INDICATOR_BUTTON (li_tmp->data);
 
-          gtk_widget_size_request (GTK_WIDGET (button), &child_req);
+          gtk_widget_get_preferred_size (GTK_WIDGET (button), NULL, &child_req);
           has_label = (xfce_indicator_button_get_label (button) != NULL);
           rectangular_icon = xfce_indicator_button_is_icon_rectangular (button);
 
@@ -394,45 +380,61 @@ xfce_indicator_box_size_request (GtkWidget      *widget,
 
   x += length;
 
-  if (panel_orientation == GTK_ORIENTATION_HORIZONTAL)
-    {
-      requisition->width = x;
-      requisition->height = panel_size;
-    }
-  else
-    {
-      requisition->width = panel_size;
-      requisition->height = x;
-    }
-  /* g_debug ("indicator-box size request: w=%d h=%d", requisition->width, requisition->height); */
+  if (minimum_length != NULL)
+    *minimum_length = x;
+
+  if (natural_length != NULL)
+    *natural_length = x;
+
+  /* g_debug ("indicator-box size request: %d", x); */
 }
 
 
 
 static void
 xfce_indicator_box_get_preferred_width (GtkWidget *widget,
-                                        gint      *minimal_width,
+                                        gint      *minimum_width,
                                         gint      *natural_width)
 {
-  GtkRequisition requisition;
+  XfceIndicatorBox *box = XFCE_INDICATOR_BOX (widget);
+  gint              panel_size;
 
-  xfce_indicator_box_size_request (widget, &requisition);
-
-  *minimal_width = *natural_width = requisition.width;
+  if (indicator_config_get_panel_orientation (box->config) == GTK_ORIENTATION_HORIZONTAL)
+    {
+      xfce_indicator_box_get_preferred_length (widget, minimum_width, natural_width);
+    }
+  else
+    {
+      panel_size = indicator_config_get_panel_size (box->config);
+      if (minimum_width != NULL)
+        *minimum_width = panel_size;
+      if (natural_width != NULL)
+        *natural_width = panel_size;
+    }
 }
 
 
 
 static void
 xfce_indicator_box_get_preferred_height (GtkWidget *widget,
-                                         gint      *minimal_height,
+                                         gint      *minimum_height,
                                          gint      *natural_height)
 {
-  GtkRequisition requisition;
+  XfceIndicatorBox *box = XFCE_INDICATOR_BOX (widget);
+  gint              panel_size;
 
-  xfce_indicator_box_size_request (widget, &requisition);
-
-  *minimal_height = *natural_height = requisition.height;
+  if (indicator_config_get_panel_orientation (box->config) == GTK_ORIENTATION_VERTICAL)
+    {
+      xfce_indicator_box_get_preferred_length (widget, minimum_height, natural_height);
+    }
+  else
+    {
+      panel_size = indicator_config_get_panel_size (box->config);
+      if (minimum_height != NULL)
+        *minimum_height = panel_size;
+      if (natural_height != NULL)
+        *natural_height = panel_size;
+    }
 }
 
 
@@ -481,7 +483,7 @@ xfce_indicator_box_size_allocate (GtkWidget     *widget,
         {
           button = XFCE_INDICATOR_BUTTON (li_tmp->data);
 
-          gtk_widget_get_child_requisition (GTK_WIDGET (button), &child_req);
+          gtk_widget_get_preferred_size (GTK_WIDGET (button), NULL, &child_req);
 
           has_label = (xfce_indicator_button_get_label (button) != NULL);
           rectangular_icon = xfce_indicator_button_is_icon_rectangular (button);
diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index ca1458c..a15c694 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -38,6 +38,11 @@
 //#define INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED "scroll-entry"
 //#endif
 
+//#if GTK_CHECK_VERSION (3, 0, 0) && !GTK_CHECK_VERSION (3, 10, 0)
+#if GTK_CHECK_VERSION (3, 0, 0)
+#define GTK_BUTTON_SIZING_FIX
+#endif
+
 
 static void                 xfce_indicator_button_finalize        (GObject                *object);
 static gint                 xfce_indicator_button_get_icon_size   (XfceIndicatorButton    *button);
@@ -47,8 +52,14 @@ static gboolean             xfce_indicator_button_scroll          (GtkWidget
                                                                    GdkEventScroll         *event);
 static void                 xfce_indicator_button_menu_deactivate (XfceIndicatorButton    *button,
                                                                    GtkMenu                *menu);
-static gint                 xfce_indicator_button_get_size        (XfceIndicatorButton    *button);
-
+#ifdef GTK_BUTTON_SIZING_FIX
+static void            xfce_indicator_button_get_preferred_width  (GtkWidget              *widget,
+                                                                   gint                   *minimum_width,
+                                                                   gint                   *natural_width);
+static void            xfce_indicator_button_get_preferred_height (GtkWidget              *widget,
+                                                                   gint                   *minimum_height,
+                                                                   gint                   *natural_height);
+#endif
 
 
 struct _XfceIndicatorButton
@@ -95,7 +106,10 @@ xfce_indicator_button_class_init (XfceIndicatorButtonClass *klass)
   widget_class = GTK_WIDGET_CLASS (klass);
   widget_class->button_press_event = xfce_indicator_button_button_press;
   widget_class->scroll_event = xfce_indicator_button_scroll;
-
+#ifdef GTK_BUTTON_SIZING_FIX
+  widget_class->get_preferred_width = xfce_indicator_button_get_preferred_width;
+  widget_class->get_preferred_height = xfce_indicator_button_get_preferred_height;
+#endif
 }
 
 
@@ -129,7 +143,7 @@ xfce_indicator_button_init (XfceIndicatorButton *button)
   gtk_widget_show (button->align_box);
 
   //button->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 1);
-  button->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
+  button->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
   gtk_container_add (GTK_CONTAINER (button->align_box), button->box);
   gtk_widget_show (button->box);
 }
@@ -167,6 +181,9 @@ xfce_indicator_button_update_layout (XfceIndicatorButton *button)
 {
   GtkRequisition          label_size;
   gfloat                  align_x;
+  gint                    border_thickness;
+  GtkStyleContext        *ctx;
+  GtkBorder               padding, border;
 
   g_return_if_fail (XFCE_IS_INDICATOR_BUTTON (button));
 
@@ -178,14 +195,24 @@ xfce_indicator_button_update_layout (XfceIndicatorButton *button)
       indicator_config_get_panel_orientation (button->config) == GTK_ORIENTATION_VERTICAL &&
       indicator_config_get_orientation (button->config) == GTK_ORIENTATION_HORIZONTAL)
     {
-      gtk_widget_size_request (button->label, &label_size);
+      ctx = gtk_widget_get_style_context (GTK_WIDGET (button));
+      gtk_style_context_get_padding (ctx,
+                                     gtk_widget_get_state_flags (GTK_WIDGET (button)),
+                                     &padding);
+      gtk_style_context_get_border (ctx,
+                                    gtk_widget_get_state_flags (GTK_WIDGET (button)),
+                                    &border);
+      border_thickness = MAX (padding.left+padding.right+border.left+border.right,
+                              padding.top+padding.bottom+border.top+border.bottom);
+
+      gtk_widget_get_preferred_size (button->label, NULL, &label_size);
 
       /* check if icon and label fit side by side */
       if (!indicator_config_get_align_left (button->config)
           || (button->icon != NULL
               && label_size.width >
-              indicator_config_get_panel_size (button->config)
-              - xfce_indicator_button_get_size (button)))
+              indicator_config_get_panel_size (button->config) - 2 - border_thickness
+              - xfce_indicator_button_get_icon_size (button)))
         {
           align_x = 0.5;
           gtk_orientable_set_orientation (GTK_ORIENTABLE (button->box), GTK_ORIENTATION_VERTICAL);
@@ -197,7 +224,7 @@ xfce_indicator_button_update_layout (XfceIndicatorButton *button)
         }
 
       /* check if label alone fits in the panel */
-      if (label_size.width > indicator_config_get_panel_size (button->config) - 6)
+      if (label_size.width > indicator_config_get_panel_size (button->config) - border_thickness)
         {
           gtk_alignment_set (GTK_ALIGNMENT (button->align_box), align_x, 0.5, 1.0, 0.0);
           gtk_label_set_ellipsize (GTK_LABEL (button->label), PANGO_ELLIPSIZE_END);
@@ -227,11 +254,12 @@ xfce_indicator_button_update_layout (XfceIndicatorButton *button)
 static void
 xfce_indicator_button_update_icon (XfceIndicatorButton *button)
 {
-  GdkPixbuf    *pixbuf_s, *pixbuf_d;
-  gdouble       aspect;
-  gint          w, h, size;
-  gint          border_thickness;
-  GtkStyle     *style;
+  GdkPixbuf        *pixbuf_s, *pixbuf_d;
+  gdouble           aspect;
+  gint              w, h, size;
+  gint              border_thickness;
+  GtkStyleContext  *ctx;
+  GtkBorder         padding, border;
 
   g_return_if_fail (GTK_IS_IMAGE (button->orig_icon));
   g_return_if_fail (GTK_IS_IMAGE (button->icon));
@@ -254,14 +282,21 @@ xfce_indicator_button_update_icon (XfceIndicatorButton *button)
       w = gdk_pixbuf_get_width (pixbuf_s);
       h = gdk_pixbuf_get_height (pixbuf_s);
       aspect = (gdouble) w / (gdouble) h;
+      ctx = gtk_widget_get_style_context (GTK_WIDGET (button));
+      gtk_style_context_get_padding (ctx,
+                                     gtk_widget_get_state_flags (GTK_WIDGET (button)),
+                                     &padding);
+      gtk_style_context_get_border (ctx,
+                                    gtk_widget_get_state_flags (GTK_WIDGET (button)),
+                                    &border);
+      border_thickness = MAX (padding.left+padding.right+border.left+border.right,
+                              padding.top+padding.bottom+border.top+border.bottom);
 
       button->rectangular_icon = (w != h);
 
       if (indicator_config_get_panel_orientation (button->config) == GTK_ORIENTATION_VERTICAL &&
-          size * aspect > indicator_config_get_panel_size (button->config))
+          size * aspect > indicator_config_get_panel_size (button->config) - border_thickness)
         {
-          style = gtk_widget_get_style (GTK_WIDGET (button->plugin));
-          border_thickness = 2 * MAX (style->xthickness, style->ythickness);
           w = indicator_config_get_panel_size (button->config) - border_thickness;
           h = (gint) (w / aspect);
         }
@@ -489,40 +524,26 @@ xfce_indicator_button_get_icon_size (XfceIndicatorButton *button)
 {
   gint                 indicator_size;
   gint                 border_thickness;
-  GtkStyle            *style;
+  GtkStyleContext     *ctx;
+  GtkBorder            padding, border;
 
   g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 22);
 
-  indicator_size = xfce_indicator_button_get_size (button);
+  indicator_size = MIN (indicator_config_get_panel_size (button->config) /
+                        indicator_config_get_nrows (button->config),
+                        indicator_config_get_row_size_max (button->config));
 
-  style = gtk_widget_get_style (GTK_WIDGET (button->plugin));
-  border_thickness = 2 * MAX (style->xthickness, style->ythickness);
+  ctx = gtk_widget_get_style_context (GTK_WIDGET (button));
+  gtk_style_context_get_padding (ctx, gtk_widget_get_state_flags (GTK_WIDGET (button)), &padding);
+  gtk_style_context_get_border (ctx, gtk_widget_get_state_flags (GTK_WIDGET (button)), &border);
+  border_thickness = MAX (padding.left+padding.right+border.left+border.right,
+                          padding.top+padding.bottom+border.top+border.bottom);
 
-  return MIN (indicator_size - border_thickness,
-              indicator_config_get_icon_size_max (button->config));
+  return indicator_size - border_thickness;
 }
 
 
 
-static gint
-xfce_indicator_button_get_size (XfceIndicatorButton *button)
-{
-  gint                 border_thickness;
-  GtkStyle            *style;
-
-  g_return_val_if_fail (XFCE_IS_INDICATOR_BUTTON (button), 24);
-
-  style = gtk_widget_get_style (GTK_WIDGET (button->plugin));
-  border_thickness = 2 * MAX (style->xthickness, style->ythickness) ;
-
-  return MIN (indicator_config_get_panel_size (button->config) /
-              indicator_config_get_nrows (button->config),
-              indicator_config_get_icon_size_max (button->config) + border_thickness);
-}
-
-
-
-
 static void
 xfce_indicator_configuration_changed (XfceIndicatorButton *button,
                                       IndicatorConfig     *config)
@@ -635,3 +656,78 @@ xfce_indicator_button_menu_deactivate (XfceIndicatorButton *button,
 
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
 }
+
+
+
+
+#ifdef GTK_BUTTON_SIZING_FIX
+/* When can_focus is true, GtkButton allocates larger size than requested *
+ * and causes the panel image to grow indefinitely.                       *
+ * This workaround compensates for this difference.                       *
+ * Details in https://bugzilla.gnome.org/show_bug.cgi?id=698030           *
+ */
+static gint
+xfce_indicator_button_padding_correction (GtkWidget *widget)
+{
+  GtkStyleContext       *context;
+  gint                   focus_width;
+  gint                   focus_pad;
+  gint                   correction;
+
+  if (!gtk_widget_get_can_focus (widget))
+    {
+      context = gtk_widget_get_style_context (widget);
+      gtk_style_context_get_style (context,
+                                   "focus-line-width", &focus_width,
+                                   "focus-padding", &focus_pad,
+                                   NULL);
+      correction = (focus_width + focus_pad) * 2;
+    }
+  else
+    {
+      correction = 0;
+    }
+
+  return correction;
+}
+
+
+
+static void
+xfce_indicator_button_get_preferred_width (GtkWidget *widget,
+                                           gint      *minimum_width,
+                                           gint      *natural_width)
+{
+  gint correction;
+
+  (*GTK_WIDGET_CLASS (xfce_indicator_button_parent_class)->get_preferred_width) (widget, minimum_width, natural_width);
+
+  correction = xfce_indicator_button_padding_correction (widget);
+
+  if (minimum_width != NULL)
+    *minimum_width = MAX (0, *minimum_width - correction);
+
+  if (natural_width != NULL)
+    *natural_width = MAX (0, *natural_width - correction);
+}
+
+
+
+static void
+xfce_indicator_button_get_preferred_height (GtkWidget *widget,
+                                            gint      *minimum_height,
+                                            gint      *natural_height)
+{
+  gint correction;
+
+  (*GTK_WIDGET_CLASS (xfce_indicator_button_parent_class)->get_preferred_height) (widget, minimum_height, natural_height);
+
+  correction = xfce_indicator_button_padding_correction (widget);
+
+  if (minimum_height != NULL)
+    *minimum_height = MAX (0, *minimum_height - correction);
+
+  if (natural_height != NULL)
+    *natural_height = MAX (0, *natural_height - correction);
+}
+#endif
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index 06fb0a9..2c89a8c 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -45,7 +45,7 @@
 
 
 
-#define DEFAULT_ICON_SIZE_MAX      22
+#define DEFAULT_ROW_SIZE_MAX       24
 #define DEFAULT_ALIGN_LEFT         FALSE
 #define DEFAULT_EXCLUDED_MODULES   NULL
 #define DEFAULT_ORIENTATION        GTK_ORIENTATION_HORIZONTAL
@@ -77,7 +77,7 @@ struct _IndicatorConfig
 {
   GObject          __parent__;
 
-  gint             icon_size_max;
+  gint             row_size_max;
   gboolean         align_left;
   gboolean         mode_whitelist;
   GHashTable      *blacklist;
@@ -98,7 +98,7 @@ struct _IndicatorConfig
 enum
 {
   PROP_0,
-  PROP_ICON_SIZE_MAX,
+  PROP_ROW_SIZE_MAX,
   PROP_ALIGN_LEFT,
   PROP_MODE_WHITELIST,
   PROP_BLACKLIST,
@@ -150,12 +150,12 @@ indicator_config_class_init (IndicatorConfigClass *klass)
   gobject_class->set_property = indicator_config_set_property;
 
   g_object_class_install_property (gobject_class,
-                                   PROP_ICON_SIZE_MAX,
-                                   g_param_spec_uint ("icon-size-max",
+                                   PROP_ROW_SIZE_MAX,
+                                   g_param_spec_uint ("row-size-max",
                                                       NULL, NULL,
                                                       1,
                                                       128,
-                                                      DEFAULT_ICON_SIZE_MAX,
+                                                      DEFAULT_ROW_SIZE_MAX,
                                                       G_PARAM_READWRITE |
                                                       G_PARAM_STATIC_STRINGS));
 
@@ -221,7 +221,7 @@ indicator_config_class_init (IndicatorConfigClass *klass)
 static void
 indicator_config_init (IndicatorConfig *config)
 {
-  config->icon_size_max        = DEFAULT_ICON_SIZE_MAX;
+  config->row_size_max         = DEFAULT_ROW_SIZE_MAX;
   config->align_left           = DEFAULT_ALIGN_LEFT;
   config->mode_whitelist       = DEFAULT_MODE_WHITELIST;
   config->blacklist            = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -281,8 +281,8 @@ indicator_config_get_property (GObject    *object,
 
   switch (prop_id)
     {
-    case PROP_ICON_SIZE_MAX:
-      g_value_set_uint (value, config->icon_size_max);
+    case PROP_ROW_SIZE_MAX:
+      g_value_set_uint (value, config->row_size_max);
       break;
 
     case PROP_ALIGN_LEFT:
@@ -343,11 +343,11 @@ indicator_config_set_property (GObject      *object,
 
   switch (prop_id)
     {
-    case PROP_ICON_SIZE_MAX:
+    case PROP_ROW_SIZE_MAX:
       val = g_value_get_uint (value);
-      if (config->icon_size_max != val)
+      if (config->row_size_max != val)
         {
-          config->icon_size_max = val;
+          config->row_size_max = val;
           g_signal_emit (G_OBJECT (config), indicator_config_signals [CONFIGURATION_CHANGED], 0);
         }
       break;
@@ -430,11 +430,11 @@ indicator_config_set_property (GObject      *object,
 
 
 gint
-indicator_config_get_icon_size_max (IndicatorConfig *config)
+indicator_config_get_row_size_max (IndicatorConfig *config)
 {
-  g_return_val_if_fail (XFCE_IS_INDICATOR_CONFIG (config), DEFAULT_ICON_SIZE_MAX);
+  g_return_val_if_fail (XFCE_IS_INDICATOR_CONFIG (config), DEFAULT_ROW_SIZE_MAX);
 
-  return config->icon_size_max;
+  return config->row_size_max;
 }
 
 
@@ -757,8 +757,8 @@ indicator_config_new (const gchar     *property_base)
     {
       channel = xfconf_channel_get ("xfce4-panel");
 
-      property = g_strconcat (property_base, "/icon-size-max", NULL);
-      xfconf_g_property_bind (channel, property, G_TYPE_INT, config, "icon-size-max");
+      property = g_strconcat (property_base, "/row-size-max", NULL);
+      xfconf_g_property_bind (channel, property, G_TYPE_INT, config, "row-size-max");
       g_free (property);
 
       property = g_strconcat (property_base, "/align-left", NULL);
diff --git a/panel-plugin/indicator-config.h b/panel-plugin/indicator-config.h
index 8c820c2..8ce8e84 100644
--- a/panel-plugin/indicator-config.h
+++ b/panel-plugin/indicator-config.h
@@ -65,7 +65,7 @@ gint               indicator_config_get_nrows               (IndicatorConfig
 
 gint               indicator_config_get_panel_size          (IndicatorConfig      *config);
 
-gint               indicator_config_get_icon_size_max       (IndicatorConfig      *config);
+gint               indicator_config_get_row_size_max        (IndicatorConfig      *config);
 
 gboolean           indicator_config_get_align_left          (IndicatorConfig      *config);
 
diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index af1964b..e325975 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -478,9 +478,9 @@ indicator_dialog_build (IndicatorDialog *dialog)
 
       object = gtk_builder_get_object (builder, "size-max");
       g_return_if_fail (GTK_IS_WIDGET (object));
-      //exo_mutual_binding_new (G_OBJECT (dialog->config), "icon-size-max",
+      //exo_mutual_binding_new (G_OBJECT (dialog->config), "row-size-max",
       //                        G_OBJECT (object), "value");
-      g_object_bind_property (G_OBJECT (dialog->config), "icon-size-max",
+      g_object_bind_property (G_OBJECT (dialog->config), "row-size-max",
                               G_OBJECT (object), "value",
                               G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
 
diff --git a/panel-plugin/indicator-dialog.glade b/panel-plugin/indicator-dialog.glade
index a097eb1..2abe2cf 100644
--- a/panel-plugin/indicator-dialog.glade
+++ b/panel-plugin/indicator-dialog.glade
@@ -92,7 +92,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label" translatable="yes">_Maximum icon size (px):</property>
+                                <property name="label" translatable="yes">_Maximum row size (px):</property>
                                 <property name="use_underline">True</property>
                                 <property name="mnemonic_widget">size-max</property>
                               </object>
@@ -106,7 +106,7 @@
                               <object class="GtkSpinButton" id="size-max">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="tooltip_text" translatable="yes">Icons are scaled to fit a single row of the panel. Use this option to restrict the maximum size of the icon.</property>
+                                <property name="tooltip_text" translatable="yes">Icons are scaled to fit a single row of the panel. Use this option to restrict the maximum size of the row.</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
                                 <property name="primary_icon_sensitive">True</property>


More information about the Xfce4-commits mailing list