|
|
cec674 |
From 3c9e3e1850f0690a02f351c4d8fac23bc5234cde Mon Sep 17 00:00:00 2001
|
|
|
cec674 |
From: Benjamin Otte <otte@redhat.com>
|
|
|
cec674 |
Date: Wed, 27 Nov 2013 19:04:14 +0100
|
|
|
cec674 |
Subject: [PATCH] fail-whale-dialog: Implement hfw size requests
|
|
|
cec674 |
|
|
|
cec674 |
In case of the failure dialog, height-for-width size requests should
|
|
|
cec674 |
not behave differently from regular size requests, so implement
|
|
|
cec674 |
those methods to avoid falling back to GtkBin's implementation,
|
|
|
cec674 |
which results in a mispositioned dialog.
|
|
|
cec674 |
---
|
|
|
cec674 |
gnome-session/gsm-fail-whale-dialog.c | 28 ++++++++++++++++++++++++++++
|
|
|
cec674 |
1 file changed, 28 insertions(+)
|
|
|
cec674 |
|
|
|
cec674 |
diff --git a/gnome-session/gsm-fail-whale-dialog.c b/gnome-session/gsm-fail-whale-dialog.c
|
|
|
cec674 |
index f35be6a..0703f24 100644
|
|
|
cec674 |
--- a/gnome-session/gsm-fail-whale-dialog.c
|
|
|
cec674 |
+++ b/gnome-session/gsm-fail-whale-dialog.c
|
|
|
cec674 |
@@ -195,6 +195,19 @@ gsm_fail_whale_dialog_get_preferred_width (GtkWidget *widget,
|
|
|
cec674 |
}
|
|
|
cec674 |
|
|
|
cec674 |
static void
|
|
|
cec674 |
+gsm_fail_whale_dialog_get_preferred_width_for_height (GtkWidget *widget,
|
|
|
cec674 |
+ gint for_height,
|
|
|
cec674 |
+ gint *minimal_width,
|
|
|
cec674 |
+ gint *natural_width)
|
|
|
cec674 |
+{
|
|
|
cec674 |
+ GtkRequisition requisition;
|
|
|
cec674 |
+
|
|
|
cec674 |
+ gsm_fail_whale_dialog_size_request (widget, &requisition);
|
|
|
cec674 |
+
|
|
|
cec674 |
+ *minimal_width = *natural_width = requisition.width;
|
|
|
cec674 |
+}
|
|
|
cec674 |
+
|
|
|
cec674 |
+static void
|
|
|
cec674 |
gsm_fail_whale_dialog_get_preferred_height (GtkWidget *widget,
|
|
|
cec674 |
gint *minimal_height,
|
|
|
cec674 |
gint *natural_height)
|
|
|
cec674 |
@@ -207,6 +220,19 @@ gsm_fail_whale_dialog_get_preferred_height (GtkWidget *widget,
|
|
|
cec674 |
}
|
|
|
cec674 |
|
|
|
cec674 |
static void
|
|
|
cec674 |
+gsm_fail_whale_dialog_get_preferred_height_for_width (GtkWidget *widget,
|
|
|
cec674 |
+ gint for_width,
|
|
|
cec674 |
+ gint *minimal_height,
|
|
|
cec674 |
+ gint *natural_height)
|
|
|
cec674 |
+{
|
|
|
cec674 |
+ GtkRequisition requisition;
|
|
|
cec674 |
+
|
|
|
cec674 |
+ gsm_fail_whale_dialog_size_request (widget, &requisition);
|
|
|
cec674 |
+
|
|
|
cec674 |
+ *minimal_height = *natural_height = requisition.height;
|
|
|
cec674 |
+}
|
|
|
cec674 |
+
|
|
|
cec674 |
+static void
|
|
|
cec674 |
gsm_fail_whale_dialog_class_init (GsmFailWhaleDialogClass *klass)
|
|
|
cec674 |
{
|
|
|
cec674 |
GtkWidgetClass *widget_class;
|
|
|
cec674 |
@@ -217,6 +243,8 @@ gsm_fail_whale_dialog_class_init (GsmFailWhaleDialogClass *klass)
|
|
|
cec674 |
widget_class->unrealize = gsm_fail_whale_dialog_unrealize;
|
|
|
cec674 |
widget_class->get_preferred_width = gsm_fail_whale_dialog_get_preferred_width;
|
|
|
cec674 |
widget_class->get_preferred_height = gsm_fail_whale_dialog_get_preferred_height;
|
|
|
cec674 |
+ widget_class->get_preferred_width_for_height = gsm_fail_whale_dialog_get_preferred_width_for_height;
|
|
|
cec674 |
+ widget_class->get_preferred_height_for_width = gsm_fail_whale_dialog_get_preferred_height_for_width;
|
|
|
cec674 |
|
|
|
cec674 |
g_type_class_add_private (klass, sizeof (GsmFailWhaleDialogPrivate));
|
|
|
cec674 |
}
|
|
|
cec674 |
--
|
|
|
cec674 |
1.8.4.2
|
|
|
cec674 |
|