[gtk+] Make GtkCheckButton allocate all remaining space to it's child instead of limiting it to it's minimu
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make GtkCheckButton allocate all remaining space to it's child instead of limiting it to it's minimu
- Date: Wed, 29 Dec 2010 07:52:08 +0000 (UTC)
commit f519da41cfee2caadb660f37d73e308c5ef33dd0
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Wed Dec 29 16:19:48 2010 +0900
Make GtkCheckButton allocate all remaining space to it's child instead
of limiting it to it's minimum size.
This fixes height-for-width labels inside a GtkCheckButton, for some
reason GtkCheckButton was limiting the child allocation to the child's
minimum request, probably for the sake of virtual left-alignment of
the child label to be beside the checkmark. This should be done by
other means if nescesarry.
gtk/gtkcheckbutton.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index 91b92f0..11e7c18 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -334,16 +334,11 @@ gtk_check_button_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- gtk_widget_get_preferred_size (child, &child_requisition, NULL);
-
- child_allocation.width = MIN (child_requisition.width,
- allocation->width -
- ((border_width + focus_width + focus_pad) * 2
- + indicator_size + indicator_spacing * 3));
+ child_allocation.width = allocation->width -
+ ((border_width + focus_width + focus_pad) * 2 + indicator_size + indicator_spacing * 3);
child_allocation.width = MAX (child_allocation.width, 1);
- child_allocation.height = MIN (child_requisition.height,
- allocation->height - (border_width + focus_width + focus_pad) * 2);
+ child_allocation.height = allocation->height - (border_width + focus_width + focus_pad) * 2;
child_allocation.height = MAX (child_allocation.height, 1);
child_allocation.x = (border_width + indicator_size + indicator_spacing * 3 +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]