[evolution/gnome-3-26] Bug 790291 - Disallow shrinking message list to zero width
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-26] Bug 790291 - Disallow shrinking message list to zero width
- Date: Tue, 21 Nov 2017 17:26:59 +0000 (UTC)
commit ecb1e980c686f26b3fa90890a7f7011fd894739e
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 21 18:23:55 2017 +0100
Bug 790291 - Disallow shrinking message list to zero width
src/mail/message-list.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/mail/message-list.c b/src/mail/message-list.c
index 9b3fd14..41a2ec1 100644
--- a/src/mail/message-list.c
+++ b/src/mail/message-list.c
@@ -2807,6 +2807,22 @@ ml_style_updated_cb (MessageList *message_list)
}
static void
+message_list_get_preferred_width (GtkWidget *widget,
+ gint *out_minimum_width,
+ gint *out_natural_width)
+{
+ /* Chain up to parent's method. */
+ GTK_WIDGET_CLASS (message_list_parent_class)->get_preferred_width (widget, out_minimum_width,
out_natural_width);
+
+ if (out_minimum_width && *out_minimum_width < 50)
+ *out_minimum_width = 50;
+
+ if (out_natural_width && out_minimum_width &&
+ *out_natural_width < *out_minimum_width)
+ *out_natural_width = *out_minimum_width;
+}
+
+static void
message_list_set_session (MessageList *message_list,
EMailSession *session)
{
@@ -3493,6 +3509,7 @@ static void
message_list_class_init (MessageListClass *class)
{
GObjectClass *object_class;
+ GtkWidgetClass *widget_class;
if (!ml_drag_info[0].atom) {
gint ii;
@@ -3512,6 +3529,9 @@ message_list_class_init (MessageListClass *class)
g_type_class_add_private (class, sizeof (MessageListPrivate));
+ widget_class = GTK_WIDGET_CLASS (class);
+ widget_class->get_preferred_width = message_list_get_preferred_width;
+
object_class = G_OBJECT_CLASS (class);
object_class->set_property = message_list_set_property;
object_class->get_property = message_list_get_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]