summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2006-05-16 16:51:27 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2006-05-16 16:51:27 +0000
commit5d4beaecb5851bbee2a73b381ab6f4be446d459a (patch)
treeb85121fabe84a099af2a73e6b693817c985befca
parentdfbaef6b880eb1aeb46685fd288ca42f68b35417 (diff)
downloadgtk+-5d4beaecb5851bbee2a73b381ab6f4be446d459a.tar.gz
Move getting the property out of the loop, and rename the variable
Tue May 16 12:36:25 2006 Søren Sandmann <sandmann@redhat.com> * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the property out of the loop, and rename the variable 'max_expand'. * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription for the max-child-expand property.
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.pre-2-108
-rw-r--r--gtk/gtktoolbar.c12
3 files changed, 23 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e37e15003..9724726fa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue May 16 12:36:25 2006 Søren Sandmann <sandmann@redhat.com>
+
+ * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the
+ property out of the loop, and rename the variable 'max_expand'.
+
+ * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription
+ for the max-child-expand property.
+
2006-05-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprinter.c (gtk_printer_class_init):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 4e37e15003..9724726fa9 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,11 @@
+Tue May 16 12:36:25 2006 Søren Sandmann <sandmann@redhat.com>
+
+ * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the
+ property out of the loop, and rename the variable 'max_expand'.
+
+ * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription
+ for the max-child-expand property.
+
2006-05-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprinter.c (gtk_printer_class_init):
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 7f384d9828..6606617611 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -595,8 +595,8 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("max-child-expand",
- P_("Maximum toolbar item spacing"),
- P_("Maximum space between the toolbar items."),
+ P_("Maximum child expand"),
+ P_("Maximum amount of space an expandable item will be given"),
0,
G_MAXINT,
G_MAXINT,
@@ -1591,7 +1591,9 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
*/
if (!overflowing)
{
+ gint max_child_expand;
n_expand_items = 0;
+
for (i = 0, list = priv->content; list != NULL; list = list->next, ++i)
{
ToolbarContent *content = list->data;
@@ -1600,19 +1602,19 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
n_expand_items++;
}
+ max_child_expand = get_max_child_expand (toolbar);
for (list = priv->content, i = 0; list != NULL; list = list->next, ++i)
{
ToolbarContent *content = list->data;
if (toolbar_content_get_expand (content) && new_states[i] == NORMAL)
{
- gint mexpand = get_max_child_expand (toolbar);
gint extra = size / n_expand_items;
if (size % n_expand_items != 0)
extra++;
- if (extra > mexpand)
- extra = mexpand;
+ if (extra > max_child_expand)
+ extra = max_child_expand;
allocations[i].width += extra;
size -= extra;