Commit 2a37c9e6 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/config/gimpdisplayconfig.[ch] moved navigation_preview_size to

2002-11-21  Sven Neumann  <sven@gimp.org>

	* app/config/gimpdisplayconfig.[ch]
	* app/config/gimpguiconfig.[ch]: moved navigation_preview_size to
	GimpDisplayConfig.

	* app/gui/preferences-dialog.c: offer the full choice of
	GimpPreviewSizes for the navigation preview size.

	* app/display/gimpnavigationview.c: multiply the preview size by 3
	to get reasonable values. Added some broken code that connects to
	notify::navigation-preview-size.

	* etc/gimprc.in: updated accordingly.
parent 024061d9
2002-11-21 Sven Neumann <sven@gimp.org>
* app/config/gimpdisplayconfig.[ch]
* app/config/gimpguiconfig.[ch]: moved navigation_preview_size to
GimpDisplayConfig.
* app/gui/preferences-dialog.c: offer the full choice of
GimpPreviewSizes for the navigation preview size.
* app/display/gimpnavigationview.c: multiply the preview size by 3
to get reasonable values. Added some broken code that connects to
notify::navigation-preview-size.
* etc/gimprc.in: updated accordingly.
2002-11-21 Michael Natterer <mitch@gimp.org>
 
* app/base/tile-cache.[ch]: added tile_cache_init() and
......
......@@ -67,7 +67,8 @@ enum
PROP_CONFIRM_ON_CLOSE,
PROP_MONITOR_XRESOLUTION,
PROP_MONITOR_YRESOLUTION,
PROP_MONITOR_RES_FROM_GDK
PROP_MONITOR_RES_FROM_GDK,
PROP_NAV_PREVIEW_SIZE
};
static GObjectClass *parent_class = NULL;
......@@ -179,6 +180,10 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
"monitor-resolution-from-windowing-system",
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_NAV_PREVIEW_SIZE,
"navigation-preview-size",
GIMP_TYPE_PREVIEW_SIZE, GIMP_PREVIEW_SIZE_MEDIUM,
0);
}
static void
......@@ -256,6 +261,9 @@ gimp_display_config_set_property (GObject *object,
case PROP_MONITOR_RES_FROM_GDK:
display_config->monitor_res_from_gdk = g_value_get_boolean (value);
break;
case PROP_NAV_PREVIEW_SIZE:
display_config->nav_preview_size = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......@@ -323,6 +331,9 @@ gimp_display_config_get_property (GObject *object,
case PROP_MONITOR_RES_FROM_GDK:
g_value_set_boolean (value, display_config->monitor_res_from_gdk);
break;
case PROP_NAV_PREVIEW_SIZE:
g_value_set_enum (value, display_config->nav_preview_size);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......
......@@ -56,6 +56,7 @@ struct _GimpDisplayConfig
gdouble monitor_xres;
gdouble monitor_yres;
gboolean monitor_res_from_gdk;
GimpPreviewSize nav_preview_size;
};
struct _GimpDisplayConfigClass
......
......@@ -48,11 +48,9 @@ static void gimp_gui_config_get_property (GObject *object,
enum
{
PROP_0,
PROP_LAST_OPENED_SIZE,
PROP_TRANSPARENCY_SIZE,
PROP_TRANSPARENCY_TYPE,
PROP_DEFAULT_THRESHOLD,
PROP_NAV_PREVIEW_SIZE,
PROP_INFO_WINDOW_PER_DISPLAY,
PROP_TRUST_DIRTY_FLAG,
PROP_SAVE_DEVICE_STATUS,
......@@ -61,6 +59,7 @@ enum
PROP_SHOW_TIPS,
PROP_SHOW_TOOL_TIPS,
PROP_TEAROFF_MENUS,
PROP_LAST_OPENED_SIZE,
PROP_MAX_NEW_IMAGE_SIZE,
PROP_THEME_PATH,
PROP_THEME,
......@@ -112,10 +111,6 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
object_class->set_property = gimp_gui_config_set_property;
object_class->get_property = gimp_gui_config_get_property;
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_LAST_OPENED_SIZE,
"last-opened-size",
0, G_MAXINT, 4,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_TRANSPARENCY_SIZE,
"transparency-size",
GIMP_TYPE_CHECK_SIZE, GIMP_MEDIUM_CHECKS,
......@@ -128,10 +123,6 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
"default-threshold",
0, 255, 15,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_NAV_PREVIEW_SIZE,
"navigation-preview-size",
GIMP_TYPE_PREVIEW_SIZE, GIMP_PREVIEW_SIZE_HUGE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INFO_WINDOW_PER_DISPLAY,
"info-window-per-display",
FALSE,
......@@ -164,6 +155,10 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
"tearoff-menus",
TRUE,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_LAST_OPENED_SIZE,
"last-opened-size",
0, 1024, 4,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_MAX_NEW_IMAGE_SIZE,
"max-new-image-size",
0, G_MAXULONG, 1 << 25,
......@@ -212,9 +207,6 @@ gimp_gui_config_set_property (GObject *object,
switch (property_id)
{
case PROP_LAST_OPENED_SIZE:
gui_config->last_opened_size = g_value_get_int (value);
break;
case PROP_TRANSPARENCY_SIZE:
gui_config->transparency_size = g_value_get_enum (value);
break;
......@@ -224,9 +216,6 @@ gimp_gui_config_set_property (GObject *object,
case PROP_DEFAULT_THRESHOLD:
gui_config->default_threshold = g_value_get_int (value);
break;
case PROP_NAV_PREVIEW_SIZE:
gui_config->nav_preview_size = g_value_get_enum (value);
break;
case PROP_INFO_WINDOW_PER_DISPLAY:
gui_config->info_window_per_display = g_value_get_boolean (value);
break;
......@@ -251,6 +240,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_TEAROFF_MENUS:
gui_config->tearoff_menus = g_value_get_boolean (value);
break;
case PROP_LAST_OPENED_SIZE:
gui_config->last_opened_size = g_value_get_int (value);
break;
case PROP_MAX_NEW_IMAGE_SIZE:
gui_config->max_new_image_size = g_value_get_ulong (value);
break;
......@@ -287,9 +279,6 @@ gimp_gui_config_get_property (GObject *object,
switch (property_id)
{
case PROP_LAST_OPENED_SIZE:
g_value_set_int (value, gui_config->last_opened_size);
break;
case PROP_TRANSPARENCY_SIZE:
g_value_set_enum (value, gui_config->transparency_size);
break;
......@@ -299,9 +288,6 @@ gimp_gui_config_get_property (GObject *object,
case PROP_DEFAULT_THRESHOLD:
g_value_set_int (value, gui_config->default_threshold);
break;
case PROP_NAV_PREVIEW_SIZE:
g_value_set_enum (value, gui_config->nav_preview_size);
break;
case PROP_INFO_WINDOW_PER_DISPLAY:
g_value_set_boolean (value, gui_config->info_window_per_display);
break;
......@@ -326,6 +312,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_TEAROFF_MENUS:
g_value_set_boolean (value, gui_config->tearoff_menus);
break;
case PROP_LAST_OPENED_SIZE:
g_value_set_int (value, gui_config->last_opened_size);
break;
case PROP_MAX_NEW_IMAGE_SIZE:
g_value_set_ulong (value, gui_config->max_new_image_size);
break;
......
......@@ -40,11 +40,9 @@ struct _GimpGuiConfig
{
GimpDisplayConfig parent_instance;
gint last_opened_size;
GimpCheckSize transparency_size;
GimpCheckType transparency_type;
gint default_threshold;
GimpPreviewSize nav_preview_size;
gboolean info_window_per_display;
gboolean trust_dirty_flag;
gboolean save_device_status;
......@@ -53,6 +51,7 @@ struct _GimpGuiConfig
gboolean show_tips;
gboolean show_tool_tips;
gboolean tearoff_menus;
gint last_opened_size;
gulong max_new_image_size;
gchar *theme_path;
gchar *theme;
......
......@@ -752,6 +752,7 @@ prefs_enum_option_menu_add (GObject *config,
return menu;
}
#if 0
static GtkWidget *
prefs_enum_option_menu_add_with_values (GObject *config,
const gchar *property_name,
......@@ -778,6 +779,7 @@ prefs_enum_option_menu_add_with_values (GObject *config,
return menu;
}
#endif
static GtkWidget *
prefs_boolean_option_menu_add (GObject *config,
......@@ -1183,13 +1185,9 @@ prefs_dialog_new (Gimp *gimp,
prefs_enum_option_menu_add (config, "preview-size", 0, 0,
_("_Preview Size:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add_with_values (config, "navigation-preview-size",
_("_Nav Preview Size:"),
GTK_TABLE (table), 1,
3,
GIMP_PREVIEW_SIZE_MEDIUM,
GIMP_PREVIEW_SIZE_EXTRA_LARGE,
GIMP_PREVIEW_SIZE_HUGE);
prefs_enum_option_menu_add (config, "navigation-preview-size", 0, 0,
_("_Navigation Preview Size:"),
GTK_TABLE (table), 1);
prefs_spin_button_add (config, "last-opened-size", 1.0, 5.0, 0,
_("_Recent Documents List Size:"),
GTK_TABLE (table), 3);
......
......@@ -30,7 +30,7 @@
#include "display-types.h"
#include "config/gimpguiconfig.h"
#include "config/gimpdisplayconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -66,6 +66,9 @@ static gboolean gimp_navigation_view_button_release (GtkWidget *widget,
static void gimp_navigation_view_abox_resized (GtkWidget *widget,
GtkAllocation *allocation,
GimpNavigationView *view);
static void gimp_navigation_view_size_notify (GObject *config,
GParamSpec *param_spec,
GimpNavigationView *view);
static void gimp_navigation_view_marker_changed (GimpNavigationPreview *preview,
gint x,
gint y,
......@@ -149,7 +152,7 @@ static void
gimp_navigation_view_init (GimpNavigationView *view)
{
/* FIXME!! */
GimpGuiConfig *config = GIMP_GUI_CONFIG (the_gimp->config);
GimpDisplayConfig *config = GIMP_DISPLAY_CONFIG (the_gimp->config);
GtkWidget *abox;
GtkWidget *frame;
......@@ -167,15 +170,21 @@ gimp_navigation_view_init (GimpNavigationView *view)
gtk_container_add (GTK_CONTAINER (frame), abox);
gtk_widget_show (abox);
gtk_widget_set_size_request (abox,
config->nav_preview_size,
config->nav_preview_size);
/* gtk_widget_set_size_request (abox, */
/* 3 * config->nav_preview_size, */
/* 3 * config->nav_preview_size); */
g_signal_connect (G_OBJECT (abox), "size_allocate",
G_CALLBACK (gimp_navigation_view_abox_resized),
view);
view->preview = gimp_navigation_preview_new (NULL, config->nav_preview_size);
view->preview = gimp_navigation_preview_new (NULL,
3 * config->nav_preview_size);
g_signal_connect (G_OBJECT (config), "notify::navigation-preview-size",
G_CALLBACK (gimp_navigation_view_size_notify),
view);
gtk_container_add (GTK_CONTAINER (abox), view->preview);
gtk_widget_show (view->preview);
......@@ -292,7 +301,8 @@ gimp_navigation_view_popup (GimpDisplayShell *shell,
gtk_container_add (GTK_CONTAINER (shell->nav_popup), frame);
gtk_widget_show (frame);
view = GIMP_NAVIGATION_VIEW (gimp_navigation_view_new_private (shell, TRUE));
view = GIMP_NAVIGATION_VIEW (gimp_navigation_view_new_private (shell,
TRUE));
gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (view));
gtk_widget_show (GTK_WIDGET (view));
......@@ -439,7 +449,8 @@ gimp_navigation_view_new_private (GimpDisplayShell *shell,
gtk_widget_size_request (view->zoom_label, &requisition);
gtk_widget_set_size_request (view->zoom_label,
4 * requisition.width, requisition.height);
4 * requisition.width,
requisition.height);
}
}
......@@ -509,7 +520,8 @@ gimp_navigation_view_abox_resized (GtkWidget *widget,
height = height * allocation->height / height;
}
gimp_preview_set_size_full (preview, width, height, preview->border_width);
gimp_preview_set_size_full (preview,
width, height, preview->border_width);
/* FIXME: the GimpNavigationPreview should handle this stuff itself */
......@@ -523,6 +535,18 @@ gimp_navigation_view_abox_resized (GtkWidget *widget,
}
}
static void
gimp_navigation_view_size_notify (GObject *config,
GParamSpec *param_spec,
GimpNavigationView *view)
{
GimpPreview *preview = GIMP_PREVIEW (view->preview);
gint size = GIMP_DISPLAY_CONFIG (config)->nav_preview_size;
if (size > 0)
gimp_preview_set_size (preview, 3 * size, preview->border_width);
}
static void
gimp_navigation_view_marker_changed (GimpNavigationPreview *preview,
gint x,
......
......@@ -30,7 +30,7 @@
#include "display-types.h"
#include "config/gimpguiconfig.h"
#include "config/gimpdisplayconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -66,6 +66,9 @@ static gboolean gimp_navigation_view_button_release (GtkWidget *widget,
static void gimp_navigation_view_abox_resized (GtkWidget *widget,
GtkAllocation *allocation,
GimpNavigationView *view);
static void gimp_navigation_view_size_notify (GObject *config,
GParamSpec *param_spec,
GimpNavigationView *view);
static void gimp_navigation_view_marker_changed (GimpNavigationPreview *preview,
gint x,
gint y,
......@@ -149,7 +152,7 @@ static void
gimp_navigation_view_init (GimpNavigationView *view)
{
/* FIXME!! */
GimpGuiConfig *config = GIMP_GUI_CONFIG (the_gimp->config);
GimpDisplayConfig *config = GIMP_DISPLAY_CONFIG (the_gimp->config);
GtkWidget *abox;
GtkWidget *frame;
......@@ -167,15 +170,21 @@ gimp_navigation_view_init (GimpNavigationView *view)
gtk_container_add (GTK_CONTAINER (frame), abox);
gtk_widget_show (abox);
gtk_widget_set_size_request (abox,
config->nav_preview_size,
config->nav_preview_size);
/* gtk_widget_set_size_request (abox, */
/* 3 * config->nav_preview_size, */
/* 3 * config->nav_preview_size); */
g_signal_connect (G_OBJECT (abox), "size_allocate",
G_CALLBACK (gimp_navigation_view_abox_resized),
view);
view->preview = gimp_navigation_preview_new (NULL, config->nav_preview_size);
view->preview = gimp_navigation_preview_new (NULL,
3 * config->nav_preview_size);
g_signal_connect (G_OBJECT (config), "notify::navigation-preview-size",
G_CALLBACK (gimp_navigation_view_size_notify),
view);
gtk_container_add (GTK_CONTAINER (abox), view->preview);
gtk_widget_show (view->preview);
......@@ -292,7 +301,8 @@ gimp_navigation_view_popup (GimpDisplayShell *shell,
gtk_container_add (GTK_CONTAINER (shell->nav_popup), frame);
gtk_widget_show (frame);
view = GIMP_NAVIGATION_VIEW (gimp_navigation_view_new_private (shell, TRUE));
view = GIMP_NAVIGATION_VIEW (gimp_navigation_view_new_private (shell,
TRUE));
gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (view));
gtk_widget_show (GTK_WIDGET (view));
......@@ -439,7 +449,8 @@ gimp_navigation_view_new_private (GimpDisplayShell *shell,
gtk_widget_size_request (view->zoom_label, &requisition);
gtk_widget_set_size_request (view->zoom_label,
4 * requisition.width, requisition.height);
4 * requisition.width,
requisition.height);
}
}
......@@ -509,7 +520,8 @@ gimp_navigation_view_abox_resized (GtkWidget *widget,
height = height * allocation->height / height;
}
gimp_preview_set_size_full (preview, width, height, preview->border_width);
gimp_preview_set_size_full (preview,
width, height, preview->border_width);
/* FIXME: the GimpNavigationPreview should handle this stuff itself */
......@@ -523,6 +535,18 @@ gimp_navigation_view_abox_resized (GtkWidget *widget,
}
}
static void
gimp_navigation_view_size_notify (GObject *config,
GParamSpec *param_spec,
GimpNavigationView *view)
{
GimpPreview *preview = GIMP_PREVIEW (view->preview);
gint size = GIMP_DISPLAY_CONFIG (config)->nav_preview_size;
if (size > 0)
gimp_preview_set_size (preview, 3 * size, preview->border_width);
}
static void
gimp_navigation_view_marker_changed (GimpNavigationPreview *preview,
gint x,
......
......@@ -752,6 +752,7 @@ prefs_enum_option_menu_add (GObject *config,
return menu;
}
#if 0
static GtkWidget *
prefs_enum_option_menu_add_with_values (GObject *config,
const gchar *property_name,
......@@ -778,6 +779,7 @@ prefs_enum_option_menu_add_with_values (GObject *config,
return menu;
}
#endif
static GtkWidget *
prefs_boolean_option_menu_add (GObject *config,
......@@ -1183,13 +1185,9 @@ prefs_dialog_new (Gimp *gimp,
prefs_enum_option_menu_add (config, "preview-size", 0, 0,
_("_Preview Size:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add_with_values (config, "navigation-preview-size",
_("_Nav Preview Size:"),
GTK_TABLE (table), 1,
3,
GIMP_PREVIEW_SIZE_MEDIUM,
GIMP_PREVIEW_SIZE_EXTRA_LARGE,
GIMP_PREVIEW_SIZE_HUGE);
prefs_enum_option_menu_add (config, "navigation-preview-size", 0, 0,
_("_Navigation Preview Size:"),
GTK_TABLE (table), 1);
prefs_spin_button_add (config, "last-opened-size", 1.0, 5.0, 0,
_("_Recent Documents List Size:"),
GTK_TABLE (table), 3);
......
......@@ -158,7 +158,7 @@
# Uncomment this line to disable them.
# (no-cursor-updating)
# Layer preview sizes (also used for the Undo History):
# Layer preview size (also used for the Undo History):
# none: no previews in layers dialog/layer selector
# tiny: 16x16
# small: 32x32
......@@ -167,8 +167,8 @@
# huge: 128x128
(preview-size small)
# Navigation window preview sizes:
(navigation-preview-size large)
# Navigation window preview size:
(navigation-preview-size medium)
# Tooltips
# Comment this out to disable the tooltips in the toolbox
......
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