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.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
dfbaef6b88
commit
5d4beaecb5
@ -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>
|
2006-05-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkprinter.c (gtk_printer_class_init):
|
* gtk/gtkprinter.c (gtk_printer_class_init):
|
||||||
|
|||||||
@ -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>
|
2006-05-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkprinter.c (gtk_printer_class_init):
|
* gtk/gtkprinter.c (gtk_printer_class_init):
|
||||||
|
|||||||
@ -595,8 +595,8 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
|
|||||||
|
|
||||||
gtk_widget_class_install_style_property (widget_class,
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
g_param_spec_int ("max-child-expand",
|
g_param_spec_int ("max-child-expand",
|
||||||
P_("Maximum toolbar item spacing"),
|
P_("Maximum child expand"),
|
||||||
P_("Maximum space between the toolbar items."),
|
P_("Maximum amount of space an expandable item will be given"),
|
||||||
0,
|
0,
|
||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
@ -1591,7 +1591,9 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
|
|||||||
*/
|
*/
|
||||||
if (!overflowing)
|
if (!overflowing)
|
||||||
{
|
{
|
||||||
|
gint max_child_expand;
|
||||||
n_expand_items = 0;
|
n_expand_items = 0;
|
||||||
|
|
||||||
for (i = 0, list = priv->content; list != NULL; list = list->next, ++i)
|
for (i = 0, list = priv->content; list != NULL; list = list->next, ++i)
|
||||||
{
|
{
|
||||||
ToolbarContent *content = list->data;
|
ToolbarContent *content = list->data;
|
||||||
@ -1600,19 +1602,19 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
|
|||||||
n_expand_items++;
|
n_expand_items++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
max_child_expand = get_max_child_expand (toolbar);
|
||||||
for (list = priv->content, i = 0; list != NULL; list = list->next, ++i)
|
for (list = priv->content, i = 0; list != NULL; list = list->next, ++i)
|
||||||
{
|
{
|
||||||
ToolbarContent *content = list->data;
|
ToolbarContent *content = list->data;
|
||||||
|
|
||||||
if (toolbar_content_get_expand (content) && new_states[i] == NORMAL)
|
if (toolbar_content_get_expand (content) && new_states[i] == NORMAL)
|
||||||
{
|
{
|
||||||
gint mexpand = get_max_child_expand (toolbar);
|
|
||||||
gint extra = size / n_expand_items;
|
gint extra = size / n_expand_items;
|
||||||
if (size % n_expand_items != 0)
|
if (size % n_expand_items != 0)
|
||||||
extra++;
|
extra++;
|
||||||
|
|
||||||
if (extra > mexpand)
|
if (extra > max_child_expand)
|
||||||
extra = mexpand;
|
extra = max_child_expand;
|
||||||
|
|
||||||
allocations[i].width += extra;
|
allocations[i].width += extra;
|
||||||
size -= extra;
|
size -= extra;
|
||||||
|
|||||||
Reference in New Issue
Block a user