Remove size_request from GtkSeparatorToolItem
This commit is contained in:
@ -66,8 +66,12 @@ static void gtk_separator_tool_item_get_property (GObject
|
|||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gtk_separator_tool_item_size_request (GtkWidget *widget,
|
static void gtk_separator_tool_item_get_preferred_width (GtkWidget *widget,
|
||||||
GtkRequisition *requisition);
|
gint *minimum,
|
||||||
|
gint *natural);
|
||||||
|
static void gtk_separator_tool_item_get_preferred_height (GtkWidget *widget,
|
||||||
|
gint *minimum,
|
||||||
|
gint *natural);
|
||||||
static void gtk_separator_tool_item_size_allocate (GtkWidget *widget,
|
static void gtk_separator_tool_item_size_allocate (GtkWidget *widget,
|
||||||
GtkAllocation *allocation);
|
GtkAllocation *allocation);
|
||||||
static gboolean gtk_separator_tool_item_draw (GtkWidget *widget,
|
static gboolean gtk_separator_tool_item_draw (GtkWidget *widget,
|
||||||
@ -118,7 +122,8 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
|
|||||||
|
|
||||||
object_class->set_property = gtk_separator_tool_item_set_property;
|
object_class->set_property = gtk_separator_tool_item_set_property;
|
||||||
object_class->get_property = gtk_separator_tool_item_get_property;
|
object_class->get_property = gtk_separator_tool_item_get_property;
|
||||||
widget_class->size_request = gtk_separator_tool_item_size_request;
|
widget_class->get_preferred_width = gtk_separator_tool_item_get_preferred_width;
|
||||||
|
widget_class->get_preferred_height = gtk_separator_tool_item_get_preferred_height;
|
||||||
widget_class->size_allocate = gtk_separator_tool_item_size_allocate;
|
widget_class->size_allocate = gtk_separator_tool_item_size_allocate;
|
||||||
widget_class->draw = gtk_separator_tool_item_draw;
|
widget_class->draw = gtk_separator_tool_item_draw;
|
||||||
widget_class->realize = gtk_separator_tool_item_realize;
|
widget_class->realize = gtk_separator_tool_item_realize;
|
||||||
@ -213,22 +218,37 @@ gtk_separator_tool_item_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_separator_tool_item_size_request (GtkWidget *widget,
|
gtk_separator_tool_item_get_preferred_size (GtkWidget *widget,
|
||||||
GtkRequisition *requisition)
|
GtkOrientation orientation,
|
||||||
|
gint *minimum,
|
||||||
|
gint *natural)
|
||||||
{
|
{
|
||||||
GtkToolItem *item = GTK_TOOL_ITEM (widget);
|
if (gtk_tool_item_get_orientation (GTK_TOOL_ITEM (widget)) == orientation)
|
||||||
GtkOrientation orientation = gtk_tool_item_get_orientation (item);
|
*minimum = *natural = get_space_size (GTK_TOOL_ITEM (widget));
|
||||||
|
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
||||||
{
|
|
||||||
requisition->width = get_space_size (item);
|
|
||||||
requisition->height = 1;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
*minimum = *natural = 1;
|
||||||
requisition->height = get_space_size (item);
|
}
|
||||||
requisition->width = 1;
|
|
||||||
}
|
static void
|
||||||
|
gtk_separator_tool_item_get_preferred_width (GtkWidget *widget,
|
||||||
|
gint *minimum,
|
||||||
|
gint *natural)
|
||||||
|
{
|
||||||
|
gtk_separator_tool_item_get_preferred_size (widget,
|
||||||
|
GTK_ORIENTATION_HORIZONTAL,
|
||||||
|
minimum,
|
||||||
|
natural);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_separator_tool_item_get_preferred_height (GtkWidget *widget,
|
||||||
|
gint *minimum,
|
||||||
|
gint *natural)
|
||||||
|
{
|
||||||
|
gtk_separator_tool_item_get_preferred_size (widget,
|
||||||
|
GTK_ORIENTATION_VERTICAL,
|
||||||
|
minimum,
|
||||||
|
natural);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user