[gedit/wip/revamp-close-confirm-dialog] CloseConfirmationDialog: make the content expandable
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/revamp-close-confirm-dialog] CloseConfirmationDialog: make the content expandable
- Date: Sat, 28 Nov 2015 14:11:27 +0000 (UTC)
commit 18891be9b76655266883eb9298d3112e1a149e0b
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Nov 28 14:24:38 2015 +0100
CloseConfirmationDialog: make the content expandable
It's a hack, it pokes at GtkMessageDialog internals... The purpose is to
demonstrate that it is possible without a GTK+ change.
gedit/gedit-close-confirmation-dialog.c | 46 +++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-close-confirmation-dialog.c b/gedit/gedit-close-confirmation-dialog.c
index bf6cc0e..71d34af 100644
--- a/gedit/gedit-close-confirmation-dialog.c
+++ b/gedit/gedit-close-confirmation-dialog.c
@@ -479,6 +479,51 @@ create_list_box (GeditCloseConfirmationDialog *dlg)
}
static void
+make_content_expandable (GeditCloseConfirmationDialog *dlg)
+{
+ GtkWidget *content_area;
+ GtkWidget *widget;
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
+
+ widget = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dlg));
+
+ while (widget != NULL && widget != content_area)
+ {
+ GtkWidget *parent;
+
+ parent = gtk_widget_get_parent (widget);
+
+ if (GTK_IS_BOX (parent))
+ {
+ gboolean expand;
+ gboolean fill;
+ guint padding;
+ GtkPackType pack_type;
+
+ gtk_box_query_child_packing (GTK_BOX (parent),
+ widget,
+ &expand,
+ &fill,
+ &padding,
+ &pack_type);
+
+ expand = TRUE;
+ fill = TRUE;
+
+ gtk_box_set_child_packing (GTK_BOX (parent),
+ widget,
+ expand,
+ fill,
+ padding,
+ pack_type);
+ }
+
+ widget = parent;
+ }
+}
+
+static void
build_multiple_docs_dialog (GeditCloseConfirmationDialog *dlg)
{
GtkWidget *message_area;
@@ -492,6 +537,7 @@ build_multiple_docs_dialog (GeditCloseConfirmationDialog *dlg)
add_buttons (dlg);
gtk_window_set_resizable (GTK_WINDOW (dlg), TRUE);
+ make_content_expandable (dlg);
/* Primary message */
if (dlg->disable_save_to_disk)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]