Fix warning about uninitialized variable plus spacing and indentation cleanup
This commit is contained in:
@ -49,10 +49,10 @@ static void gtk_button_box_get_property (GObject *object,
|
|||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gtk_button_box_size_request (GtkWidget *widget,
|
static void gtk_button_box_size_request (GtkWidget *widget,
|
||||||
GtkRequisition *requisition);
|
GtkRequisition *requisition);
|
||||||
static void gtk_button_box_size_allocate (GtkWidget *widget,
|
static void gtk_button_box_size_allocate (GtkWidget *widget,
|
||||||
GtkAllocation *allocation);
|
GtkAllocation *allocation);
|
||||||
static void gtk_button_box_set_child_property (GtkContainer *container,
|
static void gtk_button_box_set_child_property (GtkContainer *container,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
@ -558,14 +558,10 @@ gtk_button_box_size_request (GtkWidget *widget,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
{
|
requisition->height = child_height;
|
||||||
requisition->height = child_height;
|
else
|
||||||
}
|
requisition->width = child_width;
|
||||||
else
|
|
||||||
{
|
|
||||||
requisition->width = child_width;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
requisition->width += GTK_CONTAINER (box)->border_width * 2;
|
requisition->width += GTK_CONTAINER (box)->border_width * 2;
|
||||||
@ -589,8 +585,8 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
gint y = 0;
|
gint y = 0;
|
||||||
gint secondary_x = 0;
|
gint secondary_x = 0;
|
||||||
gint secondary_y = 0;
|
gint secondary_y = 0;
|
||||||
gint width;
|
gint width = 0;
|
||||||
gint height;
|
gint height = 0;
|
||||||
gint childspace;
|
gint childspace;
|
||||||
gint childspacing = 0;
|
gint childspacing = 0;
|
||||||
GtkButtonBoxStyle layout;
|
GtkButtonBoxStyle layout;
|
||||||
@ -645,20 +641,20 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
{
|
{
|
||||||
if (nvis_children >= 2)
|
if (nvis_children >= 2)
|
||||||
{
|
{
|
||||||
childspacing = (width - (nvis_children * child_width))
|
childspacing = (width - (nvis_children * child_width))
|
||||||
/ (nvis_children - 1);
|
/ (nvis_children - 1);
|
||||||
x = allocation->x + GTK_CONTAINER (box)->border_width;
|
x = allocation->x + GTK_CONTAINER (box)->border_width;
|
||||||
secondary_x = x + ((nvis_children - n_secondaries)
|
secondary_x = x + ((nvis_children - n_secondaries)
|
||||||
* (child_width + childspacing));
|
* (child_width + childspacing));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* one or zero children, just center */
|
/* one or zero children, just center */
|
||||||
childspacing = width;
|
childspacing = width;
|
||||||
x = secondary_x = allocation->x
|
x = secondary_x = allocation->x
|
||||||
+ (allocation->width - child_width) / 2;
|
+ (allocation->width - child_width) / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -735,8 +731,8 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
x = allocation->x +
|
x = allocation->x +
|
||||||
(allocation->width
|
(allocation->width
|
||||||
- (child_width * (nvis_children - n_secondaries)
|
- (child_width * (nvis_children - n_secondaries)
|
||||||
+ spacing * (nvis_children - n_secondaries - 1)))/2
|
+ spacing * (nvis_children - n_secondaries - 1))) / 2
|
||||||
+ (n_secondaries * child_width + n_secondaries * spacing)/2;
|
+ (n_secondaries * child_width + n_secondaries * spacing) / 2;
|
||||||
secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
|
secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -745,15 +741,15 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
y = allocation->y +
|
y = allocation->y +
|
||||||
(allocation->height
|
(allocation->height
|
||||||
- (child_height * (nvis_children - n_secondaries)
|
- (child_height * (nvis_children - n_secondaries)
|
||||||
+ spacing * (nvis_children - n_secondaries - 1)))/2
|
+ spacing * (nvis_children - n_secondaries - 1))) / 2
|
||||||
+ (n_secondaries * child_height + n_secondaries * spacing)/2;
|
+ (n_secondaries * child_height + n_secondaries * spacing) / 2;
|
||||||
secondary_y = allocation->y + GTK_CONTAINER (box)->border_width;
|
secondary_y = allocation->y + GTK_CONTAINER (box)->border_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached();
|
g_assert_not_reached ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user