Commit 115b4152 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

use better default values for window size, thumb size, list order

parent 49df6996
......@@ -234,7 +234,7 @@
<applyto>/apps/gthumb/browser/sort_type</applyto>
<owner>gthumb</owner>
<type>string</type>
<default>name</default>
<default>file::mtime</default>
<locale name="C">
<short></short>
<long></long>
......@@ -380,7 +380,7 @@
<applyto>/apps/gthumb/ui/window_width</applyto>
<owner>gthumb</owner>
<type>int</type>
<default>690</default>
<default>0</default>
<locale name="C">
<short></short>
<long>
......@@ -393,7 +393,7 @@
<applyto>/apps/gthumb/ui/window_height</applyto>
<owner>gthumb</owner>
<type>int</type>
<default>460</default>
<default>0</default>
<locale name="C">
<short></short>
<long>
......
......@@ -28,11 +28,11 @@
</schema>
<schema>
<key>/schemas/apps/gthumb/ext/photo_importer/subfolder_format</key>
<applyto>/apps/gthumb/ext/photo_importer/subfolder_format</applyto>
<key>/schemas/apps/gthumb/ext/photo_importer/subfolder_single</key>
<applyto>/apps/gthumb/ext/photo_importer/subfolder_single</applyto>
<owner>gthumb</owner>
<type>string</type>
<default></default>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short></short>
<long>
......
......@@ -719,7 +719,7 @@ dlg_photo_importer (GthBrowser *browser,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("delete_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_DELETE, FALSE));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("adjust_orientation_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_ADJUST_ORIENTATION, TRUE));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("single_subfolder_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_SUBFOLDER_SINGLE, FALSE));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("single_subfolder_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_SUBFOLDER_SINGLE, TRUE));
gtk_combo_box_set_active (GTK_COMBO_BOX (data->subfolder_type_list), eel_gconf_get_enum (PREF_PHOTO_IMPORT_SUBFOLDER_TYPE, GTH_TYPE_SUBFOLDER_TYPE, GTH_SUBFOLDER_TYPE_FILE_DATE));
update_destination (data);
......
......@@ -3077,9 +3077,40 @@ _gth_browser_construct (GthBrowser *browser)
char *caption;
int i;
gtk_window_set_default_size (GTK_WINDOW (browser),
eel_gconf_get_integer (PREF_UI_WINDOW_WIDTH, DEFAULT_UI_WINDOW_WIDTH),
eel_gconf_get_integer (PREF_UI_WINDOW_HEIGHT, DEFAULT_UI_WINDOW_HEIGHT));
{
int width;
int height;
width = eel_gconf_get_integer (PREF_UI_WINDOW_WIDTH, 0);
height = eel_gconf_get_integer (PREF_UI_WINDOW_HEIGHT, 0);
if ((width == 0) || (height == 0)) {
GdkScreen *screen;
int max_width;
int max_height;
int sidebar_width;
int thumb_size;
int n_cols;
screen = gtk_widget_get_screen (GTK_WIDGET (browser));
max_width = gdk_screen_get_width (screen) * 5 / 6;
max_height = gdk_screen_get_height (screen) * 2 / 3;
sidebar_width = eel_gconf_get_integer (PREF_UI_BROWSER_SIDEBAR_WIDTH, DEF_SIDEBAR_WIDTH) + 10;
thumb_size = eel_gconf_get_integer (PREF_THUMBNAIL_SIZE, DEF_THUMBNAIL_SIZE) + 40;
for (n_cols = 4; n_cols >= 1; n_cols--) {
width = sidebar_width + 40 + (n_cols * thumb_size);
if (width < max_width)
break;
}
if (n_cols == 0)
width = max_width;
height = max_height;
}
gtk_window_set_default_size (GTK_WINDOW (browser), width, height);
}
/* ui actions */
......@@ -3279,7 +3310,7 @@ _gth_browser_construct (GthBrowser *browser)
browser->priv->file_list = gth_file_list_new (GTH_FILE_LIST_TYPE_NORMAL);
gth_browser_set_sort_order (browser,
gth_main_get_sort_type (eel_gconf_get_string (PREF_SORT_TYPE, "file::name")),
gth_main_get_sort_type (eel_gconf_get_string (PREF_SORT_TYPE, "file::mtime")),
FALSE);
gth_browser_enable_thumbnails (browser, eel_gconf_get_boolean (PREF_SHOW_THUMBNAILS, TRUE));
gth_file_list_set_thumb_size (GTH_FILE_LIST (browser->priv->file_list), eel_gconf_get_integer (PREF_THUMBNAIL_SIZE, DEF_THUMBNAIL_SIZE));
......
......@@ -97,7 +97,7 @@ G_BEGIN_DECLS
#define DEFAULT_UI_WINDOW_WIDTH 690
#define DEFAULT_UI_WINDOW_HEIGHT 460
#define DEFAULT_FAST_FILE_TYPE TRUE
#define DEFAULT_THUMBNAIL_SIZE 112
#define DEFAULT_THUMBNAIL_SIZE 128
#define DEFAULT_CONFIRM_DELETION TRUE
#define DEFAULT_MSG_SAVE_MODIFIED_IMAGE TRUE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment