app/config/gimprc-blurbs.h added separate properties for the fullscreen
2003-07-18 Michael Natterer <mitch@gimp.org> * app/config/gimprc-blurbs.h * app/config/gimpdisplayconfig.[ch]: added separate properties for the fullscreen appearance of the display (menubar, rulers, scrollbars, statusbar and padding). Default to everything invisible and black padding. * app/display/gimpdisplayshell.[ch]: renamed struct GimpDisplayShellVisibility to GimpDisplayShellAppearance and added the canvas padding stuff. * app/display/gimpdisplayshell-appearance.[ch]: made gimp_display_shell_set_padding() fullscreen-aware. Added gimp_display_shell_get_padding(). * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/gui/image-menu.c: changed addordingly. * app/gui/preferences-dialog.c: added the new options and moved the display appearance stuff to its own page. Minor cleanups.
This commit is contained in:

committed by
Michael Natterer

parent
7c4d375aa9
commit
bc77f1e3ff
23
ChangeLog
23
ChangeLog
@ -1,3 +1,26 @@
|
||||
2003-07-18 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/config/gimprc-blurbs.h
|
||||
* app/config/gimpdisplayconfig.[ch]: added separate properties for
|
||||
the fullscreen appearance of the display (menubar, rulers,
|
||||
scrollbars, statusbar and padding). Default to everything
|
||||
invisible and black padding.
|
||||
|
||||
* app/display/gimpdisplayshell.[ch]: renamed struct
|
||||
GimpDisplayShellVisibility to GimpDisplayShellAppearance and added
|
||||
the canvas padding stuff.
|
||||
|
||||
* app/display/gimpdisplayshell-appearance.[ch]: made
|
||||
gimp_display_shell_set_padding() fullscreen-aware. Added
|
||||
gimp_display_shell_get_padding().
|
||||
|
||||
* app/display/gimpdisplayshell-callbacks.c
|
||||
* app/display/gimpdisplayshell-handlers.c
|
||||
* app/gui/image-menu.c: changed addordingly.
|
||||
|
||||
* app/gui/preferences-dialog.c: added the new options and moved
|
||||
the display appearance stuff to its own page. Minor cleanups.
|
||||
|
||||
2003-07-17 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/vectors/Makefile.am
|
||||
|
@ -67,17 +67,23 @@ enum
|
||||
PROP_CURSOR_UPDATING,
|
||||
PROP_IMAGE_TITLE_FORMAT,
|
||||
PROP_IMAGE_STATUS_FORMAT,
|
||||
PROP_SHOW_MENUBAR,
|
||||
PROP_SHOW_RULERS,
|
||||
PROP_SHOW_SCROLLBARS,
|
||||
PROP_SHOW_STATUSBAR,
|
||||
PROP_CONFIRM_ON_CLOSE,
|
||||
PROP_MONITOR_XRESOLUTION,
|
||||
PROP_MONITOR_YRESOLUTION,
|
||||
PROP_MONITOR_RES_FROM_GDK,
|
||||
PROP_NAV_PREVIEW_SIZE,
|
||||
PROP_SHOW_MENUBAR,
|
||||
PROP_SHOW_RULERS,
|
||||
PROP_SHOW_SCROLLBARS,
|
||||
PROP_SHOW_STATUSBAR,
|
||||
PROP_CANVAS_PADDING_MODE,
|
||||
PROP_CANVAS_PADDING_COLOR
|
||||
PROP_CANVAS_PADDING_COLOR,
|
||||
PROP_FS_SHOW_MENUBAR,
|
||||
PROP_FS_SHOW_RULERS,
|
||||
PROP_FS_SHOW_SCROLLBARS,
|
||||
PROP_FS_SHOW_STATUSBAR,
|
||||
PROP_FS_CANVAS_PADDING_MODE,
|
||||
PROP_FS_CANVAS_PADDING_COLOR
|
||||
};
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
@ -116,6 +122,7 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
GimpRGB white;
|
||||
GimpRGB black;
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
@ -126,6 +133,7 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
||||
object_class->get_property = gimp_display_config_get_property;
|
||||
|
||||
gimp_rgba_set (&white, 1.0, 1.0, 1.0, 1.0);
|
||||
gimp_rgba_set (&black, 0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MARCHING_ANTS_SPEED,
|
||||
"marching-ants-speed",
|
||||
@ -179,22 +187,6 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
||||
IMAGE_STATUS_FORMAT_BLURB,
|
||||
DEFAULT_IMAGE_STATUS_FORMAT,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_MENUBAR,
|
||||
"show-menubar", SHOW_MENUBAR_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_RULERS,
|
||||
"show-rulers", SHOW_RULERS_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SCROLLBARS,
|
||||
"show-scrollbars", SHOW_SCROLLBARS_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_STATUSBAR,
|
||||
"show-statusbar", SHOW_STATUSBAR_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CONFIRM_ON_CLOSE,
|
||||
"confirm-on-close", CONFIRM_ON_CLOSE_BLURB,
|
||||
TRUE,
|
||||
@ -220,6 +212,23 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
||||
GIMP_TYPE_PREVIEW_SIZE,
|
||||
GIMP_PREVIEW_SIZE_MEDIUM,
|
||||
0);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_MENUBAR,
|
||||
"show-menubar", SHOW_MENUBAR_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_RULERS,
|
||||
"show-rulers", SHOW_RULERS_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SCROLLBARS,
|
||||
"show-scrollbars", SHOW_SCROLLBARS_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_STATUSBAR,
|
||||
"show-statusbar", SHOW_STATUSBAR_BLURB,
|
||||
TRUE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CANVAS_PADDING_MODE,
|
||||
"canvas-padding-mode",
|
||||
CANVAS_PADDING_MODE_BLURB,
|
||||
@ -231,6 +240,38 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
||||
CANVAS_PADDING_COLOR_BLURB,
|
||||
&white,
|
||||
0);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FS_SHOW_MENUBAR,
|
||||
"fullscreen-show-menubar",
|
||||
FS_SHOW_MENUBAR_BLURB,
|
||||
FALSE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FS_SHOW_RULERS,
|
||||
"fullscreen-show-rulers",
|
||||
FS_SHOW_RULERS_BLURB,
|
||||
FALSE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FS_SHOW_SCROLLBARS,
|
||||
"fullscreen-show-scrollbars",
|
||||
FS_SHOW_SCROLLBARS_BLURB,
|
||||
FALSE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FS_SHOW_STATUSBAR,
|
||||
"fullscreen-show-statusbar",
|
||||
FS_SHOW_STATUSBAR_BLURB,
|
||||
FALSE,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_FS_CANVAS_PADDING_MODE,
|
||||
"fullscreen-canvas-padding-mode",
|
||||
FS_CANVAS_PADDING_MODE_BLURB,
|
||||
GIMP_TYPE_DISPLAY_PADDING_MODE,
|
||||
GIMP_DISPLAY_PADDING_MODE_CUSTOM,
|
||||
0);
|
||||
GIMP_CONFIG_INSTALL_PROP_COLOR (object_class, PROP_FS_CANVAS_PADDING_COLOR,
|
||||
"fullscreen-canvas-padding-color",
|
||||
FS_CANVAS_PADDING_COLOR_BLURB,
|
||||
&black,
|
||||
0);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -293,18 +334,6 @@ gimp_display_config_set_property (GObject *object,
|
||||
g_free (display_config->image_status_format);
|
||||
display_config->image_status_format = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_SHOW_MENUBAR:
|
||||
display_config->show_menubar = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SHOW_RULERS:
|
||||
display_config->show_rulers = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SHOW_SCROLLBARS:
|
||||
display_config->show_scrollbars = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SHOW_STATUSBAR:
|
||||
display_config->show_statusbar = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_CONFIRM_ON_CLOSE:
|
||||
display_config->confirm_on_close = g_value_get_boolean (value);
|
||||
break;
|
||||
@ -320,6 +349,19 @@ gimp_display_config_set_property (GObject *object,
|
||||
case PROP_NAV_PREVIEW_SIZE:
|
||||
display_config->nav_preview_size = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
case PROP_SHOW_MENUBAR:
|
||||
display_config->show_menubar = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SHOW_RULERS:
|
||||
display_config->show_rulers = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SHOW_SCROLLBARS:
|
||||
display_config->show_scrollbars = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_SHOW_STATUSBAR:
|
||||
display_config->show_statusbar = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_CANVAS_PADDING_MODE:
|
||||
display_config->canvas_padding_mode = g_value_get_enum (value);
|
||||
break;
|
||||
@ -327,6 +369,25 @@ gimp_display_config_set_property (GObject *object,
|
||||
display_config->canvas_padding_color = *(GimpRGB *) g_value_get_boxed (value);
|
||||
break;
|
||||
|
||||
case PROP_FS_SHOW_MENUBAR:
|
||||
display_config->fs_show_menubar = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_FS_SHOW_RULERS:
|
||||
display_config->fs_show_rulers = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_FS_SHOW_SCROLLBARS:
|
||||
display_config->fs_show_scrollbars = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_FS_SHOW_STATUSBAR:
|
||||
display_config->fs_show_statusbar = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_FS_CANVAS_PADDING_MODE:
|
||||
display_config->fs_canvas_padding_mode = g_value_get_enum (value);
|
||||
break;
|
||||
case PROP_FS_CANVAS_PADDING_COLOR:
|
||||
display_config->fs_canvas_padding_color = *(GimpRGB *) g_value_get_boxed (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
@ -378,18 +439,6 @@ gimp_display_config_get_property (GObject *object,
|
||||
case PROP_IMAGE_STATUS_FORMAT:
|
||||
g_value_set_string (value, display_config->image_status_format);
|
||||
break;
|
||||
case PROP_SHOW_MENUBAR:
|
||||
g_value_set_boolean (value, display_config->show_menubar);
|
||||
break;
|
||||
case PROP_SHOW_RULERS:
|
||||
g_value_set_boolean (value, display_config->show_rulers);
|
||||
break;
|
||||
case PROP_SHOW_SCROLLBARS:
|
||||
g_value_set_boolean (value, display_config->show_scrollbars);
|
||||
break;
|
||||
case PROP_SHOW_STATUSBAR:
|
||||
g_value_set_boolean (value, display_config->show_statusbar);
|
||||
break;
|
||||
case PROP_CONFIRM_ON_CLOSE:
|
||||
g_value_set_boolean (value, display_config->confirm_on_close);
|
||||
break;
|
||||
@ -405,6 +454,19 @@ gimp_display_config_get_property (GObject *object,
|
||||
case PROP_NAV_PREVIEW_SIZE:
|
||||
g_value_set_enum (value, display_config->nav_preview_size);
|
||||
break;
|
||||
|
||||
case PROP_SHOW_MENUBAR:
|
||||
g_value_set_boolean (value, display_config->show_menubar);
|
||||
break;
|
||||
case PROP_SHOW_RULERS:
|
||||
g_value_set_boolean (value, display_config->show_rulers);
|
||||
break;
|
||||
case PROP_SHOW_SCROLLBARS:
|
||||
g_value_set_boolean (value, display_config->show_scrollbars);
|
||||
break;
|
||||
case PROP_SHOW_STATUSBAR:
|
||||
g_value_set_boolean (value, display_config->show_statusbar);
|
||||
break;
|
||||
case PROP_CANVAS_PADDING_MODE:
|
||||
g_value_set_enum (value, display_config->canvas_padding_mode);
|
||||
break;
|
||||
@ -412,6 +474,25 @@ gimp_display_config_get_property (GObject *object,
|
||||
g_value_set_boxed (value, &display_config->canvas_padding_color);
|
||||
break;
|
||||
|
||||
case PROP_FS_SHOW_MENUBAR:
|
||||
g_value_set_boolean (value, display_config->fs_show_menubar);
|
||||
break;
|
||||
case PROP_FS_SHOW_RULERS:
|
||||
g_value_set_boolean (value, display_config->fs_show_rulers);
|
||||
break;
|
||||
case PROP_FS_SHOW_SCROLLBARS:
|
||||
g_value_set_boolean (value, display_config->fs_show_scrollbars);
|
||||
break;
|
||||
case PROP_FS_SHOW_STATUSBAR:
|
||||
g_value_set_boolean (value, display_config->fs_show_statusbar);
|
||||
break;
|
||||
case PROP_FS_CANVAS_PADDING_MODE:
|
||||
g_value_set_enum (value, display_config->fs_canvas_padding_mode);
|
||||
break;
|
||||
case PROP_FS_CANVAS_PADDING_COLOR:
|
||||
g_value_set_boxed (value, &display_config->fs_canvas_padding_color);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
|
@ -51,17 +51,25 @@ struct _GimpDisplayConfig
|
||||
gboolean cursor_updating;
|
||||
gchar *image_title_format;
|
||||
gchar *image_status_format;
|
||||
gboolean show_menubar;
|
||||
gboolean show_rulers;
|
||||
gboolean show_scrollbars;
|
||||
gboolean show_statusbar;
|
||||
gboolean confirm_on_close;
|
||||
gdouble monitor_xres;
|
||||
gdouble monitor_yres;
|
||||
gboolean monitor_res_from_gdk;
|
||||
GimpPreviewSize nav_preview_size;
|
||||
|
||||
gboolean show_menubar;
|
||||
gboolean show_rulers;
|
||||
gboolean show_scrollbars;
|
||||
gboolean show_statusbar;
|
||||
GimpDisplayPaddingMode canvas_padding_mode;
|
||||
GimpRGB canvas_padding_color;
|
||||
|
||||
gboolean fs_show_menubar;
|
||||
gboolean fs_show_rulers;
|
||||
gboolean fs_show_scrollbars;
|
||||
gboolean fs_show_statusbar;
|
||||
GimpDisplayPaddingMode fs_canvas_padding_mode;
|
||||
GimpRGB fs_canvas_padding_color;
|
||||
};
|
||||
|
||||
struct _GimpDisplayConfigClass
|
||||
|
@ -19,6 +19,13 @@ N_("Specifies how the area around the image should be drawn.")
|
||||
N_("Sets the canvas padding color used if the padding mode is set to " \
|
||||
"custom color.")
|
||||
|
||||
#define FS_CANVAS_PADDING_MODE_BLURB \
|
||||
N_("Specifies how the area around the image should be drawn.")
|
||||
|
||||
#define FS_CANVAS_PADDING_COLOR_BLURB \
|
||||
N_("Sets the canvas padding color used if the padding mode is set to " \
|
||||
"custom color.")
|
||||
|
||||
#define COLORMAP_CYCLING_BLURB \
|
||||
N_("Specify that marching ants for selected regions will be drawn with " \
|
||||
"colormap cycling as opposed to be drawn as animated lines. This color " \
|
||||
@ -254,6 +261,22 @@ N_("When enabled, the scrollbars are visible by default. This can also be " \
|
||||
N_("When enabled, the statusbar is visible by default. This can also be " \
|
||||
"toggled with the \"View->Show Statusbar\" command.")
|
||||
|
||||
#define FS_SHOW_MENUBAR_BLURB \
|
||||
N_("When enabled, the menubar is visible by default. This can also be " \
|
||||
"toggled with the \"View->Show Menubar\" command.")
|
||||
|
||||
#define FS_SHOW_RULERS_BLURB \
|
||||
N_("When enabled, the rulers are visible by default. This can also be " \
|
||||
"toggled with the \"View->Show Rulers\" command.")
|
||||
|
||||
#define FS_SHOW_SCROLLBARS_BLURB \
|
||||
N_("When enabled, the scrollbars are visible by default. This can also be " \
|
||||
"toggled with the \"View->Show Scrollbars\" command.")
|
||||
|
||||
#define FS_SHOW_STATUSBAR_BLURB \
|
||||
N_("When enabled, the statusbar is visible by default. This can also be " \
|
||||
"toggled with the \"View->Show Statusbar\" command.")
|
||||
|
||||
#define SHOW_TIPS_BLURB \
|
||||
N_("Enable to display a handy GIMP tip on startup.")
|
||||
|
||||
|
@ -1154,7 +1154,7 @@ prefs_dialog_new (Gimp *gimp,
|
||||
&top_iter,
|
||||
page_index++);
|
||||
|
||||
/* General */
|
||||
/* Previews */
|
||||
vbox2 = prefs_frame_new (_("Previews"), GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "layer-previews",
|
||||
@ -1390,50 +1390,18 @@ prefs_dialog_new (Gimp *gimp,
|
||||
&child_iter,
|
||||
page_index++);
|
||||
|
||||
/* Appearance */
|
||||
vbox2 = prefs_frame_new (_("Appearance"), GTK_CONTAINER (vbox), FALSE);
|
||||
/* General */
|
||||
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "default-dot-for-dot",
|
||||
_("Use \"_Dot for Dot\" by default"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-menubar",
|
||||
_("Show Menubar"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-rulers",
|
||||
_("Show _Rulers"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-scrollbars",
|
||||
_("Show Scrollbars"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-statusbar",
|
||||
_("Show S_tatusbar"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_boolean_option_menu_add (config, "initial-zoom-to-fit",
|
||||
_("Fit to Window"),
|
||||
"1:1",
|
||||
_("Inital Zoom Ratio:"),
|
||||
GTK_TABLE (table), 0);
|
||||
prefs_spin_button_add (config, "marching-ants-speed", 10.0, 100.0, 0,
|
||||
_("Marching _Ants Speed:"),
|
||||
GTK_TABLE (table), 1);
|
||||
|
||||
/* Canvas Padding Color */
|
||||
vbox2 = prefs_frame_new (_("Canvas Padding Color"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_enum_option_menu_add (config, "canvas-padding-mode", 0, 0,
|
||||
_("Padding Mode:"),
|
||||
GTK_TABLE (table), 0);
|
||||
button = prefs_color_button_add (config, "canvas-padding-color",
|
||||
_("Custom Color:"),
|
||||
_("Select Custom Canvas Padding Color"),
|
||||
GTK_TABLE (table), 1);
|
||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
|
||||
gimp_get_user_context (gimp));
|
||||
|
||||
/* Zoom & Resize Behavior */
|
||||
vbox2 = prefs_frame_new (_("Zoom & Resize Behavior"),
|
||||
@ -1446,6 +1414,14 @@ prefs_dialog_new (Gimp *gimp,
|
||||
_("Resize Window on Image _Size Change"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_boolean_option_menu_add (config, "initial-zoom-to-fit",
|
||||
_("Fit to Window"),
|
||||
"1:1",
|
||||
_("Inital Zoom Ratio:"),
|
||||
GTK_TABLE (table), 0);
|
||||
|
||||
/* Pointer Movement Feedback */
|
||||
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
@ -1464,6 +1440,79 @@ prefs_dialog_new (Gimp *gimp,
|
||||
GTK_TABLE (table), 0);
|
||||
|
||||
|
||||
/********************************************/
|
||||
/* Interface / Image Windows / Appearance */
|
||||
/********************************************/
|
||||
vbox = prefs_notebook_append_page (gimp,
|
||||
GTK_NOTEBOOK (notebook),
|
||||
_("Image Window Appearance"),
|
||||
"image-windows.png",
|
||||
GTK_TREE_STORE (tree),
|
||||
_("Appearance"),
|
||||
"dialogs/preferences/image_windows.html",
|
||||
&child_iter,
|
||||
&grandchild_iter,
|
||||
page_index++);
|
||||
|
||||
/* Normal Mode */
|
||||
vbox2 = prefs_frame_new (_("Default Appearance in Normal Mode"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "show-menubar",
|
||||
_("Show Menubar"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-rulers",
|
||||
_("Show _Rulers"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-scrollbars",
|
||||
_("Show Scrollbars"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-statusbar",
|
||||
_("Show S_tatusbar"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_enum_option_menu_add (config, "canvas-padding-mode", 0, 0,
|
||||
_("Canvas Padding Mode:"),
|
||||
GTK_TABLE (table), 0);
|
||||
button = prefs_color_button_add (config, "canvas-padding-color",
|
||||
_("Custom Padding Color:"),
|
||||
_("Select Custom Canvas Padding Color"),
|
||||
GTK_TABLE (table), 1);
|
||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
|
||||
gimp_get_user_context (gimp));
|
||||
|
||||
/* Fullscreen Mode */
|
||||
vbox2 = prefs_frame_new (_("Default Appearance in Fullscreen Mode"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "fullscreen-show-menubar",
|
||||
_("Show Menubar"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "fullscreen-show-rulers",
|
||||
_("Show _Rulers"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "fullscreen-show-scrollbars",
|
||||
_("Show Scrollbars"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "fullscreen-show-statusbar",
|
||||
_("Show S_tatusbar"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_enum_option_menu_add (config, "fullscreen-canvas-padding-mode", 0, 0,
|
||||
_("Canvas Padding Mode:"),
|
||||
GTK_TABLE (table), 0);
|
||||
button = prefs_color_button_add (config, "fullscreen-canvas-padding-color",
|
||||
_("Custom Padding Color:"),
|
||||
_("Select Custom Canvas Padding Color"),
|
||||
GTK_TABLE (table), 1);
|
||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
|
||||
gimp_get_user_context (gimp));
|
||||
|
||||
|
||||
/****************************************************************/
|
||||
/* Interface / Image Windows / Image Title & Statusbar Format */
|
||||
/****************************************************************/
|
||||
|
@ -38,88 +38,11 @@
|
||||
#include "gimpdisplayshell-render.h"
|
||||
|
||||
|
||||
#define GET_VISIBILITY(shell) \
|
||||
#define GET_APPEARANCE(shell) \
|
||||
(gimp_display_shell_get_fullscreen (shell) ? \
|
||||
&shell->fullscreen_visibility : &shell->visibility)
|
||||
&shell->fullscreen_appearance : &shell->appearance)
|
||||
|
||||
|
||||
void
|
||||
gimp_display_shell_set_padding (GimpDisplayShell *shell,
|
||||
GimpDisplayPaddingMode padding_mode,
|
||||
GimpRGB *padding_color)
|
||||
{
|
||||
guchar r, g, b;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (padding_color != NULL);
|
||||
|
||||
shell->padding_mode = padding_mode;
|
||||
|
||||
switch (shell->padding_mode)
|
||||
{
|
||||
case GIMP_DISPLAY_PADDING_MODE_DEFAULT:
|
||||
if (shell->canvas)
|
||||
{
|
||||
gtk_widget_ensure_style (shell->canvas);
|
||||
|
||||
r = shell->canvas->style->bg[GTK_STATE_NORMAL].red >> 8;
|
||||
g = shell->canvas->style->bg[GTK_STATE_NORMAL].green >> 8;
|
||||
b = shell->canvas->style->bg[GTK_STATE_NORMAL].blue >> 8;
|
||||
|
||||
gimp_rgb_set_uchar (&shell->padding_color, r, g, b);
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMP_DISPLAY_PADDING_MODE_LIGHT_CHECK:
|
||||
gimp_rgb_set_uchar (&shell->padding_color,
|
||||
render_blend_light_check[0],
|
||||
render_blend_light_check[1],
|
||||
render_blend_light_check[2]);
|
||||
break;
|
||||
|
||||
case GIMP_DISPLAY_PADDING_MODE_DARK_CHECK:
|
||||
gimp_rgb_set_uchar (&shell->padding_color,
|
||||
render_blend_dark_check[0],
|
||||
render_blend_dark_check[1],
|
||||
render_blend_dark_check[2]);
|
||||
break;
|
||||
|
||||
case GIMP_DISPLAY_PADDING_MODE_CUSTOM:
|
||||
shell->padding_color = *padding_color;
|
||||
break;
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_REALIZED (shell->canvas))
|
||||
{
|
||||
GdkColormap *colormap;
|
||||
GdkColor color;
|
||||
|
||||
gimp_rgb_get_gdk_color (&shell->padding_color, &color);
|
||||
|
||||
colormap = gdk_drawable_get_colormap (shell->canvas->window);
|
||||
g_return_if_fail (colormap != NULL);
|
||||
gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE);
|
||||
|
||||
gdk_window_set_background (shell->canvas->window, &color);
|
||||
}
|
||||
|
||||
if (shell->padding_button)
|
||||
{
|
||||
g_signal_handlers_block_by_func (shell->padding_button,
|
||||
gimp_display_shell_color_button_changed,
|
||||
shell);
|
||||
|
||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (shell->padding_button),
|
||||
&shell->padding_color);
|
||||
|
||||
g_signal_handlers_unblock_by_func (shell->padding_button,
|
||||
gimp_display_shell_color_button_changed,
|
||||
shell);
|
||||
}
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_fullscreen (GimpDisplayShell *shell,
|
||||
gboolean fullscreen)
|
||||
@ -147,15 +70,15 @@ void
|
||||
gimp_display_shell_set_show_selection (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->selection)
|
||||
if (show != appearance->selection)
|
||||
{
|
||||
visibility->selection = show ? TRUE : FALSE;
|
||||
appearance->selection = show ? TRUE : FALSE;
|
||||
|
||||
if (shell->select)
|
||||
gimp_display_shell_selection_set_hidden (shell->select, ! show);
|
||||
@ -172,22 +95,22 @@ gimp_display_shell_get_show_selection (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->selection;
|
||||
return GET_APPEARANCE (shell)->selection;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_layer (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->active_layer)
|
||||
if (show != appearance->active_layer)
|
||||
{
|
||||
visibility->active_layer = show ? TRUE : FALSE;
|
||||
appearance->active_layer = show ? TRUE : FALSE;
|
||||
|
||||
if (shell->select)
|
||||
gimp_display_shell_selection_layer_set_hidden (shell->select, ! show);
|
||||
@ -204,22 +127,22 @@ gimp_display_shell_get_show_layer (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->active_layer;
|
||||
return GET_APPEARANCE (shell)->active_layer;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_grid (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->grid)
|
||||
if (show != appearance->grid)
|
||||
{
|
||||
visibility->grid = show ? TRUE : FALSE;
|
||||
appearance->grid = show ? TRUE : FALSE;
|
||||
|
||||
if (shell->gdisp->gimage->grid)
|
||||
gimp_display_shell_expose_full (shell);
|
||||
@ -236,7 +159,7 @@ gimp_display_shell_get_show_grid (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->grid;
|
||||
return GET_APPEARANCE (shell)->grid;
|
||||
}
|
||||
|
||||
void
|
||||
@ -268,15 +191,15 @@ void
|
||||
gimp_display_shell_set_show_guides (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->guides)
|
||||
if (show != appearance->guides)
|
||||
{
|
||||
visibility->guides = show ? TRUE : FALSE;
|
||||
appearance->guides = show ? TRUE : FALSE;
|
||||
|
||||
if (shell->gdisp->gimage->guides)
|
||||
gimp_display_shell_expose_full (shell);
|
||||
@ -293,20 +216,20 @@ gimp_display_shell_get_show_guides (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->guides;
|
||||
return GET_APPEARANCE (shell)->guides;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_menubar (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->menubar)
|
||||
if (show != appearance->menubar)
|
||||
{
|
||||
GtkWidget *menubar;
|
||||
GtkContainer *vbox;
|
||||
@ -319,9 +242,9 @@ gimp_display_shell_set_show_menubar (GimpDisplayShell *shell,
|
||||
else
|
||||
gtk_widget_hide (menubar);
|
||||
|
||||
visibility->menubar = show ? TRUE : FALSE;
|
||||
appearance->menubar = show ? TRUE : FALSE;
|
||||
|
||||
if (visibility->menubar || visibility->statusbar)
|
||||
if (appearance->menubar || appearance->statusbar)
|
||||
gtk_container_set_border_width (vbox, 2);
|
||||
else
|
||||
gtk_container_set_border_width (vbox, 0);
|
||||
@ -338,20 +261,20 @@ gimp_display_shell_get_show_menubar (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->menubar;
|
||||
return GET_APPEARANCE (shell)->menubar;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_rulers (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->rulers)
|
||||
if (show != appearance->rulers)
|
||||
{
|
||||
GtkTable *table;
|
||||
|
||||
@ -376,7 +299,7 @@ gimp_display_shell_set_show_rulers (GimpDisplayShell *shell,
|
||||
gtk_table_set_row_spacing (table, 0, 0);
|
||||
}
|
||||
|
||||
visibility->rulers = show ? TRUE : FALSE;
|
||||
appearance->rulers = show ? TRUE : FALSE;
|
||||
|
||||
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
|
||||
"/View/Show Rulers", show);
|
||||
@ -390,20 +313,20 @@ gimp_display_shell_get_show_rulers (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->rulers;
|
||||
return GET_APPEARANCE (shell)->rulers;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_scrollbars (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->scrollbars)
|
||||
if (show != appearance->scrollbars)
|
||||
{
|
||||
GtkBox *hbox;
|
||||
GtkBox *vbox;
|
||||
@ -434,7 +357,7 @@ gimp_display_shell_set_show_scrollbars (GimpDisplayShell *shell,
|
||||
gtk_box_set_spacing (vbox, 0);
|
||||
}
|
||||
|
||||
visibility->scrollbars = show ? TRUE : FALSE;
|
||||
appearance->scrollbars = show ? TRUE : FALSE;
|
||||
|
||||
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
|
||||
"/View/Show Scrollbars", show);
|
||||
@ -448,20 +371,20 @@ gimp_display_shell_get_show_scrollbars (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->scrollbars;
|
||||
return GET_APPEARANCE (shell)->scrollbars;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
|
||||
gboolean show)
|
||||
{
|
||||
GimpDisplayShellVisibility *visibility;
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
visibility = GET_VISIBILITY (shell);
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (show != visibility->statusbar)
|
||||
if (show != appearance->statusbar)
|
||||
{
|
||||
GtkContainer *vbox;
|
||||
|
||||
@ -472,9 +395,9 @@ gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
|
||||
else
|
||||
gtk_widget_hide (shell->statusbar);
|
||||
|
||||
visibility->statusbar = show ? TRUE : FALSE;
|
||||
appearance->statusbar = show ? TRUE : FALSE;
|
||||
|
||||
if (visibility->menubar || visibility->statusbar)
|
||||
if (appearance->menubar || appearance->statusbar)
|
||||
gtk_container_set_border_width (vbox, 2);
|
||||
else
|
||||
gtk_container_set_border_width (vbox, 0);
|
||||
@ -491,5 +414,103 @@ gimp_display_shell_get_show_statusbar (GimpDisplayShell *shell)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
|
||||
|
||||
return GET_VISIBILITY (shell)->statusbar;
|
||||
return GET_APPEARANCE (shell)->statusbar;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_set_padding (GimpDisplayShell *shell,
|
||||
GimpDisplayPaddingMode padding_mode,
|
||||
const GimpRGB *padding_color)
|
||||
{
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
guchar r, g, b;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (padding_color != NULL);
|
||||
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
appearance->padding_mode = padding_mode;
|
||||
|
||||
switch (appearance->padding_mode)
|
||||
{
|
||||
case GIMP_DISPLAY_PADDING_MODE_DEFAULT:
|
||||
if (shell->canvas)
|
||||
{
|
||||
gtk_widget_ensure_style (shell->canvas);
|
||||
|
||||
r = shell->canvas->style->bg[GTK_STATE_NORMAL].red >> 8;
|
||||
g = shell->canvas->style->bg[GTK_STATE_NORMAL].green >> 8;
|
||||
b = shell->canvas->style->bg[GTK_STATE_NORMAL].blue >> 8;
|
||||
|
||||
gimp_rgb_set_uchar (&appearance->padding_color, r, g, b);
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMP_DISPLAY_PADDING_MODE_LIGHT_CHECK:
|
||||
gimp_rgb_set_uchar (&appearance->padding_color,
|
||||
render_blend_light_check[0],
|
||||
render_blend_light_check[1],
|
||||
render_blend_light_check[2]);
|
||||
break;
|
||||
|
||||
case GIMP_DISPLAY_PADDING_MODE_DARK_CHECK:
|
||||
gimp_rgb_set_uchar (&appearance->padding_color,
|
||||
render_blend_dark_check[0],
|
||||
render_blend_dark_check[1],
|
||||
render_blend_dark_check[2]);
|
||||
break;
|
||||
|
||||
case GIMP_DISPLAY_PADDING_MODE_CUSTOM:
|
||||
appearance->padding_color = *padding_color;
|
||||
break;
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_REALIZED (shell->canvas))
|
||||
{
|
||||
GdkColormap *colormap;
|
||||
GdkColor color;
|
||||
|
||||
gimp_rgb_get_gdk_color (&appearance->padding_color, &color);
|
||||
|
||||
colormap = gdk_drawable_get_colormap (shell->canvas->window);
|
||||
g_return_if_fail (colormap != NULL);
|
||||
gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE);
|
||||
|
||||
gdk_window_set_background (shell->canvas->window, &color);
|
||||
}
|
||||
|
||||
if (shell->padding_button)
|
||||
{
|
||||
g_signal_handlers_block_by_func (shell->padding_button,
|
||||
gimp_display_shell_color_button_changed,
|
||||
shell);
|
||||
|
||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (shell->padding_button),
|
||||
&appearance->padding_color);
|
||||
|
||||
g_signal_handlers_unblock_by_func (shell->padding_button,
|
||||
gimp_display_shell_color_button_changed,
|
||||
shell);
|
||||
}
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_get_padding (GimpDisplayShell *shell,
|
||||
GimpDisplayPaddingMode *padding_mode,
|
||||
GimpRGB *padding_color)
|
||||
{
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
appearance = GET_APPEARANCE (shell);
|
||||
|
||||
if (padding_mode)
|
||||
*padding_mode = appearance->padding_mode;
|
||||
|
||||
if (padding_color)
|
||||
*padding_color = appearance->padding_color;
|
||||
}
|
||||
|
@ -20,10 +20,6 @@
|
||||
#define __GIMP_DISPLAY_SHELL_APPEARANCE_H__
|
||||
|
||||
|
||||
void gimp_display_shell_set_padding (GimpDisplayShell *shell,
|
||||
GimpDisplayPaddingMode mode,
|
||||
GimpRGB *color);
|
||||
|
||||
void gimp_display_shell_set_fullscreen (GimpDisplayShell *shell,
|
||||
gboolean fullscreen);
|
||||
gboolean gimp_display_shell_get_fullscreen (GimpDisplayShell *shell);
|
||||
@ -64,5 +60,12 @@ void gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
|
||||
gboolean show);
|
||||
gboolean gimp_display_shell_get_show_statusbar (GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_set_padding (GimpDisplayShell *shell,
|
||||
GimpDisplayPaddingMode mode,
|
||||
const GimpRGB *color);
|
||||
void gimp_display_shell_get_padding (GimpDisplayShell *shell,
|
||||
GimpDisplayPaddingMode *mode,
|
||||
GimpRGB *color);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_APPEARANCE_H__ */
|
||||
|
@ -182,8 +182,9 @@ gimp_display_shell_events (GtkWidget *widget,
|
||||
case GDK_WINDOW_STATE:
|
||||
{
|
||||
GdkEventWindowState *sevent;
|
||||
GimpDisplayShellVisibility visibility;
|
||||
GimpDisplayShellAppearance appearance;
|
||||
gboolean fullscreen;
|
||||
gboolean padding_mode_set;
|
||||
|
||||
sevent = (GdkEventWindowState *) event;
|
||||
|
||||
@ -196,23 +197,33 @@ gimp_display_shell_events (GtkWidget *widget,
|
||||
|
||||
if (fullscreen)
|
||||
{
|
||||
visibility = shell->fullscreen_visibility;
|
||||
shell->fullscreen_visibility = shell->visibility;
|
||||
padding_mode_set = shell->fullscreen_appearance.padding_mode_set;
|
||||
|
||||
appearance = shell->fullscreen_appearance;
|
||||
shell->fullscreen_appearance = shell->appearance;
|
||||
|
||||
shell->fullscreen_appearance.padding_mode_set = padding_mode_set;
|
||||
}
|
||||
else
|
||||
{
|
||||
visibility = shell->visibility;
|
||||
shell->visibility = shell->fullscreen_visibility;
|
||||
padding_mode_set = shell->appearance.padding_mode_set;
|
||||
|
||||
appearance = shell->appearance;
|
||||
shell->appearance = shell->fullscreen_appearance;
|
||||
|
||||
shell->appearance.padding_mode_set = padding_mode_set;
|
||||
}
|
||||
|
||||
gimp_display_shell_set_show_selection (shell, visibility.selection);
|
||||
gimp_display_shell_set_show_layer (shell, visibility.active_layer);
|
||||
gimp_display_shell_set_show_guides (shell, visibility.guides);
|
||||
gimp_display_shell_set_show_grid (shell, visibility.grid);
|
||||
gimp_display_shell_set_show_menubar (shell, visibility.menubar);
|
||||
gimp_display_shell_set_show_rulers (shell, visibility.rulers);
|
||||
gimp_display_shell_set_show_scrollbars (shell, visibility.scrollbars);
|
||||
gimp_display_shell_set_show_statusbar (shell, visibility.statusbar);
|
||||
gimp_display_shell_set_show_selection (shell, appearance.selection);
|
||||
gimp_display_shell_set_show_layer (shell, appearance.active_layer);
|
||||
gimp_display_shell_set_show_guides (shell, appearance.guides);
|
||||
gimp_display_shell_set_show_grid (shell, appearance.grid);
|
||||
gimp_display_shell_set_show_menubar (shell, appearance.menubar);
|
||||
gimp_display_shell_set_show_rulers (shell, appearance.rulers);
|
||||
gimp_display_shell_set_show_scrollbars (shell, appearance.scrollbars);
|
||||
gimp_display_shell_set_show_statusbar (shell, appearance.statusbar);
|
||||
gimp_display_shell_set_padding (shell, appearance.padding_mode,
|
||||
&appearance.padding_color);
|
||||
|
||||
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
|
||||
"/View/Fullscreen", fullscreen);
|
||||
@ -242,15 +253,16 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas,
|
||||
{
|
||||
GimpDisplayConfig *config;
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplayPaddingMode padding_mode;
|
||||
GimpRGB padding_color;
|
||||
|
||||
gdisp = shell->gdisp;
|
||||
config = GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config);
|
||||
|
||||
gtk_widget_grab_focus (shell->canvas);
|
||||
|
||||
gimp_display_shell_set_padding (shell,
|
||||
shell->padding_mode,
|
||||
&shell->padding_color);
|
||||
gimp_display_shell_get_padding (shell, &padding_mode, &padding_color);
|
||||
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
|
||||
|
||||
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));
|
||||
|
||||
@ -1328,7 +1340,10 @@ gimp_display_shell_color_button_changed (GtkWidget *widget,
|
||||
{
|
||||
GimpRGB color;
|
||||
|
||||
shell->padding_mode_set = TRUE;
|
||||
if (gimp_display_shell_get_fullscreen (shell))
|
||||
shell->fullscreen_appearance.padding_mode_set = TRUE;
|
||||
else
|
||||
shell->appearance.padding_mode_set = TRUE;
|
||||
|
||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (widget), &color);
|
||||
|
||||
@ -1342,35 +1357,46 @@ gimp_display_shell_color_button_menu_callback (gpointer callback_data,
|
||||
guint callback_action,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GimpDisplayShellAppearance *appearance;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean fullscreen;
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (callback_data);
|
||||
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
if (fullscreen)
|
||||
appearance = &shell->fullscreen_appearance;
|
||||
else
|
||||
appearance = &shell->appearance;
|
||||
|
||||
if (callback_action == GIMP_DISPLAY_PADDING_MODE_CUSTOM)
|
||||
{
|
||||
gtk_button_clicked (GTK_BUTTON (shell->padding_button));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (callback_action == 0xffff)
|
||||
else if (callback_action == 0xffff)
|
||||
{
|
||||
GimpDisplayConfig *config;
|
||||
|
||||
config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config);
|
||||
|
||||
shell->padding_mode_set = FALSE;
|
||||
appearance->padding_mode_set = FALSE;
|
||||
|
||||
if (fullscreen)
|
||||
gimp_display_shell_set_padding (shell,
|
||||
config->fs_canvas_padding_mode,
|
||||
&config->fs_canvas_padding_color);
|
||||
else
|
||||
gimp_display_shell_set_padding (shell,
|
||||
config->canvas_padding_mode,
|
||||
&config->canvas_padding_color);
|
||||
}
|
||||
else
|
||||
{
|
||||
shell->padding_mode_set = TRUE;
|
||||
appearance->padding_mode_set = TRUE;
|
||||
|
||||
gimp_display_shell_set_padding (shell, callback_action,
|
||||
&shell->padding_color);
|
||||
}
|
||||
&appearance->padding_color);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,9 +248,7 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
||||
shell->cursor_y = 0;
|
||||
|
||||
shell->padding_button = NULL;
|
||||
shell->padding_mode = GIMP_DISPLAY_PADDING_MODE_DEFAULT;
|
||||
shell->padding_mode_set = FALSE;
|
||||
gimp_rgba_set (&shell->padding_color, 1.0, 1.0, 1.0, 1.0);
|
||||
shell->nav_ebox = NULL;
|
||||
|
||||
shell->warning_dialog = NULL;
|
||||
shell->info_dialog = NULL;
|
||||
@ -266,23 +264,30 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
||||
|
||||
shell->window_state = 0;
|
||||
|
||||
shell->visibility.selection = TRUE;
|
||||
shell->visibility.active_layer = TRUE;
|
||||
shell->visibility.guides = TRUE;
|
||||
shell->visibility.grid = TRUE;
|
||||
shell->visibility.menubar = FALSE;
|
||||
shell->visibility.rulers = TRUE;
|
||||
shell->visibility.scrollbars = TRUE;
|
||||
shell->visibility.statusbar = TRUE;
|
||||
shell->appearance.selection = TRUE;
|
||||
shell->appearance.active_layer = TRUE;
|
||||
shell->appearance.guides = TRUE;
|
||||
shell->appearance.grid = TRUE;
|
||||
shell->appearance.menubar = TRUE;
|
||||
shell->appearance.rulers = TRUE;
|
||||
shell->appearance.scrollbars = TRUE;
|
||||
shell->appearance.statusbar = TRUE;
|
||||
shell->appearance.padding_mode = GIMP_DISPLAY_PADDING_MODE_DEFAULT;
|
||||
gimp_rgba_set (&shell->appearance.padding_color, 1.0, 1.0, 1.0, 1.0);
|
||||
shell->appearance.padding_mode_set = FALSE;
|
||||
|
||||
shell->fullscreen_visibility.selection = TRUE;
|
||||
shell->fullscreen_visibility.active_layer = TRUE;
|
||||
shell->fullscreen_visibility.guides = TRUE;
|
||||
shell->fullscreen_visibility.grid = TRUE;
|
||||
shell->fullscreen_visibility.menubar = FALSE;
|
||||
shell->fullscreen_visibility.rulers = FALSE;
|
||||
shell->fullscreen_visibility.scrollbars = FALSE;
|
||||
shell->fullscreen_visibility.statusbar = FALSE;
|
||||
shell->fullscreen_appearance.selection = TRUE;
|
||||
shell->fullscreen_appearance.active_layer = TRUE;
|
||||
shell->fullscreen_appearance.guides = TRUE;
|
||||
shell->fullscreen_appearance.grid = TRUE;
|
||||
shell->fullscreen_appearance.menubar = FALSE;
|
||||
shell->fullscreen_appearance.rulers = FALSE;
|
||||
shell->fullscreen_appearance.scrollbars = FALSE;
|
||||
shell->fullscreen_appearance.statusbar = FALSE;
|
||||
shell->fullscreen_appearance.padding_mode = GIMP_DISPLAY_PADDING_MODE_CUSTOM;
|
||||
gimp_rgba_set (&shell->fullscreen_appearance.padding_color,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
shell->fullscreen_appearance.padding_mode_set = FALSE;
|
||||
|
||||
gtk_window_set_wmclass (GTK_WINDOW (shell), "image_window", "Gimp");
|
||||
gtk_window_set_resizable (GTK_WINDOW (shell), TRUE);
|
||||
@ -507,10 +512,19 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
shell->dot_for_dot = config->default_dot_for_dot;
|
||||
|
||||
shell->visibility.menubar = config->show_menubar;
|
||||
shell->visibility.rulers = config->show_rulers;
|
||||
shell->visibility.scrollbars = config->show_scrollbars;
|
||||
shell->visibility.statusbar = config->show_statusbar;
|
||||
shell->appearance.menubar = config->show_menubar;
|
||||
shell->appearance.rulers = config->show_rulers;
|
||||
shell->appearance.scrollbars = config->show_scrollbars;
|
||||
shell->appearance.statusbar = config->show_statusbar;
|
||||
shell->appearance.padding_mode = config->canvas_padding_mode;
|
||||
shell->appearance.padding_color = config->canvas_padding_color;
|
||||
|
||||
shell->fullscreen_appearance.menubar = config->fs_show_menubar;
|
||||
shell->fullscreen_appearance.rulers = config->fs_show_rulers;
|
||||
shell->fullscreen_appearance.scrollbars = config->fs_show_scrollbars;
|
||||
shell->fullscreen_appearance.statusbar = config->fs_show_statusbar;
|
||||
shell->fullscreen_appearance.padding_mode = config->fs_canvas_padding_mode;
|
||||
shell->fullscreen_appearance.padding_color = config->fs_canvas_padding_color;
|
||||
|
||||
/* adjust the initial scale -- so that window fits on screen the 75%
|
||||
* value is the same as in gimp_display_shell_shrink_wrap. It
|
||||
@ -628,7 +642,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, FALSE, 0);
|
||||
|
||||
if (shell->visibility.menubar)
|
||||
if (shell->appearance.menubar)
|
||||
gtk_widget_show (menubar);
|
||||
|
||||
/* active display callback */
|
||||
@ -762,7 +776,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
/* create the contents of the right_vbox *********************************/
|
||||
shell->padding_button = gimp_color_panel_new (_("Set Canvas Padding Color"),
|
||||
&shell->padding_color,
|
||||
&shell->appearance.padding_color,
|
||||
GIMP_COLOR_AREA_FLAT,
|
||||
15, 15);
|
||||
GTK_WIDGET_UNSET_FLAGS (shell->padding_button, GTK_CAN_FOCUS);
|
||||
@ -879,7 +893,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
/* show everything *******************************************************/
|
||||
|
||||
if (shell->visibility.rulers)
|
||||
if (shell->appearance.rulers)
|
||||
{
|
||||
gtk_widget_show (shell->origin);
|
||||
gtk_widget_show (shell->hrule);
|
||||
@ -888,7 +902,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
gtk_widget_show (shell->canvas);
|
||||
|
||||
if (shell->visibility.scrollbars)
|
||||
if (shell->appearance.scrollbars)
|
||||
{
|
||||
gtk_widget_show (shell->vsb);
|
||||
gtk_widget_show (shell->hsb);
|
||||
@ -897,7 +911,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
gtk_widget_show (shell->nav_ebox);
|
||||
}
|
||||
|
||||
if (shell->visibility.statusbar)
|
||||
if (shell->appearance.statusbar)
|
||||
gtk_widget_show (shell->statusbar);
|
||||
|
||||
gtk_widget_show (main_vbox);
|
||||
|
@ -27,9 +27,9 @@
|
||||
#include "gui/gui-types.h"
|
||||
|
||||
|
||||
typedef struct _GimpDisplayShellVisibility GimpDisplayShellVisibility;
|
||||
typedef struct _GimpDisplayShellAppearance GimpDisplayShellAppearance;
|
||||
|
||||
struct _GimpDisplayShellVisibility
|
||||
struct _GimpDisplayShellAppearance
|
||||
{
|
||||
gboolean selection;
|
||||
gboolean active_layer;
|
||||
@ -40,6 +40,10 @@ struct _GimpDisplayShellVisibility
|
||||
gboolean rulers;
|
||||
gboolean scrollbars;
|
||||
gboolean statusbar;
|
||||
|
||||
GimpDisplayPaddingMode padding_mode;
|
||||
GimpRGB padding_color;
|
||||
gboolean padding_mode_set;
|
||||
};
|
||||
|
||||
|
||||
@ -147,10 +151,6 @@ struct _GimpDisplayShell
|
||||
gint cursor_y; /* software cursor Y value */
|
||||
|
||||
GtkWidget *padding_button; /* GimpColorPanel in the NE corner */
|
||||
GimpDisplayPaddingMode padding_mode;
|
||||
gboolean padding_mode_set;
|
||||
GimpRGB padding_color; /* color of the empty around the image */
|
||||
|
||||
GtkWidget *nav_ebox; /* GtkEventBox on the SE corner */
|
||||
|
||||
GtkWidget *warning_dialog; /* close warning dialog */
|
||||
@ -168,8 +168,8 @@ struct _GimpDisplayShell
|
||||
|
||||
GdkWindowState window_state; /* for fullscreen display */
|
||||
|
||||
GimpDisplayShellVisibility visibility;
|
||||
GimpDisplayShellVisibility fullscreen_visibility;
|
||||
GimpDisplayShellAppearance appearance;
|
||||
GimpDisplayShellAppearance fullscreen_appearance;
|
||||
};
|
||||
|
||||
struct _GimpDisplayShellClass
|
||||
|
@ -112,9 +112,6 @@ gimp_display_shell_connect (GimpDisplayShell *shell)
|
||||
|
||||
display_config = GIMP_DISPLAY_CONFIG (gimage->gimp->config);
|
||||
|
||||
shell->padding_mode = display_config->canvas_padding_mode;
|
||||
shell->padding_color = display_config->canvas_padding_color;
|
||||
|
||||
g_signal_connect (gimage, "clean",
|
||||
G_CALLBACK (gimp_display_shell_clean_dirty_handler),
|
||||
shell);
|
||||
@ -192,6 +189,14 @@ gimp_display_shell_connect (GimpDisplayShell *shell)
|
||||
"notify::canvas-padding-color",
|
||||
G_CALLBACK (gimp_display_shell_padding_notify_handler),
|
||||
shell);
|
||||
g_signal_connect (gimage->gimp->config,
|
||||
"notify::fullscreen-canvas-padding-mode",
|
||||
G_CALLBACK (gimp_display_shell_padding_notify_handler),
|
||||
shell);
|
||||
g_signal_connect (gimage->gimp->config,
|
||||
"notify::fullscreen-canvas-padding-color",
|
||||
G_CALLBACK (gimp_display_shell_padding_notify_handler),
|
||||
shell);
|
||||
g_signal_connect (gimage->gimp->config,
|
||||
"notify::marching-ants-speed",
|
||||
G_CALLBACK (gimp_display_shell_ants_speed_notify_handler),
|
||||
@ -405,13 +410,16 @@ gimp_display_shell_check_notify_handler (GObject *config,
|
||||
GParamSpec *param_spec,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
switch (shell->padding_mode)
|
||||
GimpDisplayPaddingMode padding_mode;
|
||||
GimpRGB padding_color;
|
||||
|
||||
gimp_display_shell_get_padding (shell, &padding_mode, &padding_color);
|
||||
|
||||
switch (padding_mode)
|
||||
{
|
||||
case GIMP_DISPLAY_PADDING_MODE_LIGHT_CHECK:
|
||||
case GIMP_DISPLAY_PADDING_MODE_DARK_CHECK:
|
||||
gimp_display_shell_set_padding (shell,
|
||||
shell->padding_mode,
|
||||
&shell->padding_color);
|
||||
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -474,16 +482,47 @@ gimp_display_shell_padding_notify_handler (GObject *config,
|
||||
GParamSpec *param_spec,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
/* if the user did not set the padding mode for this display explicitely */
|
||||
if (! shell->padding_mode_set)
|
||||
{
|
||||
GimpDisplayConfig *display_config;
|
||||
gboolean fullscreen;
|
||||
GimpDisplayPaddingMode padding_mode;
|
||||
GimpRGB padding_color;
|
||||
|
||||
display_config = GIMP_DISPLAY_CONFIG (config);
|
||||
|
||||
gimp_display_shell_set_padding (shell,
|
||||
display_config->canvas_padding_mode,
|
||||
&display_config->canvas_padding_color);
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
/* if the user did not set the padding mode for this display explicitely */
|
||||
if (! shell->fullscreen_appearance.padding_mode_set)
|
||||
{
|
||||
padding_mode = display_config->fs_canvas_padding_mode;
|
||||
padding_color = display_config->fs_canvas_padding_color;
|
||||
|
||||
if (fullscreen)
|
||||
{
|
||||
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
|
||||
}
|
||||
else
|
||||
{
|
||||
shell->fullscreen_appearance.padding_mode = padding_mode;
|
||||
shell->fullscreen_appearance.padding_color = padding_color;
|
||||
}
|
||||
}
|
||||
|
||||
/* if the user did not set the padding mode for this display explicitely */
|
||||
if (! shell->appearance.padding_mode_set)
|
||||
{
|
||||
padding_mode = display_config->canvas_padding_mode;
|
||||
padding_color = display_config->canvas_padding_color;
|
||||
|
||||
if (fullscreen)
|
||||
{
|
||||
shell->appearance.padding_mode = padding_mode;
|
||||
shell->appearance.padding_color = padding_color;
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,9 +248,7 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
||||
shell->cursor_y = 0;
|
||||
|
||||
shell->padding_button = NULL;
|
||||
shell->padding_mode = GIMP_DISPLAY_PADDING_MODE_DEFAULT;
|
||||
shell->padding_mode_set = FALSE;
|
||||
gimp_rgba_set (&shell->padding_color, 1.0, 1.0, 1.0, 1.0);
|
||||
shell->nav_ebox = NULL;
|
||||
|
||||
shell->warning_dialog = NULL;
|
||||
shell->info_dialog = NULL;
|
||||
@ -266,23 +264,30 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
||||
|
||||
shell->window_state = 0;
|
||||
|
||||
shell->visibility.selection = TRUE;
|
||||
shell->visibility.active_layer = TRUE;
|
||||
shell->visibility.guides = TRUE;
|
||||
shell->visibility.grid = TRUE;
|
||||
shell->visibility.menubar = FALSE;
|
||||
shell->visibility.rulers = TRUE;
|
||||
shell->visibility.scrollbars = TRUE;
|
||||
shell->visibility.statusbar = TRUE;
|
||||
shell->appearance.selection = TRUE;
|
||||
shell->appearance.active_layer = TRUE;
|
||||
shell->appearance.guides = TRUE;
|
||||
shell->appearance.grid = TRUE;
|
||||
shell->appearance.menubar = TRUE;
|
||||
shell->appearance.rulers = TRUE;
|
||||
shell->appearance.scrollbars = TRUE;
|
||||
shell->appearance.statusbar = TRUE;
|
||||
shell->appearance.padding_mode = GIMP_DISPLAY_PADDING_MODE_DEFAULT;
|
||||
gimp_rgba_set (&shell->appearance.padding_color, 1.0, 1.0, 1.0, 1.0);
|
||||
shell->appearance.padding_mode_set = FALSE;
|
||||
|
||||
shell->fullscreen_visibility.selection = TRUE;
|
||||
shell->fullscreen_visibility.active_layer = TRUE;
|
||||
shell->fullscreen_visibility.guides = TRUE;
|
||||
shell->fullscreen_visibility.grid = TRUE;
|
||||
shell->fullscreen_visibility.menubar = FALSE;
|
||||
shell->fullscreen_visibility.rulers = FALSE;
|
||||
shell->fullscreen_visibility.scrollbars = FALSE;
|
||||
shell->fullscreen_visibility.statusbar = FALSE;
|
||||
shell->fullscreen_appearance.selection = TRUE;
|
||||
shell->fullscreen_appearance.active_layer = TRUE;
|
||||
shell->fullscreen_appearance.guides = TRUE;
|
||||
shell->fullscreen_appearance.grid = TRUE;
|
||||
shell->fullscreen_appearance.menubar = FALSE;
|
||||
shell->fullscreen_appearance.rulers = FALSE;
|
||||
shell->fullscreen_appearance.scrollbars = FALSE;
|
||||
shell->fullscreen_appearance.statusbar = FALSE;
|
||||
shell->fullscreen_appearance.padding_mode = GIMP_DISPLAY_PADDING_MODE_CUSTOM;
|
||||
gimp_rgba_set (&shell->fullscreen_appearance.padding_color,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
shell->fullscreen_appearance.padding_mode_set = FALSE;
|
||||
|
||||
gtk_window_set_wmclass (GTK_WINDOW (shell), "image_window", "Gimp");
|
||||
gtk_window_set_resizable (GTK_WINDOW (shell), TRUE);
|
||||
@ -507,10 +512,19 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
shell->dot_for_dot = config->default_dot_for_dot;
|
||||
|
||||
shell->visibility.menubar = config->show_menubar;
|
||||
shell->visibility.rulers = config->show_rulers;
|
||||
shell->visibility.scrollbars = config->show_scrollbars;
|
||||
shell->visibility.statusbar = config->show_statusbar;
|
||||
shell->appearance.menubar = config->show_menubar;
|
||||
shell->appearance.rulers = config->show_rulers;
|
||||
shell->appearance.scrollbars = config->show_scrollbars;
|
||||
shell->appearance.statusbar = config->show_statusbar;
|
||||
shell->appearance.padding_mode = config->canvas_padding_mode;
|
||||
shell->appearance.padding_color = config->canvas_padding_color;
|
||||
|
||||
shell->fullscreen_appearance.menubar = config->fs_show_menubar;
|
||||
shell->fullscreen_appearance.rulers = config->fs_show_rulers;
|
||||
shell->fullscreen_appearance.scrollbars = config->fs_show_scrollbars;
|
||||
shell->fullscreen_appearance.statusbar = config->fs_show_statusbar;
|
||||
shell->fullscreen_appearance.padding_mode = config->fs_canvas_padding_mode;
|
||||
shell->fullscreen_appearance.padding_color = config->fs_canvas_padding_color;
|
||||
|
||||
/* adjust the initial scale -- so that window fits on screen the 75%
|
||||
* value is the same as in gimp_display_shell_shrink_wrap. It
|
||||
@ -628,7 +642,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, FALSE, 0);
|
||||
|
||||
if (shell->visibility.menubar)
|
||||
if (shell->appearance.menubar)
|
||||
gtk_widget_show (menubar);
|
||||
|
||||
/* active display callback */
|
||||
@ -762,7 +776,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
/* create the contents of the right_vbox *********************************/
|
||||
shell->padding_button = gimp_color_panel_new (_("Set Canvas Padding Color"),
|
||||
&shell->padding_color,
|
||||
&shell->appearance.padding_color,
|
||||
GIMP_COLOR_AREA_FLAT,
|
||||
15, 15);
|
||||
GTK_WIDGET_UNSET_FLAGS (shell->padding_button, GTK_CAN_FOCUS);
|
||||
@ -879,7 +893,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
/* show everything *******************************************************/
|
||||
|
||||
if (shell->visibility.rulers)
|
||||
if (shell->appearance.rulers)
|
||||
{
|
||||
gtk_widget_show (shell->origin);
|
||||
gtk_widget_show (shell->hrule);
|
||||
@ -888,7 +902,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
|
||||
gtk_widget_show (shell->canvas);
|
||||
|
||||
if (shell->visibility.scrollbars)
|
||||
if (shell->appearance.scrollbars)
|
||||
{
|
||||
gtk_widget_show (shell->vsb);
|
||||
gtk_widget_show (shell->hsb);
|
||||
@ -897,7 +911,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
||||
gtk_widget_show (shell->nav_ebox);
|
||||
}
|
||||
|
||||
if (shell->visibility.statusbar)
|
||||
if (shell->appearance.statusbar)
|
||||
gtk_widget_show (shell->statusbar);
|
||||
|
||||
gtk_widget_show (main_vbox);
|
||||
|
@ -27,9 +27,9 @@
|
||||
#include "gui/gui-types.h"
|
||||
|
||||
|
||||
typedef struct _GimpDisplayShellVisibility GimpDisplayShellVisibility;
|
||||
typedef struct _GimpDisplayShellAppearance GimpDisplayShellAppearance;
|
||||
|
||||
struct _GimpDisplayShellVisibility
|
||||
struct _GimpDisplayShellAppearance
|
||||
{
|
||||
gboolean selection;
|
||||
gboolean active_layer;
|
||||
@ -40,6 +40,10 @@ struct _GimpDisplayShellVisibility
|
||||
gboolean rulers;
|
||||
gboolean scrollbars;
|
||||
gboolean statusbar;
|
||||
|
||||
GimpDisplayPaddingMode padding_mode;
|
||||
GimpRGB padding_color;
|
||||
gboolean padding_mode_set;
|
||||
};
|
||||
|
||||
|
||||
@ -147,10 +151,6 @@ struct _GimpDisplayShell
|
||||
gint cursor_y; /* software cursor Y value */
|
||||
|
||||
GtkWidget *padding_button; /* GimpColorPanel in the NE corner */
|
||||
GimpDisplayPaddingMode padding_mode;
|
||||
gboolean padding_mode_set;
|
||||
GimpRGB padding_color; /* color of the empty around the image */
|
||||
|
||||
GtkWidget *nav_ebox; /* GtkEventBox on the SE corner */
|
||||
|
||||
GtkWidget *warning_dialog; /* close warning dialog */
|
||||
@ -168,8 +168,8 @@ struct _GimpDisplayShell
|
||||
|
||||
GdkWindowState window_state; /* for fullscreen display */
|
||||
|
||||
GimpDisplayShellVisibility visibility;
|
||||
GimpDisplayShellVisibility fullscreen_visibility;
|
||||
GimpDisplayShellAppearance appearance;
|
||||
GimpDisplayShellAppearance fullscreen_appearance;
|
||||
};
|
||||
|
||||
struct _GimpDisplayShellClass
|
||||
|
@ -1257,7 +1257,7 @@ image_menu_update (GtkItemFactory *item_factory,
|
||||
gint lind = -1;
|
||||
gint lnum = -1;
|
||||
gboolean fullscreen = FALSE;
|
||||
GimpDisplayShellVisibility *visibility = NULL;
|
||||
GimpDisplayShellAppearance *appearance = NULL;
|
||||
|
||||
gimp = GIMP_ITEM_FACTORY (item_factory)->gimp;
|
||||
|
||||
@ -1305,9 +1305,9 @@ image_menu_update (GtkItemFactory *item_factory,
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
if (fullscreen)
|
||||
visibility = &shell->fullscreen_visibility;
|
||||
appearance = &shell->fullscreen_appearance;
|
||||
else
|
||||
visibility = &shell->visibility;
|
||||
appearance = &shell->appearance;
|
||||
}
|
||||
|
||||
gimp_context_get_foreground (gimp_get_user_context (gimp), &fg);
|
||||
@ -1427,27 +1427,27 @@ image_menu_update (GtkItemFactory *item_factory,
|
||||
SET_SENSITIVE ("/View/Display Filters...", gdisp);
|
||||
|
||||
SET_SENSITIVE ("/View/Show Selection", gdisp);
|
||||
SET_ACTIVE ("/View/Show Selection", gdisp && visibility->selection);
|
||||
SET_ACTIVE ("/View/Show Selection", gdisp && appearance->selection);
|
||||
SET_SENSITIVE ("/View/Show Layer Boundary", gdisp);
|
||||
SET_ACTIVE ("/View/Show Layer Boundary", gdisp && visibility->active_layer);
|
||||
SET_ACTIVE ("/View/Show Layer Boundary", gdisp && appearance->active_layer);
|
||||
SET_SENSITIVE ("/View/Show Guides", gdisp);
|
||||
SET_ACTIVE ("/View/Show Guides", gdisp && visibility->guides);
|
||||
SET_ACTIVE ("/View/Show Guides", gdisp && appearance->guides);
|
||||
SET_SENSITIVE ("/View/Snap to Guides", gdisp);
|
||||
SET_ACTIVE ("/View/Snap to Guides", gdisp && shell->snap_to_guides);
|
||||
|
||||
SET_SENSITIVE ("/View/Show Grid", gdisp);
|
||||
SET_ACTIVE ("/View/Show Grid", gdisp && visibility->grid);
|
||||
SET_ACTIVE ("/View/Show Grid", gdisp && appearance->grid);
|
||||
SET_SENSITIVE ("/View/Snap to Grid", gdisp);
|
||||
SET_ACTIVE ("/View/Snap to Grid", gdisp && shell->snap_to_grid);
|
||||
|
||||
SET_SENSITIVE ("/View/Show Menubar", gdisp);
|
||||
SET_ACTIVE ("/View/Show Menubar", gdisp && visibility->menubar);
|
||||
SET_ACTIVE ("/View/Show Menubar", gdisp && appearance->menubar);
|
||||
SET_SENSITIVE ("/View/Show Rulers", gdisp);
|
||||
SET_ACTIVE ("/View/Show Rulers", gdisp && visibility->rulers);
|
||||
SET_ACTIVE ("/View/Show Rulers", gdisp && appearance->rulers);
|
||||
SET_SENSITIVE ("/View/Show Scrollbars", gdisp);
|
||||
SET_ACTIVE ("/View/Show Scrollbars", gdisp && visibility->scrollbars);
|
||||
SET_ACTIVE ("/View/Show Scrollbars", gdisp && appearance->scrollbars);
|
||||
SET_SENSITIVE ("/View/Show Statusbar", gdisp);
|
||||
SET_ACTIVE ("/View/Show Statusbar", gdisp && visibility->statusbar);
|
||||
SET_ACTIVE ("/View/Show Statusbar", gdisp && appearance->statusbar);
|
||||
|
||||
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
|
||||
|
||||
|
@ -1154,7 +1154,7 @@ prefs_dialog_new (Gimp *gimp,
|
||||
&top_iter,
|
||||
page_index++);
|
||||
|
||||
/* General */
|
||||
/* Previews */
|
||||
vbox2 = prefs_frame_new (_("Previews"), GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "layer-previews",
|
||||
@ -1390,50 +1390,18 @@ prefs_dialog_new (Gimp *gimp,
|
||||
&child_iter,
|
||||
page_index++);
|
||||
|
||||
/* Appearance */
|
||||
vbox2 = prefs_frame_new (_("Appearance"), GTK_CONTAINER (vbox), FALSE);
|
||||
/* General */
|
||||
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "default-dot-for-dot",
|
||||
_("Use \"_Dot for Dot\" by default"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-menubar",
|
||||
_("Show Menubar"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-rulers",
|
||||
_("Show _Rulers"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-scrollbars",
|
||||
_("Show Scrollbars"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-statusbar",
|
||||
_("Show S_tatusbar"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_boolean_option_menu_add (config, "initial-zoom-to-fit",
|
||||
_("Fit to Window"),
|
||||
"1:1",
|
||||
_("Inital Zoom Ratio:"),
|
||||
GTK_TABLE (table), 0);
|
||||
prefs_spin_button_add (config, "marching-ants-speed", 10.0, 100.0, 0,
|
||||
_("Marching _Ants Speed:"),
|
||||
GTK_TABLE (table), 1);
|
||||
|
||||
/* Canvas Padding Color */
|
||||
vbox2 = prefs_frame_new (_("Canvas Padding Color"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_enum_option_menu_add (config, "canvas-padding-mode", 0, 0,
|
||||
_("Padding Mode:"),
|
||||
GTK_TABLE (table), 0);
|
||||
button = prefs_color_button_add (config, "canvas-padding-color",
|
||||
_("Custom Color:"),
|
||||
_("Select Custom Canvas Padding Color"),
|
||||
GTK_TABLE (table), 1);
|
||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
|
||||
gimp_get_user_context (gimp));
|
||||
|
||||
/* Zoom & Resize Behavior */
|
||||
vbox2 = prefs_frame_new (_("Zoom & Resize Behavior"),
|
||||
@ -1446,6 +1414,14 @@ prefs_dialog_new (Gimp *gimp,
|
||||
_("Resize Window on Image _Size Change"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_boolean_option_menu_add (config, "initial-zoom-to-fit",
|
||||
_("Fit to Window"),
|
||||
"1:1",
|
||||
_("Inital Zoom Ratio:"),
|
||||
GTK_TABLE (table), 0);
|
||||
|
||||
/* Pointer Movement Feedback */
|
||||
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
@ -1464,6 +1440,79 @@ prefs_dialog_new (Gimp *gimp,
|
||||
GTK_TABLE (table), 0);
|
||||
|
||||
|
||||
/********************************************/
|
||||
/* Interface / Image Windows / Appearance */
|
||||
/********************************************/
|
||||
vbox = prefs_notebook_append_page (gimp,
|
||||
GTK_NOTEBOOK (notebook),
|
||||
_("Image Window Appearance"),
|
||||
"image-windows.png",
|
||||
GTK_TREE_STORE (tree),
|
||||
_("Appearance"),
|
||||
"dialogs/preferences/image_windows.html",
|
||||
&child_iter,
|
||||
&grandchild_iter,
|
||||
page_index++);
|
||||
|
||||
/* Normal Mode */
|
||||
vbox2 = prefs_frame_new (_("Default Appearance in Normal Mode"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "show-menubar",
|
||||
_("Show Menubar"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-rulers",
|
||||
_("Show _Rulers"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-scrollbars",
|
||||
_("Show Scrollbars"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "show-statusbar",
|
||||
_("Show S_tatusbar"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_enum_option_menu_add (config, "canvas-padding-mode", 0, 0,
|
||||
_("Canvas Padding Mode:"),
|
||||
GTK_TABLE (table), 0);
|
||||
button = prefs_color_button_add (config, "canvas-padding-color",
|
||||
_("Custom Padding Color:"),
|
||||
_("Select Custom Canvas Padding Color"),
|
||||
GTK_TABLE (table), 1);
|
||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
|
||||
gimp_get_user_context (gimp));
|
||||
|
||||
/* Fullscreen Mode */
|
||||
vbox2 = prefs_frame_new (_("Default Appearance in Fullscreen Mode"),
|
||||
GTK_CONTAINER (vbox), FALSE);
|
||||
|
||||
prefs_check_button_add (config, "fullscreen-show-menubar",
|
||||
_("Show Menubar"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "fullscreen-show-rulers",
|
||||
_("Show _Rulers"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "fullscreen-show-scrollbars",
|
||||
_("Show Scrollbars"),
|
||||
GTK_BOX (vbox2));
|
||||
prefs_check_button_add (config, "fullscreen-show-statusbar",
|
||||
_("Show S_tatusbar"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
||||
|
||||
prefs_enum_option_menu_add (config, "fullscreen-canvas-padding-mode", 0, 0,
|
||||
_("Canvas Padding Mode:"),
|
||||
GTK_TABLE (table), 0);
|
||||
button = prefs_color_button_add (config, "fullscreen-canvas-padding-color",
|
||||
_("Custom Padding Color:"),
|
||||
_("Select Custom Canvas Padding Color"),
|
||||
GTK_TABLE (table), 1);
|
||||
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
|
||||
gimp_get_user_context (gimp));
|
||||
|
||||
|
||||
/****************************************************************/
|
||||
/* Interface / Image Windows / Image Title & Statusbar Format */
|
||||
/****************************************************************/
|
||||
|
@ -1257,7 +1257,7 @@ image_menu_update (GtkItemFactory *item_factory,
|
||||
gint lind = -1;
|
||||
gint lnum = -1;
|
||||
gboolean fullscreen = FALSE;
|
||||
GimpDisplayShellVisibility *visibility = NULL;
|
||||
GimpDisplayShellAppearance *appearance = NULL;
|
||||
|
||||
gimp = GIMP_ITEM_FACTORY (item_factory)->gimp;
|
||||
|
||||
@ -1305,9 +1305,9 @@ image_menu_update (GtkItemFactory *item_factory,
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
if (fullscreen)
|
||||
visibility = &shell->fullscreen_visibility;
|
||||
appearance = &shell->fullscreen_appearance;
|
||||
else
|
||||
visibility = &shell->visibility;
|
||||
appearance = &shell->appearance;
|
||||
}
|
||||
|
||||
gimp_context_get_foreground (gimp_get_user_context (gimp), &fg);
|
||||
@ -1427,27 +1427,27 @@ image_menu_update (GtkItemFactory *item_factory,
|
||||
SET_SENSITIVE ("/View/Display Filters...", gdisp);
|
||||
|
||||
SET_SENSITIVE ("/View/Show Selection", gdisp);
|
||||
SET_ACTIVE ("/View/Show Selection", gdisp && visibility->selection);
|
||||
SET_ACTIVE ("/View/Show Selection", gdisp && appearance->selection);
|
||||
SET_SENSITIVE ("/View/Show Layer Boundary", gdisp);
|
||||
SET_ACTIVE ("/View/Show Layer Boundary", gdisp && visibility->active_layer);
|
||||
SET_ACTIVE ("/View/Show Layer Boundary", gdisp && appearance->active_layer);
|
||||
SET_SENSITIVE ("/View/Show Guides", gdisp);
|
||||
SET_ACTIVE ("/View/Show Guides", gdisp && visibility->guides);
|
||||
SET_ACTIVE ("/View/Show Guides", gdisp && appearance->guides);
|
||||
SET_SENSITIVE ("/View/Snap to Guides", gdisp);
|
||||
SET_ACTIVE ("/View/Snap to Guides", gdisp && shell->snap_to_guides);
|
||||
|
||||
SET_SENSITIVE ("/View/Show Grid", gdisp);
|
||||
SET_ACTIVE ("/View/Show Grid", gdisp && visibility->grid);
|
||||
SET_ACTIVE ("/View/Show Grid", gdisp && appearance->grid);
|
||||
SET_SENSITIVE ("/View/Snap to Grid", gdisp);
|
||||
SET_ACTIVE ("/View/Snap to Grid", gdisp && shell->snap_to_grid);
|
||||
|
||||
SET_SENSITIVE ("/View/Show Menubar", gdisp);
|
||||
SET_ACTIVE ("/View/Show Menubar", gdisp && visibility->menubar);
|
||||
SET_ACTIVE ("/View/Show Menubar", gdisp && appearance->menubar);
|
||||
SET_SENSITIVE ("/View/Show Rulers", gdisp);
|
||||
SET_ACTIVE ("/View/Show Rulers", gdisp && visibility->rulers);
|
||||
SET_ACTIVE ("/View/Show Rulers", gdisp && appearance->rulers);
|
||||
SET_SENSITIVE ("/View/Show Scrollbars", gdisp);
|
||||
SET_ACTIVE ("/View/Show Scrollbars", gdisp && visibility->scrollbars);
|
||||
SET_ACTIVE ("/View/Show Scrollbars", gdisp && appearance->scrollbars);
|
||||
SET_SENSITIVE ("/View/Show Statusbar", gdisp);
|
||||
SET_ACTIVE ("/View/Show Statusbar", gdisp && visibility->statusbar);
|
||||
SET_ACTIVE ("/View/Show Statusbar", gdisp && appearance->statusbar);
|
||||
|
||||
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
|
||||
|
||||
|
Reference in New Issue
Block a user