forked from AuroraMiddleware/gtk
demos: Replace size_request by get_preferred_width/height
This commit is contained in:
parent
f427d6998d
commit
4782804b9d
@ -39,8 +39,12 @@ void gtk_rotated_bin_set_angle (GtkRotatedBin *bin,
|
||||
|
||||
static void gtk_rotated_bin_realize (GtkWidget *widget);
|
||||
static void gtk_rotated_bin_unrealize (GtkWidget *widget);
|
||||
static void gtk_rotated_bin_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_rotated_bin_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_rotated_bin_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_rotated_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_rotated_bin_damage (GtkWidget *widget,
|
||||
@ -148,7 +152,8 @@ gtk_rotated_bin_class_init (GtkRotatedBinClass *klass)
|
||||
|
||||
widget_class->realize = gtk_rotated_bin_realize;
|
||||
widget_class->unrealize = gtk_rotated_bin_unrealize;
|
||||
widget_class->size_request = gtk_rotated_bin_size_request;
|
||||
widget_class->get_preferred_width = gtk_rotated_bin_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_rotated_bin_get_preferred_height;
|
||||
widget_class->size_allocate = gtk_rotated_bin_size_allocate;
|
||||
widget_class->draw = gtk_rotated_bin_draw;
|
||||
|
||||
@ -404,6 +409,30 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
|
||||
requisition->height = border_width * 2 + h;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
gtk_rotated_bin_size_request (widget, &requisition);
|
||||
|
||||
*minimum = *natural = requisition.width;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
gtk_rotated_bin_size_request (widget, &requisition);
|
||||
|
||||
*minimum = *natural = requisition.height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
|
@ -35,8 +35,12 @@ GtkWidget* gtk_mirror_bin_new (void);
|
||||
|
||||
static void gtk_mirror_bin_realize (GtkWidget *widget);
|
||||
static void gtk_mirror_bin_unrealize (GtkWidget *widget);
|
||||
static void gtk_mirror_bin_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_mirror_bin_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_mirror_bin_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_mirror_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_mirror_bin_damage (GtkWidget *widget,
|
||||
@ -86,7 +90,8 @@ gtk_mirror_bin_class_init (GtkMirrorBinClass *klass)
|
||||
|
||||
widget_class->realize = gtk_mirror_bin_realize;
|
||||
widget_class->unrealize = gtk_mirror_bin_unrealize;
|
||||
widget_class->size_request = gtk_mirror_bin_size_request;
|
||||
widget_class->get_preferred_width = gtk_mirror_bin_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_mirror_bin_get_preferred_height;
|
||||
widget_class->size_allocate = gtk_mirror_bin_size_allocate;
|
||||
widget_class->draw = gtk_mirror_bin_draw;
|
||||
|
||||
@ -323,6 +328,30 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
|
||||
requisition->height = border_width * 2 + child_requisition.height * 2 + 10;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
gtk_mirror_bin_size_request (widget, &requisition);
|
||||
|
||||
*minimum = *natural = requisition.width;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
gtk_mirror_bin_size_request (widget, &requisition);
|
||||
|
||||
*minimum = *natural = requisition.width;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
|
Loading…
Reference in New Issue
Block a user