* The main paned position follows now the 30/70 rule if it was not set previously
authorSergio Villar Senin <svillar@igalia.com>
Fri, 28 Sep 2007 09:45:33 +0000 (09:45 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 28 Sep 2007 09:45:33 +0000 (09:45 +0000)
pmo-trunk-r3436

src/modest-init.c
src/modest-widget-memory.c

index d0cc3e2..f313ed7 100644 (file)
@@ -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;
index d376371..b480fd2 100644 (file)
@@ -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;