From 6805b3be8f9ad16e69d0a98183031a1aa84c855d Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 5 Aug 1998 12:38:11 +0000 Subject: [PATCH] The statusbar can now be switched off just like the rulers. --Sven --- ChangeLog | 13 +++++++ app/actions/help-commands.c | 20 +++++++++++ app/actions/help-commands.h | 1 + app/actions/plug-in-commands.c | 4 +-- app/commands.c | 20 +++++++++++ app/commands.h | 1 + app/core/gimpprojection.c | 1 + app/core/gimpprojection.h | 1 + app/dialogs/preferences-dialog.c | 38 ++++++++++++++++++++ app/display/gimpdisplay.c | 1 + app/display/gimpdisplay.h | 1 + app/display/gimpdisplayshell-draw.c | 52 ++++++++++++++++------------ app/display/gimpdisplayshell.c | 52 ++++++++++++++++------------ app/gdisplay.c | 1 + app/gdisplay.h | 1 + app/gimprc.c | 3 ++ app/gimprc.h | 1 + app/gui/commands.c | 20 +++++++++++ app/gui/commands.h | 1 + app/gui/help-commands.c | 20 +++++++++++ app/gui/help-commands.h | 1 + app/gui/menus.c | 1 + app/gui/plug-in-commands.c | 4 +-- app/gui/plug-in-menus.c | 4 +-- app/gui/preferences-dialog.c | 38 ++++++++++++++++++++ app/interface.c | 52 ++++++++++++++++------------ app/menus.c | 1 + app/menus/menus.c | 1 + app/menus/plug-in-menus.c | 4 +-- app/plug-in/gimpplugin-message.c | 4 +-- app/plug-in/gimpplugin-progress.c | 4 +-- app/plug-in/gimpplugin.c | 4 +-- app/plug-in/gimppluginmanager-call.c | 4 +-- app/plug-in/gimppluginmanager-run.c | 4 +-- app/plug-in/gimppluginmanager.c | 4 +-- app/plug-in/gimppluginshm.c | 4 +-- app/plug-in/plug-in-def.c | 4 +-- app/plug-in/plug-in-message.c | 4 +-- app/plug-in/plug-in-params.c | 4 +-- app/plug-in/plug-in-progress.c | 4 +-- app/plug-in/plug-in-run.c | 4 +-- app/plug-in/plug-in-shm.c | 4 +-- app/plug-in/plug-in.c | 4 +-- app/plug-in/plug-ins.c | 4 +-- app/plug_in.c | 4 +-- app/preferences_dialog.c | 38 ++++++++++++++++++++ app/widgets/gimpitemfactory.c | 1 + etc/gimprc.in | 11 ++++-- gimprc.in | 11 ++++-- 49 files changed, 370 insertions(+), 113 deletions(-) diff --git a/ChangeLog b/ChangeLog index 694049d028..d36a3abc63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Wed Aug 5 14:32:51 MEST 1998 Sven Neumann + + * gimprc.in + * app/commands.[ch] + * app/gdisplay.[ch] + * app/gimprc.[ch] + * app/interface.c + * app/menus.c + * app/plug_in.c + * app/preferences_dialog.c: The statusbar can now be switched off + like the rulers. Screen estate purists can make this the default + behaviour in their gimprc ;-) + 1998-08-03 Federico Mena Quintero * app/gradient.c: Fixed typo (sinuosidal -> sinusoidal). diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index a5a94d3f57..1ea667e3b0 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -603,6 +603,26 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget, gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active; } +void +view_toggle_statusbar_cmd_callback (GtkWidget *widget, + gpointer client_data) +{ + GDisplay * gdisp; + + gdisp = gdisplay_active (); + + if (!GTK_CHECK_MENU_ITEM (widget)->active) + { + if (GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_hide (gdisp->statusarea); + } + else + { + if (!GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_show (gdisp->statusarea); + } +} + void view_new_view_cmd_callback (GtkWidget *widget, gpointer client_data) diff --git a/app/actions/help-commands.h b/app/actions/help-commands.h index 5e2912aa1b..08962718bb 100644 --- a/app/actions/help-commands.h +++ b/app/actions/help-commands.h @@ -51,6 +51,7 @@ void view_zoom_1_16_callback (GtkWidget *, gpointer); void view_window_info_cmd_callback (GtkWidget *, gpointer); void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer); void view_toggle_guides_cmd_callback (GtkWidget *, gpointer); +void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer); void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer); void view_new_view_cmd_callback (GtkWidget *, gpointer); void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer); diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/commands.c b/app/commands.c index a5a94d3f57..1ea667e3b0 100644 --- a/app/commands.c +++ b/app/commands.c @@ -603,6 +603,26 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget, gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active; } +void +view_toggle_statusbar_cmd_callback (GtkWidget *widget, + gpointer client_data) +{ + GDisplay * gdisp; + + gdisp = gdisplay_active (); + + if (!GTK_CHECK_MENU_ITEM (widget)->active) + { + if (GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_hide (gdisp->statusarea); + } + else + { + if (!GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_show (gdisp->statusarea); + } +} + void view_new_view_cmd_callback (GtkWidget *widget, gpointer client_data) diff --git a/app/commands.h b/app/commands.h index 5e2912aa1b..08962718bb 100644 --- a/app/commands.h +++ b/app/commands.h @@ -51,6 +51,7 @@ void view_zoom_1_16_callback (GtkWidget *, gpointer); void view_window_info_cmd_callback (GtkWidget *, gpointer); void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer); void view_toggle_guides_cmd_callback (GtkWidget *, gpointer); +void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer); void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer); void view_new_view_cmd_callback (GtkWidget *, gpointer); void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer); diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 14347d8328..502d66b8b1 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -1141,6 +1141,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) menus_set_state ("/View/Toggle Rulers", GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0); menus_set_state ("/View/Toggle Guides", gdisp->draw_guides); menus_set_state ("/View/Snap To Guides", gdisp->snap_to_guides); + menus_set_state ("/View/Toggle Statusbar", GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0); plug_in_set_menu_sensitivity (type); } diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index cd9467d48a..c61e42080f 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -58,6 +58,7 @@ struct _GDisplay GtkWidget *hrule, *vrule; /* widgets for rulers */ GtkWidget *origin; /* widgets for rulers */ GtkWidget *popup; /* widget for popup menu */ + GtkWidget *statusarea; /* hbox holding the statusbar and stuff */ GtkWidget *statusbar; /* widget for statusbar */ GtkWidget *progressbar; /* widget for progressbar */ GtkWidget *cursor_label; /* widget for cursor position */ diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 2827663b10..ca97df982e 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -82,6 +82,8 @@ static int old_auto_save; static int old_preview_size; static int old_no_cursor_updating; static int old_show_tool_tips; +static int old_show_rulers; +static int old_show_statusbar; static int old_cubic_interpolation; static int old_confirm_on_close; static int old_save_session_info; @@ -296,6 +298,16 @@ file_prefs_save_callback (GtkWidget *widget, update = g_list_append (update, "show-tool-tips"); remove = g_list_append (remove, "dont-show-tool-tips"); } + if (show_rulers != old_show_rulers) + { + update = g_list_append (update, "show-rulers"); + remove = g_list_append (remove, "dont-show-rulers"); + } + if (show_statusbar != old_show_statusbar) + { + update = g_list_append (update, "show-statusbar"); + remove = g_list_append (remove, "dont-show-statusbar"); + } if (cubic_interpolation != old_cubic_interpolation) update = g_list_append (update, "cubic-interpolation"); if (confirm_on_close != old_confirm_on_close) @@ -443,6 +455,8 @@ file_prefs_cancel_callback (GtkWidget *widget, no_cursor_updating = old_no_cursor_updating; perfectmouse = old_perfectmouse; show_tool_tips = old_show_tool_tips; + show_rulers = old_show_rulers; + show_statusbar = old_show_statusbar; cubic_interpolation = old_cubic_interpolation; confirm_on_close = old_confirm_on_close; save_session_info = old_save_session_info; @@ -499,6 +513,10 @@ file_prefs_toggle_callback (GtkWidget *widget, perfectmouse = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &show_tool_tips) show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active; + else if (data == &show_rulers) + show_rulers = GTK_TOGGLE_BUTTON (widget)->active; + else if (data == &show_statusbar) + show_statusbar = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &cubic_interpolation) cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &confirm_on_close) @@ -713,6 +731,8 @@ file_pref_cmd_callback (GtkWidget *widget, old_preview_size = preview_size; old_no_cursor_updating = no_cursor_updating; old_show_tool_tips = show_tool_tips; + old_show_rulers = show_rulers; + old_show_statusbar = show_statusbar; old_cubic_interpolation = cubic_interpolation; old_confirm_on_close = confirm_on_close; old_save_session_info = save_session_info; @@ -1030,6 +1050,24 @@ file_pref_cmd_callback (GtkWidget *widget, &show_tool_tips); gtk_widget_show (button); + button = gtk_check_button_new_with_label("Show rulers"); + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), + show_rulers); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "toggled", + (GtkSignalFunc) file_prefs_toggle_callback, + &show_rulers); + gtk_widget_show (button); + + button = gtk_check_button_new_with_label("Show statusbar"); + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), + show_statusbar); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "toggled", + (GtkSignalFunc) file_prefs_toggle_callback, + &show_statusbar); + gtk_widget_show (button); + hbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 14347d8328..502d66b8b1 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -1141,6 +1141,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) menus_set_state ("/View/Toggle Rulers", GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0); menus_set_state ("/View/Toggle Guides", gdisp->draw_guides); menus_set_state ("/View/Snap To Guides", gdisp->snap_to_guides); + menus_set_state ("/View/Toggle Statusbar", GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0); plug_in_set_menu_sensitivity (type); } diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index cd9467d48a..c61e42080f 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -58,6 +58,7 @@ struct _GDisplay GtkWidget *hrule, *vrule; /* widgets for rulers */ GtkWidget *origin; /* widgets for rulers */ GtkWidget *popup; /* widget for popup menu */ + GtkWidget *statusarea; /* hbox holding the statusbar and stuff */ GtkWidget *statusbar; /* widget for statusbar */ GtkWidget *progressbar; /* widget for progressbar */ GtkWidget *cursor_label; /* widget for cursor position */ diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index cb1c7e391b..99b51361ac 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -553,7 +553,6 @@ create_display_shell (GDisplay* gdisp, GtkWidget *vbox; GtkWidget *table; GtkWidget *table_inner; - GtkWidget *hbox; GtkWidget *frame; GtkWidget *arrow; int n_width, n_height; @@ -627,8 +626,8 @@ create_display_shell (GDisplay* gdisp, /* hbox for statusbar area */ - hbox = gtk_hbox_new(0,2); - gtk_box_pack_start(GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + gdisp->statusarea = gtk_hbox_new(0,2); + gtk_box_pack_start(GTK_BOX (vbox), gdisp->statusarea, FALSE, TRUE, 0); /* scrollbars, rulers, canvas, menu popup button */ gdisp->origin = gtk_button_new (); @@ -702,36 +701,37 @@ create_display_shell (GDisplay* gdisp, if (! image_popup_menu) menus_get_image_menu (&image_popup_menu, &image_accel_group); - gtk_container_set_resize_mode(GTK_CONTAINER(hbox), GTK_RESIZE_QUEUE); + gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusarea), + GTK_RESIZE_QUEUE); /* cursor, statusbar, progressbar */ - frame = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), frame, FALSE, TRUE, 0); - gdisp->cursor_label = gtk_label_new(" 0000, 0000 "); + gdisp->cursor_label = gtk_label_new (" 0000, 0000 "); /* This usize should be more intelligent and get the information * size of the above string or some similar method */ - gtk_widget_set_usize(gdisp->cursor_label, 50, -1); - gtk_container_add(GTK_CONTAINER (frame), gdisp->cursor_label); + gtk_widget_set_usize (gdisp->cursor_label, 50, -1); + gtk_container_add (GTK_CONTAINER (frame), gdisp->cursor_label); - gdisp->statusbar = gtk_statusbar_new(); - gtk_widget_set_usize(gdisp->statusbar, 1, -1); + gdisp->statusbar = gtk_statusbar_new (); + gtk_widget_set_usize (gdisp->statusbar, 1, -1); gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar), GTK_RESIZE_QUEUE); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->statusbar, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->statusbar, TRUE, TRUE, 0); contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "title"); - gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar), - contextid, - title); + gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), + contextid, + title); gdisp->progressbar = gtk_progress_bar_new(); - gtk_widget_set_usize(gdisp->progressbar, 80, -1); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0); + gtk_widget_set_usize (gdisp->progressbar, 80, -1); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->progressbar, FALSE, TRUE, 0); gdisp->cancelbutton = gtk_button_new_with_label("Cancel"); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->cancelbutton, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->cancelbutton, FALSE, TRUE, 0); gtk_widget_set_sensitive (gdisp->cancelbutton, FALSE); /* the popup menu */ @@ -743,9 +743,12 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (arrow); gtk_widget_show (gdisp->hsb); gtk_widget_show (gdisp->vsb); - gtk_widget_show (gdisp->origin); - gtk_widget_show (gdisp->hrule); - gtk_widget_show (gdisp->vrule); + if (show_rulers) + { + gtk_widget_show (gdisp->origin); + gtk_widget_show (gdisp->hrule); + gtk_widget_show (gdisp->vrule); + } gtk_widget_show (gdisp->canvas); gtk_widget_show (frame); gtk_widget_show (gdisp->cursor_label); @@ -754,7 +757,10 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (gdisp->cancelbutton); gtk_widget_show (table_inner); gtk_widget_show (table); - gtk_widget_show (hbox); + if (show_statusbar) + { + gtk_widget_show (gdisp->statusarea); + } gtk_widget_show (vbox); gtk_widget_show (gdisp->shell); diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index cb1c7e391b..99b51361ac 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -553,7 +553,6 @@ create_display_shell (GDisplay* gdisp, GtkWidget *vbox; GtkWidget *table; GtkWidget *table_inner; - GtkWidget *hbox; GtkWidget *frame; GtkWidget *arrow; int n_width, n_height; @@ -627,8 +626,8 @@ create_display_shell (GDisplay* gdisp, /* hbox for statusbar area */ - hbox = gtk_hbox_new(0,2); - gtk_box_pack_start(GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + gdisp->statusarea = gtk_hbox_new(0,2); + gtk_box_pack_start(GTK_BOX (vbox), gdisp->statusarea, FALSE, TRUE, 0); /* scrollbars, rulers, canvas, menu popup button */ gdisp->origin = gtk_button_new (); @@ -702,36 +701,37 @@ create_display_shell (GDisplay* gdisp, if (! image_popup_menu) menus_get_image_menu (&image_popup_menu, &image_accel_group); - gtk_container_set_resize_mode(GTK_CONTAINER(hbox), GTK_RESIZE_QUEUE); + gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusarea), + GTK_RESIZE_QUEUE); /* cursor, statusbar, progressbar */ - frame = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), frame, FALSE, TRUE, 0); - gdisp->cursor_label = gtk_label_new(" 0000, 0000 "); + gdisp->cursor_label = gtk_label_new (" 0000, 0000 "); /* This usize should be more intelligent and get the information * size of the above string or some similar method */ - gtk_widget_set_usize(gdisp->cursor_label, 50, -1); - gtk_container_add(GTK_CONTAINER (frame), gdisp->cursor_label); + gtk_widget_set_usize (gdisp->cursor_label, 50, -1); + gtk_container_add (GTK_CONTAINER (frame), gdisp->cursor_label); - gdisp->statusbar = gtk_statusbar_new(); - gtk_widget_set_usize(gdisp->statusbar, 1, -1); + gdisp->statusbar = gtk_statusbar_new (); + gtk_widget_set_usize (gdisp->statusbar, 1, -1); gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar), GTK_RESIZE_QUEUE); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->statusbar, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->statusbar, TRUE, TRUE, 0); contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "title"); - gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar), - contextid, - title); + gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), + contextid, + title); gdisp->progressbar = gtk_progress_bar_new(); - gtk_widget_set_usize(gdisp->progressbar, 80, -1); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0); + gtk_widget_set_usize (gdisp->progressbar, 80, -1); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->progressbar, FALSE, TRUE, 0); gdisp->cancelbutton = gtk_button_new_with_label("Cancel"); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->cancelbutton, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->cancelbutton, FALSE, TRUE, 0); gtk_widget_set_sensitive (gdisp->cancelbutton, FALSE); /* the popup menu */ @@ -743,9 +743,12 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (arrow); gtk_widget_show (gdisp->hsb); gtk_widget_show (gdisp->vsb); - gtk_widget_show (gdisp->origin); - gtk_widget_show (gdisp->hrule); - gtk_widget_show (gdisp->vrule); + if (show_rulers) + { + gtk_widget_show (gdisp->origin); + gtk_widget_show (gdisp->hrule); + gtk_widget_show (gdisp->vrule); + } gtk_widget_show (gdisp->canvas); gtk_widget_show (frame); gtk_widget_show (gdisp->cursor_label); @@ -754,7 +757,10 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (gdisp->cancelbutton); gtk_widget_show (table_inner); gtk_widget_show (table); - gtk_widget_show (hbox); + if (show_statusbar) + { + gtk_widget_show (gdisp->statusarea); + } gtk_widget_show (vbox); gtk_widget_show (gdisp->shell); diff --git a/app/gdisplay.c b/app/gdisplay.c index 14347d8328..502d66b8b1 100644 --- a/app/gdisplay.c +++ b/app/gdisplay.c @@ -1141,6 +1141,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) menus_set_state ("/View/Toggle Rulers", GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0); menus_set_state ("/View/Toggle Guides", gdisp->draw_guides); menus_set_state ("/View/Snap To Guides", gdisp->snap_to_guides); + menus_set_state ("/View/Toggle Statusbar", GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0); plug_in_set_menu_sensitivity (type); } diff --git a/app/gdisplay.h b/app/gdisplay.h index cd9467d48a..c61e42080f 100644 --- a/app/gdisplay.h +++ b/app/gdisplay.h @@ -58,6 +58,7 @@ struct _GDisplay GtkWidget *hrule, *vrule; /* widgets for rulers */ GtkWidget *origin; /* widgets for rulers */ GtkWidget *popup; /* widget for popup menu */ + GtkWidget *statusarea; /* hbox holding the statusbar and stuff */ GtkWidget *statusbar; /* widget for statusbar */ GtkWidget *progressbar; /* widget for progressbar */ GtkWidget *cursor_label; /* widget for cursor position */ diff --git a/app/gimprc.c b/app/gimprc.c index b238773a4c..59b39263a7 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -107,6 +107,7 @@ int allow_resize_windows = 0; int no_cursor_updating = 0; int preview_size = 64; int show_rulers = TRUE; +int show_statusbar = TRUE; int ruler_units = GTK_PIXELS; int auto_save = TRUE; int cubic_interpolation = FALSE; @@ -213,6 +214,8 @@ static ParseFunc funcs[] = { "preview-size", TT_XPREVSIZE, NULL, NULL }, { "show-rulers", TT_BOOLEAN, &show_rulers, NULL }, { "dont-show-rulers", TT_BOOLEAN, NULL, &show_rulers }, + { "show-statusbar", TT_BOOLEAN, &show_statusbar, NULL }, + { "dont-show-statusbar", TT_BOOLEAN, NULL, &show_statusbar }, { "ruler-units", TT_XRULERUNIT, NULL, NULL }, { "auto-save", TT_BOOLEAN, &auto_save, NULL }, { "dont-auto-save", TT_BOOLEAN, NULL, &auto_save }, diff --git a/app/gimprc.h b/app/gimprc.h index 9ac412269e..8d74bdf401 100644 --- a/app/gimprc.h +++ b/app/gimprc.h @@ -52,6 +52,7 @@ extern int no_cursor_updating; extern int preview_size; extern int show_rulers; extern int ruler_units; +extern int show_statusbar; extern int auto_save; extern int cubic_interpolation; extern int confirm_on_close; diff --git a/app/gui/commands.c b/app/gui/commands.c index a5a94d3f57..1ea667e3b0 100644 --- a/app/gui/commands.c +++ b/app/gui/commands.c @@ -603,6 +603,26 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget, gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active; } +void +view_toggle_statusbar_cmd_callback (GtkWidget *widget, + gpointer client_data) +{ + GDisplay * gdisp; + + gdisp = gdisplay_active (); + + if (!GTK_CHECK_MENU_ITEM (widget)->active) + { + if (GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_hide (gdisp->statusarea); + } + else + { + if (!GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_show (gdisp->statusarea); + } +} + void view_new_view_cmd_callback (GtkWidget *widget, gpointer client_data) diff --git a/app/gui/commands.h b/app/gui/commands.h index 5e2912aa1b..08962718bb 100644 --- a/app/gui/commands.h +++ b/app/gui/commands.h @@ -51,6 +51,7 @@ void view_zoom_1_16_callback (GtkWidget *, gpointer); void view_window_info_cmd_callback (GtkWidget *, gpointer); void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer); void view_toggle_guides_cmd_callback (GtkWidget *, gpointer); +void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer); void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer); void view_new_view_cmd_callback (GtkWidget *, gpointer); void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer); diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index a5a94d3f57..1ea667e3b0 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -603,6 +603,26 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget, gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active; } +void +view_toggle_statusbar_cmd_callback (GtkWidget *widget, + gpointer client_data) +{ + GDisplay * gdisp; + + gdisp = gdisplay_active (); + + if (!GTK_CHECK_MENU_ITEM (widget)->active) + { + if (GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_hide (gdisp->statusarea); + } + else + { + if (!GTK_WIDGET_VISIBLE (gdisp->statusarea)) + gtk_widget_show (gdisp->statusarea); + } +} + void view_new_view_cmd_callback (GtkWidget *widget, gpointer client_data) diff --git a/app/gui/help-commands.h b/app/gui/help-commands.h index 5e2912aa1b..08962718bb 100644 --- a/app/gui/help-commands.h +++ b/app/gui/help-commands.h @@ -51,6 +51,7 @@ void view_zoom_1_16_callback (GtkWidget *, gpointer); void view_window_info_cmd_callback (GtkWidget *, gpointer); void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer); void view_toggle_guides_cmd_callback (GtkWidget *, gpointer); +void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer); void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer); void view_new_view_cmd_callback (GtkWidget *, gpointer); void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer); diff --git a/app/gui/menus.c b/app/gui/menus.c index ad7ace34c0..1df26abf59 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -122,6 +122,7 @@ static GtkItemFactoryEntry image_entries[] = { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Statusbar", "S", view_toggle_statusbar_cmd_callback, 0, "" }, { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, { "/View/---", NULL, NULL, 0, "" }, diff --git a/app/gui/plug-in-commands.c b/app/gui/plug-in-commands.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/gui/plug-in-commands.c +++ b/app/gui/plug-in-commands.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/gui/plug-in-menus.c b/app/gui/plug-in-menus.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/gui/plug-in-menus.c +++ b/app/gui/plug-in-menus.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 2827663b10..ca97df982e 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -82,6 +82,8 @@ static int old_auto_save; static int old_preview_size; static int old_no_cursor_updating; static int old_show_tool_tips; +static int old_show_rulers; +static int old_show_statusbar; static int old_cubic_interpolation; static int old_confirm_on_close; static int old_save_session_info; @@ -296,6 +298,16 @@ file_prefs_save_callback (GtkWidget *widget, update = g_list_append (update, "show-tool-tips"); remove = g_list_append (remove, "dont-show-tool-tips"); } + if (show_rulers != old_show_rulers) + { + update = g_list_append (update, "show-rulers"); + remove = g_list_append (remove, "dont-show-rulers"); + } + if (show_statusbar != old_show_statusbar) + { + update = g_list_append (update, "show-statusbar"); + remove = g_list_append (remove, "dont-show-statusbar"); + } if (cubic_interpolation != old_cubic_interpolation) update = g_list_append (update, "cubic-interpolation"); if (confirm_on_close != old_confirm_on_close) @@ -443,6 +455,8 @@ file_prefs_cancel_callback (GtkWidget *widget, no_cursor_updating = old_no_cursor_updating; perfectmouse = old_perfectmouse; show_tool_tips = old_show_tool_tips; + show_rulers = old_show_rulers; + show_statusbar = old_show_statusbar; cubic_interpolation = old_cubic_interpolation; confirm_on_close = old_confirm_on_close; save_session_info = old_save_session_info; @@ -499,6 +513,10 @@ file_prefs_toggle_callback (GtkWidget *widget, perfectmouse = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &show_tool_tips) show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active; + else if (data == &show_rulers) + show_rulers = GTK_TOGGLE_BUTTON (widget)->active; + else if (data == &show_statusbar) + show_statusbar = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &cubic_interpolation) cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &confirm_on_close) @@ -713,6 +731,8 @@ file_pref_cmd_callback (GtkWidget *widget, old_preview_size = preview_size; old_no_cursor_updating = no_cursor_updating; old_show_tool_tips = show_tool_tips; + old_show_rulers = show_rulers; + old_show_statusbar = show_statusbar; old_cubic_interpolation = cubic_interpolation; old_confirm_on_close = confirm_on_close; old_save_session_info = save_session_info; @@ -1030,6 +1050,24 @@ file_pref_cmd_callback (GtkWidget *widget, &show_tool_tips); gtk_widget_show (button); + button = gtk_check_button_new_with_label("Show rulers"); + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), + show_rulers); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "toggled", + (GtkSignalFunc) file_prefs_toggle_callback, + &show_rulers); + gtk_widget_show (button); + + button = gtk_check_button_new_with_label("Show statusbar"); + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), + show_statusbar); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "toggled", + (GtkSignalFunc) file_prefs_toggle_callback, + &show_statusbar); + gtk_widget_show (button); + hbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); diff --git a/app/interface.c b/app/interface.c index cb1c7e391b..99b51361ac 100644 --- a/app/interface.c +++ b/app/interface.c @@ -553,7 +553,6 @@ create_display_shell (GDisplay* gdisp, GtkWidget *vbox; GtkWidget *table; GtkWidget *table_inner; - GtkWidget *hbox; GtkWidget *frame; GtkWidget *arrow; int n_width, n_height; @@ -627,8 +626,8 @@ create_display_shell (GDisplay* gdisp, /* hbox for statusbar area */ - hbox = gtk_hbox_new(0,2); - gtk_box_pack_start(GTK_BOX (vbox), hbox, FALSE, TRUE, 0); + gdisp->statusarea = gtk_hbox_new(0,2); + gtk_box_pack_start(GTK_BOX (vbox), gdisp->statusarea, FALSE, TRUE, 0); /* scrollbars, rulers, canvas, menu popup button */ gdisp->origin = gtk_button_new (); @@ -702,36 +701,37 @@ create_display_shell (GDisplay* gdisp, if (! image_popup_menu) menus_get_image_menu (&image_popup_menu, &image_accel_group); - gtk_container_set_resize_mode(GTK_CONTAINER(hbox), GTK_RESIZE_QUEUE); + gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusarea), + GTK_RESIZE_QUEUE); /* cursor, statusbar, progressbar */ - frame = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), frame, FALSE, TRUE, 0); - gdisp->cursor_label = gtk_label_new(" 0000, 0000 "); + gdisp->cursor_label = gtk_label_new (" 0000, 0000 "); /* This usize should be more intelligent and get the information * size of the above string or some similar method */ - gtk_widget_set_usize(gdisp->cursor_label, 50, -1); - gtk_container_add(GTK_CONTAINER (frame), gdisp->cursor_label); + gtk_widget_set_usize (gdisp->cursor_label, 50, -1); + gtk_container_add (GTK_CONTAINER (frame), gdisp->cursor_label); - gdisp->statusbar = gtk_statusbar_new(); - gtk_widget_set_usize(gdisp->statusbar, 1, -1); + gdisp->statusbar = gtk_statusbar_new (); + gtk_widget_set_usize (gdisp->statusbar, 1, -1); gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar), GTK_RESIZE_QUEUE); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->statusbar, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->statusbar, TRUE, TRUE, 0); contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar), "title"); - gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar), - contextid, - title); + gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), + contextid, + title); gdisp->progressbar = gtk_progress_bar_new(); - gtk_widget_set_usize(gdisp->progressbar, 80, -1); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0); + gtk_widget_set_usize (gdisp->progressbar, 80, -1); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->progressbar, FALSE, TRUE, 0); gdisp->cancelbutton = gtk_button_new_with_label("Cancel"); - gtk_box_pack_start (GTK_BOX (hbox), gdisp->cancelbutton, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->cancelbutton, FALSE, TRUE, 0); gtk_widget_set_sensitive (gdisp->cancelbutton, FALSE); /* the popup menu */ @@ -743,9 +743,12 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (arrow); gtk_widget_show (gdisp->hsb); gtk_widget_show (gdisp->vsb); - gtk_widget_show (gdisp->origin); - gtk_widget_show (gdisp->hrule); - gtk_widget_show (gdisp->vrule); + if (show_rulers) + { + gtk_widget_show (gdisp->origin); + gtk_widget_show (gdisp->hrule); + gtk_widget_show (gdisp->vrule); + } gtk_widget_show (gdisp->canvas); gtk_widget_show (frame); gtk_widget_show (gdisp->cursor_label); @@ -754,7 +757,10 @@ create_display_shell (GDisplay* gdisp, gtk_widget_show (gdisp->cancelbutton); gtk_widget_show (table_inner); gtk_widget_show (table); - gtk_widget_show (hbox); + if (show_statusbar) + { + gtk_widget_show (gdisp->statusarea); + } gtk_widget_show (vbox); gtk_widget_show (gdisp->shell); diff --git a/app/menus.c b/app/menus.c index ad7ace34c0..1df26abf59 100644 --- a/app/menus.c +++ b/app/menus.c @@ -122,6 +122,7 @@ static GtkItemFactoryEntry image_entries[] = { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Statusbar", "S", view_toggle_statusbar_cmd_callback, 0, "" }, { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, { "/View/---", NULL, NULL, 0, "" }, diff --git a/app/menus/menus.c b/app/menus/menus.c index ad7ace34c0..1df26abf59 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -122,6 +122,7 @@ static GtkItemFactoryEntry image_entries[] = { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Statusbar", "S", view_toggle_statusbar_cmd_callback, 0, "" }, { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, { "/View/---", NULL, NULL, 0, "" }, diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-in-def.c b/app/plug-in/plug-in-def.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-in-def.c +++ b/app/plug-in/plug-in-def.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/plug_in.c b/app/plug_in.c index f6d7fa24f2..ac7307b6a0 100644 --- a/app/plug_in.c +++ b/app/plug_in.c @@ -3006,8 +3006,8 @@ plug_in_progress_init (PlugIn *plug_in, if (gdisp_ID > 0) gdisp = gdisplay_get_ID(gdisp_ID); - if (gdisp_ID > 0 && (gdisp->progressid == 0 || - plug_in->progress_gdisp_ID > 0)) + if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea) + && (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0)) { context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar), "progress"); diff --git a/app/preferences_dialog.c b/app/preferences_dialog.c index 2827663b10..ca97df982e 100644 --- a/app/preferences_dialog.c +++ b/app/preferences_dialog.c @@ -82,6 +82,8 @@ static int old_auto_save; static int old_preview_size; static int old_no_cursor_updating; static int old_show_tool_tips; +static int old_show_rulers; +static int old_show_statusbar; static int old_cubic_interpolation; static int old_confirm_on_close; static int old_save_session_info; @@ -296,6 +298,16 @@ file_prefs_save_callback (GtkWidget *widget, update = g_list_append (update, "show-tool-tips"); remove = g_list_append (remove, "dont-show-tool-tips"); } + if (show_rulers != old_show_rulers) + { + update = g_list_append (update, "show-rulers"); + remove = g_list_append (remove, "dont-show-rulers"); + } + if (show_statusbar != old_show_statusbar) + { + update = g_list_append (update, "show-statusbar"); + remove = g_list_append (remove, "dont-show-statusbar"); + } if (cubic_interpolation != old_cubic_interpolation) update = g_list_append (update, "cubic-interpolation"); if (confirm_on_close != old_confirm_on_close) @@ -443,6 +455,8 @@ file_prefs_cancel_callback (GtkWidget *widget, no_cursor_updating = old_no_cursor_updating; perfectmouse = old_perfectmouse; show_tool_tips = old_show_tool_tips; + show_rulers = old_show_rulers; + show_statusbar = old_show_statusbar; cubic_interpolation = old_cubic_interpolation; confirm_on_close = old_confirm_on_close; save_session_info = old_save_session_info; @@ -499,6 +513,10 @@ file_prefs_toggle_callback (GtkWidget *widget, perfectmouse = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &show_tool_tips) show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active; + else if (data == &show_rulers) + show_rulers = GTK_TOGGLE_BUTTON (widget)->active; + else if (data == &show_statusbar) + show_statusbar = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &cubic_interpolation) cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active; else if (data == &confirm_on_close) @@ -713,6 +731,8 @@ file_pref_cmd_callback (GtkWidget *widget, old_preview_size = preview_size; old_no_cursor_updating = no_cursor_updating; old_show_tool_tips = show_tool_tips; + old_show_rulers = show_rulers; + old_show_statusbar = show_statusbar; old_cubic_interpolation = cubic_interpolation; old_confirm_on_close = confirm_on_close; old_save_session_info = save_session_info; @@ -1030,6 +1050,24 @@ file_pref_cmd_callback (GtkWidget *widget, &show_tool_tips); gtk_widget_show (button); + button = gtk_check_button_new_with_label("Show rulers"); + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), + show_rulers); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "toggled", + (GtkSignalFunc) file_prefs_toggle_callback, + &show_rulers); + gtk_widget_show (button); + + button = gtk_check_button_new_with_label("Show statusbar"); + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), + show_statusbar); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (button), "toggled", + (GtkSignalFunc) file_prefs_toggle_callback, + &show_statusbar); + gtk_widget_show (button); + hbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index ad7ace34c0..1df26abf59 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -122,6 +122,7 @@ static GtkItemFactoryEntry image_entries[] = { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Statusbar", "S", view_toggle_statusbar_cmd_callback, 0, "" }, { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, { "/View/---", NULL, NULL, 0, "" }, diff --git a/etc/gimprc.in b/etc/gimprc.in index 9c6d199794..5fdf46f125 100644 --- a/etc/gimprc.in +++ b/etc/gimprc.in @@ -147,8 +147,9 @@ # (dont-show-tool-tips) # Controlling ruler visibility -# The default behavior is for rulers to be ON -# This can also be toggled with the View->Show Rulers command or shift+control+r +# The default behavior is for rulers to be ON. +# This can also be toggled with the View->Toggle Rulers command +# or shift+control+r # (dont-show-rulers) # Ruler units @@ -156,6 +157,12 @@ # The default is pixels (ruler-units pixels) +# Controlling statusbar visibility +# The default behavior is to show the statusbar. +# This can also be toggled with the View->Toggle Statusbar command +# or shift+control+s +# (dont-show-statusbar) + # Disable auto saving # Auto saving is not yet implemented! Nothing will be auto-saved, no matter # how you set this here. diff --git a/gimprc.in b/gimprc.in index 9c6d199794..5fdf46f125 100644 --- a/gimprc.in +++ b/gimprc.in @@ -147,8 +147,9 @@ # (dont-show-tool-tips) # Controlling ruler visibility -# The default behavior is for rulers to be ON -# This can also be toggled with the View->Show Rulers command or shift+control+r +# The default behavior is for rulers to be ON. +# This can also be toggled with the View->Toggle Rulers command +# or shift+control+r # (dont-show-rulers) # Ruler units @@ -156,6 +157,12 @@ # The default is pixels (ruler-units pixels) +# Controlling statusbar visibility +# The default behavior is to show the statusbar. +# This can also be toggled with the View->Toggle Statusbar command +# or shift+control+s +# (dont-show-statusbar) + # Disable auto saving # Auto saving is not yet implemented! Nothing will be auto-saved, no matter # how you set this here.