[Xfce4-commits] <xfce4-panel:devel> Review PanelItembar.
Nick Schermer
noreply at xfce.org
Wed Jan 20 21:08:14 CET 2010
Updating branch refs/heads/devel
to f9a64888d84a32b3aa5e4a462994c51de58deb62 (commit)
from 089c8fe16772708dec1ca579d380b27b7d16d8ad (commit)
commit f9a64888d84a32b3aa5e4a462994c51de58deb62
Author: Nick Schermer <nick at xfce.org>
Date: Wed Jan 20 18:49:02 2010 +0100
Review PanelItembar.
panel/panel-itembar.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c
index 50903c2..358b00a 100644
--- a/panel/panel-itembar.c
+++ b/panel/panel-itembar.c
@@ -165,25 +165,29 @@ panel_itembar_class_init (PanelItembarClass *klass)
g_object_class_install_property (gobject_class,
PROP_HORIZONTAL,
- g_param_spec_boolean ("horizontal", NULL, NULL,
+ g_param_spec_boolean ("horizontal",
+ NULL, NULL,
TRUE,
EXO_PARAM_WRITABLE));
g_object_class_install_property (gobject_class,
PROP_SIZE,
- g_param_spec_uint ("size", NULL, NULL,
+ g_param_spec_uint ("size",
+ NULL, NULL,
16, 128, 48,
EXO_PARAM_WRITABLE));
gtk_container_class_install_child_property (gtkcontainer_class,
CHILD_PROP_EXPAND,
- g_param_spec_boolean ("expand", NULL, NULL,
+ g_param_spec_boolean ("expand",
+ NULL, NULL,
FALSE,
EXO_PARAM_READWRITE));
gtk_container_class_install_child_property (gtkcontainer_class,
CHILD_PROP_WRAP,
- g_param_spec_boolean ("wrap", NULL, NULL,
+ g_param_spec_boolean ("wrap",
+ NULL, NULL,
FALSE,
EXO_PARAM_READWRITE));
}
@@ -193,16 +197,13 @@ panel_itembar_class_init (PanelItembarClass *klass)
static void
panel_itembar_init (PanelItembar *itembar)
{
- /* initialize */
itembar->children = NULL;
itembar->horizontal = TRUE;
itembar->size = 30;
itembar->highlight_index = -1;
- /* setup */
GTK_WIDGET_SET_FLAGS (GTK_WIDGET (itembar), GTK_NO_WINDOW);
- /* don't redraw on allocation */
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (itembar), FALSE);
}
@@ -306,6 +307,7 @@ panel_itembar_size_request (GtkWidget *widget,
}
else
{
+ /* add to size for new wrap element */
if (itembar->horizontal)
{
requisition->height += itembar->size;
@@ -328,7 +330,7 @@ panel_itembar_size_request (GtkWidget *widget,
}
}
- /* use the last row length */
+ /* also take the last row_length into account */
if (itembar->horizontal)
requisition->width = MAX (requisition->width, row_length);
else
@@ -361,7 +363,6 @@ panel_itembar_size_allocate (GtkWidget *widget,
gint x, y;
gboolean expand_children_fit;
- /* set widget allocation */
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
@@ -371,7 +372,7 @@ panel_itembar_size_allocate (GtkWidget *widget,
else
expand_length = allocation->height - 2 * border_width;
- /* traverse the children to handle the wrap items */
+ /* loop for wrap items */
for (row = 0, li = itembar->children; li != NULL; li = g_slist_next (li), row++)
{
expand_length_avail = expand_length;
@@ -387,7 +388,7 @@ panel_itembar_size_allocate (GtkWidget *widget,
if (!GTK_WIDGET_VISIBLE (child->widget))
continue;
- /* continue allocating if we hit a wrap child */
+ /* continue allocating until we hit a wrap child */
if (G_UNLIKELY (child->wrap))
break;
@@ -694,7 +695,7 @@ panel_itembar_get_child_property (GtkContainer *container,
-static PanelItembarChild *
+static inline PanelItembarChild *
panel_itembar_get_child (PanelItembar *itembar,
GtkWidget *widget)
{
More information about the Xfce4-commits
mailing list