Move image window related functions together (menubar and statusbar)

This commit is contained in:
Michael Natterer
2009-09-25 01:18:22 +02:00
parent 5804e80ad0
commit e7e8759710
2 changed files with 39 additions and 38 deletions

View File

@ -72,12 +72,13 @@ gimp_display_shell_appearance_update (GimpDisplayShell *shell)
gimp_display_shell_set_show_menubar (shell,
options->show_menubar);
gimp_display_shell_set_show_statusbar (shell,
options->show_statusbar);
gimp_display_shell_set_show_rulers (shell,
options->show_rulers);
gimp_display_shell_set_show_scrollbars (shell,
options->show_scrollbars);
gimp_display_shell_set_show_statusbar (shell,
options->show_statusbar);
gimp_display_shell_set_show_selection (shell,
options->show_selection);
gimp_display_shell_set_show_layer (shell,
@ -129,6 +130,38 @@ gimp_display_shell_get_show_menubar (const GimpDisplayShell *shell)
return appearance_get_options (shell)->show_menubar;
}
void
gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
gboolean show)
{
GimpDisplayOptions *options;
GtkWidget *toplevel;
GimpImageWindow *window;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
options = appearance_get_options (shell);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));
window = GIMP_IMAGE_WINDOW (toplevel);
g_object_set (options, "show-statusbar", show, NULL);
if (gimp_image_window_get_active_display (window) == shell->display)
{
gimp_statusbar_set_visible (GIMP_STATUSBAR (window->statusbar), show);
}
appearance_set_action_active (shell, "view-show-statusbar", show);
}
gboolean
gimp_display_shell_get_show_statusbar (const GimpDisplayShell *shell)
{
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
return appearance_get_options (shell)->show_statusbar;
}
void
gimp_display_shell_set_show_rulers (GimpDisplayShell *shell,
gboolean show)
@ -229,38 +262,6 @@ gimp_display_shell_get_show_scrollbars (const GimpDisplayShell *shell)
return appearance_get_options (shell)->show_scrollbars;
}
void
gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
gboolean show)
{
GimpDisplayOptions *options;
GtkWidget *toplevel;
GimpImageWindow *window;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
options = appearance_get_options (shell);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));
window = GIMP_IMAGE_WINDOW (toplevel);
g_object_set (options, "show-statusbar", show, NULL);
if (gimp_image_window_get_active_display (window) == shell->display)
{
gimp_statusbar_set_visible (GIMP_STATUSBAR (window->statusbar), show);
}
appearance_set_action_active (shell, "view-show-statusbar", show);
}
gboolean
gimp_display_shell_get_show_statusbar (const GimpDisplayShell *shell)
{
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
return appearance_get_options (shell)->show_statusbar;
}
void
gimp_display_shell_set_show_selection (GimpDisplayShell *shell,
gboolean show)

View File

@ -25,6 +25,10 @@ void gimp_display_shell_set_show_menubar (GimpDisplayShell *sh
gboolean show);
gboolean gimp_display_shell_get_show_menubar (const GimpDisplayShell *shell);
void gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
gboolean show);
gboolean gimp_display_shell_get_show_statusbar (const GimpDisplayShell *shell);
void gimp_display_shell_set_show_rulers (GimpDisplayShell *shell,
gboolean show);
gboolean gimp_display_shell_get_show_rulers (const GimpDisplayShell *shell);
@ -33,10 +37,6 @@ void gimp_display_shell_set_show_scrollbars (GimpDisplayShell *sh
gboolean show);
gboolean gimp_display_shell_get_show_scrollbars (const GimpDisplayShell *shell);
void gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
gboolean show);
gboolean gimp_display_shell_get_show_statusbar (const GimpDisplayShell *shell);
void gimp_display_shell_set_show_selection (GimpDisplayShell *shell,
gboolean show);
gboolean gimp_display_shell_get_show_selection (const GimpDisplayShell *shell);