From c15db7a2ee02799c2ca08c617bdad26f063a8d1e Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 30 Nov 2011 12:03:58 +0100 Subject: [PATCH] Aggiustamento all'espansione del pannello allegati in SolipaMailUI. --- .cproject | 45 ++++++++++++++------------------- data/libsolipa/gui/libsolipa.ui | 8 +++--- src/mailui.c | 42 ++++++++++++++++++++++++++++-- 3 files changed, 64 insertions(+), 31 deletions(-) diff --git a/.cproject b/.cproject index 62d84c1..6f6b7fc 100644 --- a/.cproject +++ b/.cproject @@ -3,8 +3,8 @@ - - + + @@ -14,35 +14,31 @@ - - - - - - - + + + + + + + - - - - @@ -50,13 +46,10 @@ - - - - - + + diff --git a/data/libsolipa/gui/libsolipa.ui b/data/libsolipa/gui/libsolipa.ui index d068fe6..13f5561 100644 --- a/data/libsolipa/gui/libsolipa.ui +++ b/data/libsolipa/gui/libsolipa.ui @@ -701,6 +701,7 @@ True False 5 + start gtk-add @@ -753,6 +754,7 @@ 2 7 8 + GTK_FILL @@ -804,6 +806,9 @@ 2 5 5 + + + True @@ -997,9 +1002,6 @@ GTK_FILL - - - diff --git a/src/mailui.c b/src/mailui.c index c56a780..94e1417 100644 --- a/src/mailui.c +++ b/src/mailui.c @@ -63,8 +63,12 @@ static void solipa_mail_ui_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void solipa_mail_ui_on_iv_attachment_selection_changed (GtkIconView *iconview, - gpointer user_data); +static void solipa_mail_ui_on_exp_attachments_expanded (GObject *object, + GParamSpec *param_spec, + gpointer user_data); + +static void solipa_mail_ui_on_iv_attachment_selection_changed (GtkIconView *iconview, + gpointer user_data); static void solipa_mail_ui_on_btn_attachment_add_clicked (GtkButton *button, gpointer user_data); @@ -326,6 +330,9 @@ SolipaMailUI priv->iv_attachments = GTK_WIDGET (gtk_builder_get_object (builder, "iconview1")); priv->btn_attachment_remove = GTK_WIDGET (gtk_builder_get_object (builder, "button10")); + g_signal_connect (gtk_builder_get_object (builder, "expander1"), "notify::expanded", + G_CALLBACK (solipa_mail_ui_on_exp_attachments_expanded), (gpointer)solipa_mail_ui); + gtk_icon_view_set_text_column (GTK_ICON_VIEW (priv->iv_attachments), COL_ATTACHMENTS_FILE_NAME_BASE); gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (priv->iv_attachments), COL_ATTACHMENTS_ICON); @@ -746,6 +753,37 @@ solipa_mail_ui_get_property (GObject *object, } /* CALLBACK */ +static void +solipa_mail_ui_on_exp_attachments_expanded (GObject *object, + GParamSpec *param_spec, + gpointer user_data) +{ + GtkExpander *expander; + GtkBuilder *builder; + GValue *gval; + + SolipaMailUIPrivate *priv = SOLIPA_MAIL_UI_GET_PRIVATE ((SolipaMailUI *)user_data); + + builder = solipa_get_gtkbuilder (priv->solipa); + + expander = GTK_EXPANDER (object); + + gval = (GValue *)g_new0 (GValue, 1); + g_value_init (gval, G_TYPE_INT); + if (gtk_expander_get_expanded (expander)) + { + g_value_set_int (gval, GTK_EXPAND | GTK_FILL); + } + else + { + g_value_set_int (gval, GTK_FILL); + } + gtk_container_child_set_property (GTK_CONTAINER (gtk_builder_get_object (builder, "table2")), + GTK_WIDGET (object), + "y-options", gval); + g_value_unset (gval); +} + static void solipa_mail_ui_on_iv_attachment_selection_changed (GtkIconView *iconview, gpointer user_data) -- 2.49.0