From c5e2714e23c9d314a57b3e5769286f9014fb8d82 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Fri, 28 Sep 2007 09:45:33 +0000 Subject: [PATCH] * The main paned position follows now the 30/70 rule if it was not set previously pmo-trunk-r3436 --- src/modest-init.c | 7 ++++--- src/modest-widget-memory.c | 14 ++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/modest-init.c b/src/modest-init.c index d0cc3e2..f313ed7 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -76,7 +76,7 @@ typedef struct { } FolderCols; -static const guint MODEST_MAIN_PANED_POS = 280; +static const guint MODEST_MAIN_PANED_POS_PERCENTAGE = 30; static const FolderCols INBOX_COLUMNS_DETAILS[] = { {MODEST_HEADER_VIEW_COLUMN_MSGTYPE, 40, 0}, @@ -394,11 +394,12 @@ init_header_columns (ModestConf *conf, gboolean overwrite) }; } - key = _modest_widget_memory_get_keyname (MODEST_CONF_MAIN_PANED_KEY, MODEST_WIDGET_MEMORY_PARAM_POS); + key = _modest_widget_memory_get_keyname (MODEST_CONF_MAIN_PANED_KEY, + MODEST_WIDGET_MEMORY_PARAM_POS); /* if we're not in overwrite mode, only write stuff it * there was nothing before */ if (overwrite || !modest_conf_key_exists(conf, key, NULL)) - modest_conf_set_int (conf, key, MODEST_MAIN_PANED_POS, NULL); + modest_conf_set_int (conf, key, MODEST_MAIN_PANED_POS_PERCENTAGE, NULL); g_free (key); return TRUE; diff --git a/src/modest-widget-memory.c b/src/modest-widget-memory.c index d376371..b480fd2 100644 --- a/src/modest-widget-memory.c +++ b/src/modest-widget-memory.c @@ -242,17 +242,11 @@ restore_settings_paned (ModestConf *conf, GtkPaned *paned, const gchar *name) gchar *key; int percent, pos; - key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_POS); + key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_POS); + percent = modest_conf_get_int (conf, key, NULL); - if (modest_conf_key_exists (conf, key, NULL)) { - percent = modest_conf_get_int (conf, key, NULL); - - pos = GTK_WIDGET (paned)->allocation.width * percent /100; - gtk_paned_set_position (paned, pos); - } else { - /* The initial position must follow the 30/70 rule */ - gtk_paned_set_position (paned, GTK_WIDGET(paned)->requisition.width/3); - } + pos = GTK_WIDGET (paned)->allocation.width * percent /100; + gtk_paned_set_position (paned, pos); g_free (key); return TRUE; -- 1.7.9.5