[gtkhtml/gtk3] Do not allocate space for GtkHTMLEmbedded when child is hidden
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkhtml/gtk3] Do not allocate space for GtkHTMLEmbedded when child is hidden
- Date: Wed, 26 Jan 2011 13:36:40 +0000 (UTC)
commit 5f55d7685c79a95ecfc039e7aeb0ebf814975b78
Author: Milan Crha <mcrha redhat com>
Date: Wed Jan 26 14:35:55 2011 +0100
Do not allocate space for GtkHTMLEmbedded when child is hidden
gtkhtml/gtkhtml-embedded.c | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/gtkhtml/gtkhtml-embedded.c b/gtkhtml/gtkhtml-embedded.c
index 78932b8..be5ec32 100644
--- a/gtkhtml/gtkhtml-embedded.c
+++ b/gtkhtml/gtkhtml-embedded.c
@@ -218,14 +218,10 @@ gtk_html_embedded_get_preferred_height (GtkWidget *widget, gint *minimum_height,
child = gtk_bin_get_child (GTK_BIN (widget));
- if (child) {
+ if (child && gtk_widget_get_visible (child))
gtk_widget_get_preferred_height (child, minimum_height, natural_height);
- } else {
- GtkRequisition self_requisition;
-
- gtk_widget_get_requisition (widget, &self_requisition);
- *minimum_height = *natural_height = self_requisition.height;
- }
+ else
+ *minimum_height = *natural_height = 0;
}
static void
@@ -237,14 +233,10 @@ gtk_html_embedded_get_preferred_width (GtkWidget *widget, gint *minimum_width, g
child = gtk_bin_get_child (GTK_BIN (widget));
- if (child) {
+ if (child && gtk_widget_get_visible (child))
gtk_widget_get_preferred_width (child, minimum_width, natural_width);
- } else {
- GtkRequisition self_requisition;
-
- gtk_widget_get_requisition (widget, &self_requisition);
- *minimum_width = *natural_width = self_requisition.width;
- }
+ else
+ *minimum_width = *natural_width = 0;
}
static void
@@ -257,9 +249,9 @@ gtk_html_embedded_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
child = gtk_bin_get_child (GTK_BIN (widget));
- if (child && gtk_widget_get_visible (child)) {
+ if (child && gtk_widget_get_visible (child))
gtk_widget_size_allocate (child, allocation);
- }
+
gtk_widget_set_allocation (widget, allocation);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]