[gimp] Move the statusbar to GimpImageWindow



commit 10b98034d435d5384fd5869013d43606918a4afa
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 23 17:55:41 2009 +0200

    Move the statusbar to GimpImageWindow
    
    As with the menubar, port some code properly, and add some
    horrible /* FIXME image window */ hacks to make it work.

 app/actions/actions.c                     |   12 ++++--
 app/display/gimpdisplay-handlers.c        |    6 ++-
 app/display/gimpdisplay.c                 |    3 +-
 app/display/gimpdisplayshell-appearance.c |   10 +----
 app/display/gimpdisplayshell-cursor.c     |    6 ++-
 app/display/gimpdisplayshell-progress.c   |   36 +++++++++++-----
 app/display/gimpdisplayshell-title.c      |    6 ++-
 app/display/gimpdisplayshell.c            |   64 ++++++----------------------
 app/display/gimpdisplayshell.h            |    2 -
 app/display/gimpimagewindow.c             |   45 ++++++++++++++++++++
 app/display/gimpimagewindow.h             |    1 +
 app/gui/gui.c                             |   10 +++--
 app/tools/gimpmeasuretool.c               |    3 +-
 app/tools/gimptool.c                      |   52 ++++++++++++++---------
 14 files changed, 147 insertions(+), 109 deletions(-)
---
diff --git a/app/actions/actions.c b/app/actions/actions.c
index d33a260..80d5d21 100644
--- a/app/actions/actions.c
+++ b/app/actions/actions.c
@@ -610,9 +610,13 @@ action_message (GimpDisplay *display,
                 const gchar *format,
                 ...)
 {
-  GimpDisplayShell *shell    = GIMP_DISPLAY_SHELL (display->shell);
-  const gchar      *stock_id = NULL;
-  va_list           args;
+  GtkWidget   *toplevel;
+  GtkWidget   *statusbar;
+  const gchar *stock_id = NULL;
+  va_list      args;
+
+  toplevel  = gtk_widget_get_toplevel (display->shell);
+  statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
   if (GIMP_IS_TOOL_OPTIONS (object))
     {
@@ -626,7 +630,7 @@ action_message (GimpDisplay *display,
     }
 
   va_start (args, format);
-  gimp_statusbar_push_temp_valist (GIMP_STATUSBAR (shell->statusbar),
+  gimp_statusbar_push_temp_valist (GIMP_STATUSBAR (statusbar),
                                    GIMP_MESSAGE_INFO, stock_id,
                                    format, args);
   va_end (args);
diff --git a/app/display/gimpdisplay-handlers.c b/app/display/gimpdisplay-handlers.c
index 3605466..3b4d3db 100644
--- a/app/display/gimpdisplay-handlers.c
+++ b/app/display/gimpdisplay-handlers.c
@@ -162,7 +162,8 @@ gimp_display_saved_handler (GimpImage   *image,
                             const gchar *uri,
                             GimpDisplay *display)
 {
-  GtkWidget *statusbar = GIMP_DISPLAY_SHELL (display->shell)->statusbar;
+  /* FIXME image window */
+  GtkWidget *statusbar = GIMP_IMAGE_WINDOW (display->shell)->statusbar;
   gchar     *filename  = file_utils_uri_display_name (uri);
 
   gimp_statusbar_push_temp (GIMP_STATUSBAR (statusbar), GIMP_MESSAGE_INFO,
@@ -176,7 +177,8 @@ gimp_display_exported_handler (GimpImage   *image,
                                const gchar *uri,
                                GimpDisplay *display)
 {
-  GtkWidget *statusbar = GIMP_DISPLAY_SHELL (display->shell)->statusbar;
+  /* FIXME image window */
+  GtkWidget *statusbar = GIMP_IMAGE_WINDOW (display->shell)->statusbar;
   gchar     *filename  = file_utils_uri_display_name (uri);
 
   gimp_statusbar_push_temp (GIMP_STATUSBAR (statusbar), GIMP_MESSAGE_INFO,
diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c
index a00a5ad..92ebc22 100644
--- a/app/display/gimpdisplay.c
+++ b/app/display/gimpdisplay.c
@@ -386,7 +386,8 @@ gimp_display_new (Gimp              *gimp,
                                            display_factory);
   gtk_widget_show (display->shell);
 
-  g_signal_connect (GIMP_DISPLAY_SHELL (display->shell)->statusbar, "cancel",
+  /* FIXME image window */
+  g_signal_connect (GIMP_IMAGE_WINDOW (display->shell)->statusbar, "cancel",
                     G_CALLBACK (gimp_display_progress_canceled),
                     display);
 
diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c
index e41d107..9bcdab9 100644
--- a/app/display/gimpdisplayshell-appearance.c
+++ b/app/display/gimpdisplayshell-appearance.c
@@ -73,18 +73,11 @@ void
 gimp_display_shell_appearance_update (GimpDisplayShell *shell)
 {
   GimpDisplayOptions *options;
-  gboolean            fullscreen;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
   options = GET_OPTIONS (shell);
 
-  /* FIXME temp image window hack */
-  fullscreen = gimp_image_window_get_fullscreen (GIMP_IMAGE_WINDOW (shell));
-
-  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (shell->statusbar),
-                                     ! fullscreen);
-
   gimp_display_shell_set_show_menubar       (shell,
                                              options->show_menubar);
   gimp_display_shell_set_show_rulers        (shell,
@@ -264,7 +257,8 @@ gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
 
   g_object_set (options, "show-statusbar", show, NULL);
 
-  gimp_statusbar_set_visible (GIMP_STATUSBAR (shell->statusbar), show);
+  /* FIXME image window */
+  gimp_statusbar_set_visible (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar), show);
 
   /* FIXME image window */
   SET_ACTIVE (GIMP_IMAGE_WINDOW (shell)->menubar_manager, "view-show-statusbar", show);
diff --git a/app/display/gimpdisplayshell-cursor.c b/app/display/gimpdisplayshell-cursor.c
index d20ddbd..55fa10c 100644
--- a/app/display/gimpdisplayshell-cursor.c
+++ b/app/display/gimpdisplayshell-cursor.c
@@ -159,7 +159,8 @@ gimp_display_shell_update_cursor (GimpDisplayShell    *shell,
   /*  use the passed image_coords for the statusbar because they are
    *  possibly snapped...
    */
-  gimp_statusbar_update_cursor (GIMP_STATUSBAR (shell->statusbar),
+  /* FIXME image window */
+  gimp_statusbar_update_cursor (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar),
                                 precision, image_x, image_y);
 
   factory = gimp_dialog_factory_from_name ("dock");
@@ -196,7 +197,8 @@ gimp_display_shell_clear_cursor (GimpDisplayShell *shell)
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
-  gimp_statusbar_clear_cursor (GIMP_STATUSBAR (shell->statusbar));
+  /* FIXME image window */
+  gimp_statusbar_clear_cursor (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar));
 
   factory = gimp_dialog_factory_from_name ("dock");
   session_info = gimp_dialog_factory_find_session_info (factory,
diff --git a/app/display/gimpdisplayshell-progress.c b/app/display/gimpdisplayshell-progress.c
index 79aecc2..cb9307f 100644
--- a/app/display/gimpdisplayshell-progress.c
+++ b/app/display/gimpdisplayshell-progress.c
@@ -46,7 +46,8 @@ gimp_display_shell_progress_start (GimpProgress *progress,
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
 
-  progress = gimp_progress_start (GIMP_PROGRESS (shell->statusbar),
+  /* FIXME image window */
+  progress = gimp_progress_start (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar),
                                   message, cancelable);
 
   if (progress && gimp_display_shell_is_iconified (shell))
@@ -62,7 +63,8 @@ gimp_display_shell_progress_end (GimpProgress *progress)
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
 
-  gimp_progress_end (GIMP_PROGRESS (shell->statusbar));
+  /* FIXME image window */
+  gimp_progress_end (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar));
 
   if (gimp_display_shell_is_iconified (shell))
     gimp_display_shell_title_update (shell);
@@ -73,7 +75,8 @@ gimp_display_shell_progress_is_active (GimpProgress *progress)
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
 
-  return gimp_progress_is_active (GIMP_PROGRESS (shell->statusbar));
+  /* FIXME image window */
+  return gimp_progress_is_active (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar));
 }
 
 static void
@@ -82,9 +85,11 @@ gimp_display_shell_progress_set_text (GimpProgress *progress,
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
 
-  gimp_progress_set_text (GIMP_PROGRESS (shell->statusbar), message);
+  /* FIXME image window */
+  gimp_progress_set_text (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar), message);
 
-  if (gimp_progress_is_active (GIMP_PROGRESS (shell->statusbar)) &&
+  /* FIXME image window */
+  if (gimp_progress_is_active (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar)) &&
       gimp_display_shell_is_iconified (shell))
     {
       gtk_window_set_title (GTK_WINDOW (shell), message);
@@ -97,7 +102,8 @@ gimp_display_shell_progress_set_value (GimpProgress *progress,
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
 
-  gimp_progress_set_value (GIMP_PROGRESS (shell->statusbar), percentage);
+  /* FIXME image window */
+  gimp_progress_set_value (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar), percentage);
 }
 
 static gdouble
@@ -105,7 +111,8 @@ gimp_display_shell_progress_get_value (GimpProgress *progress)
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
 
-  return gimp_progress_get_value (GIMP_PROGRESS (shell->statusbar));
+  /* FIXME image window */
+  return gimp_progress_get_value (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar));
 }
 
 static void
@@ -113,7 +120,8 @@ gimp_display_shell_progress_pulse (GimpProgress *progress)
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
 
-  gimp_progress_pulse (GIMP_PROGRESS (shell->statusbar));
+  /* FIXME image window */
+  gimp_progress_pulse (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar));
 }
 
 static guint32
@@ -141,17 +149,20 @@ gimp_display_shell_progress_message (GimpProgress        *progress,
 
     case GIMP_MESSAGE_WARNING:
       /* warning messages go to the statusbar, if it's visible */
-      if (! gimp_statusbar_get_visible (GIMP_STATUSBAR (shell->statusbar)))
+      /* FIXME image window */
+      if (! gimp_statusbar_get_visible (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar)))
         break;
       else
-	return gimp_progress_message (GIMP_PROGRESS (shell->statusbar), gimp,
+        /* FIXME image window */
+	return gimp_progress_message (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar), gimp,
 				      severity, domain, message);
 
     case GIMP_MESSAGE_INFO:
       /* info messages go to the statusbar;
        * if they are not handled there, they are swallowed
        */
-      gimp_progress_message (GIMP_PROGRESS (shell->statusbar), gimp,
+      /* FIXME image window */
+      gimp_progress_message (GIMP_PROGRESS (GIMP_IMAGE_WINDOW (shell)->statusbar), gimp,
 			     severity, domain, message);
       return TRUE;
     }
@@ -193,7 +204,8 @@ gimp_display_shell_progress_window_state_changed (GimpDisplayShell *shell)
 
   if (gimp_display_shell_is_iconified (shell))
     {
-      const gchar *msg = gimp_statusbar_peek (GIMP_STATUSBAR (shell->statusbar),
+      /* FIXME image window */
+      const gchar *msg = gimp_statusbar_peek (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar),
                                               "progress");
       if (msg)
         {
diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c
index b38e8e8..48469fb 100644
--- a/app/display/gimpdisplayshell-title.c
+++ b/app/display/gimpdisplayshell-title.c
@@ -114,14 +114,16 @@ gimp_display_shell_update_title_idle (gpointer data)
       gimp_display_shell_format_title (shell, title, sizeof (title),
                                        config->image_status_format);
 
-      gimp_statusbar_replace (GIMP_STATUSBAR (shell->statusbar), "title",
+      /* FIXME image window */
+      gimp_statusbar_replace (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar), "title",
                               NULL, "%s", title);
     }
   else
     {
       gtk_window_set_title (GTK_WINDOW (shell), GIMP_NAME);
 
-      gimp_statusbar_replace (GIMP_STATUSBAR (shell->statusbar), "title",
+      /* FIXME image window */
+      gimp_statusbar_replace (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar), "title",
                               NULL, " ");
     }
 
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 57e8208..90b9b94 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -132,11 +132,6 @@ static void      gimp_display_shell_menu_position  (GtkMenu          *menu,
                                                     gint             *x,
                                                     gint             *y,
                                                     gpointer          data);
-static void      gimp_display_shell_show_tooltip   (GimpUIManager    *manager,
-                                                    const gchar      *tooltip,
-                                                    GimpDisplayShell *shell);
-static void      gimp_display_shell_hide_tooltip   (GimpUIManager    *manager,
-                                                    GimpDisplayShell *shell);
 
 static const guint8 * gimp_display_shell_get_icc_profile
                                                    (GimpColorManaged *managed,
@@ -291,8 +286,6 @@ gimp_display_shell_init (GimpDisplayShell *shell)
   shell->zoom_button            = NULL;
   shell->nav_ebox               = NULL;
 
-  shell->statusbar              = NULL;
-
   shell->render_buf             = g_new (guchar,
                                          GIMP_DISPLAY_RENDER_BUF_WIDTH  *
                                          GIMP_DISPLAY_RENDER_BUF_HEIGHT * 3);
@@ -686,7 +679,8 @@ gimp_display_shell_style_set (GtkWidget *widget,
 
   GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
 
-  gtk_widget_size_request (shell->statusbar, &requisition);
+  /* FIXME image window */
+  gtk_widget_size_request (GIMP_IMAGE_WINDOW (shell)->statusbar, &requisition);
 
   geometry.min_height = 23;
 
@@ -746,22 +740,6 @@ gimp_display_shell_menu_position (GtkMenu  *menu,
   gimp_button_menu_position (GTK_WIDGET (data), menu, GTK_POS_RIGHT, x, y);
 }
 
-static void
-gimp_display_shell_show_tooltip (GimpUIManager    *manager,
-                                 const gchar      *tooltip,
-                                 GimpDisplayShell *shell)
-{
-  gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "menu-tooltip",
-                       NULL, "%s", tooltip);
-}
-
-static void
-gimp_display_shell_hide_tooltip (GimpUIManager    *manager,
-                                 GimpDisplayShell *shell)
-{
-  gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "menu-tooltip");
-}
-
 static const guint8 *
 gimp_display_shell_get_icc_profile (GimpColorManaged *managed,
                                     gsize            *len)
@@ -871,6 +849,7 @@ gimp_display_shell_new (GimpDisplay       *display,
 
   shell->display = display;
 
+  shell->popup_manager   = popup_manager;
   shell->display_factory = display_factory;
 
   if (display->image)
@@ -920,16 +899,6 @@ gimp_display_shell_new (GimpDisplay       *display,
       shell_height = image_height;
     }
 
-  shell->popup_manager = popup_manager;
-
-  /* FIXME image window */
-  g_signal_connect (GIMP_IMAGE_WINDOW (shell)->menubar_manager, "show-tooltip",
-                    G_CALLBACK (gimp_display_shell_show_tooltip),
-                    shell);
-  g_signal_connect (GIMP_IMAGE_WINDOW (shell)->menubar_manager, "hide-tooltip",
-                    G_CALLBACK (gimp_display_shell_hide_tooltip),
-                    shell);
-
   gimp_display_shell_sync_config (shell, display->config);
 
   /*  GtkTable widgets are not able to shrink a row/column correctly if
@@ -1213,13 +1182,6 @@ gimp_display_shell_new (GimpDisplay       *display,
                            _("Navigate the image display"),
                            GIMP_HELP_IMAGE_WINDOW_NAV_BUTTON);
 
-  /*  create the contents of the status area *********************************/
-
-  /*  the statusbar  */
-  shell->statusbar = gimp_statusbar_new (shell);
-  gimp_help_set_help_data (shell->statusbar, NULL,
-                           GIMP_HELP_IMAGE_WINDOW_STATUS_BAR);
-
   /*  pack all the widgets  **************************************************/
 
   /*  fill the inner_table  */
@@ -1247,9 +1209,6 @@ gimp_display_shell_new (GimpDisplay       *display,
   gtk_box_pack_start (GTK_BOX (lower_hbox),
                       shell->nav_ebox, FALSE, FALSE, 0);
 
-  gtk_box_pack_end (GTK_BOX (GIMP_IMAGE_WINDOW (shell)->main_vbox),
-                    shell->statusbar, FALSE, FALSE, 0);
-
   /*  show everything  *******************************************************/
 
   if (options->show_rulers)
@@ -1271,7 +1230,8 @@ gimp_display_shell_new (GimpDisplay       *display,
     }
 
   if (options->show_statusbar)
-    gtk_widget_show (shell->statusbar);
+    /* FIXME image window */
+    gtk_widget_show (GIMP_IMAGE_WINDOW (shell)->statusbar);
 
   /*  add display filter for color management  */
 
@@ -1298,7 +1258,8 @@ gimp_display_shell_new (GimpDisplay       *display,
     }
   else
     {
-      gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
+      /* FIXME image window */
+      gimp_statusbar_empty (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar));
       gimp_dialog_factory_add_foreign (display_factory,
                                        "gimp-empty-image-window",
                                        GTK_WIDGET (shell));
@@ -1388,7 +1349,8 @@ gimp_display_shell_empty (GimpDisplayShell *shell)
 
   gimp_display_shell_unset_cursor (shell);
 
-  gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
+  /* FIXME image window */
+  gimp_statusbar_empty (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar));
 
   gimp_display_shell_appearance_update (shell);
 
@@ -1441,7 +1403,8 @@ gimp_display_shell_fill (GimpDisplayShell *shell,
   gimp_display_shell_set_initial_scale (shell, scale, NULL, NULL);
   gimp_display_shell_scale_changed (shell);
 
-  gimp_statusbar_fill (GIMP_STATUSBAR (shell->statusbar));
+  /* FIXME image window */
+  gimp_statusbar_fill (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar));
 
   gimp_display_shell_sync_config (shell, shell->display->config);
 
@@ -1947,8 +1910,9 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell,
 
   if (resize)
     {
-      if (width < shell->statusbar->requisition.width)
-        width = shell->statusbar->requisition.width;
+      /* FIXME image window */
+      if (width < GIMP_IMAGE_WINDOW (shell)->statusbar->requisition.width)
+        width = GIMP_IMAGE_WINDOW (shell)->statusbar->requisition.width;
 
       width  = width  + border_width;
       height = height + border_height;
diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h
index a8296a1..147d6cf 100644
--- a/app/display/gimpdisplayshell.h
+++ b/app/display/gimpdisplayshell.h
@@ -144,8 +144,6 @@ struct _GimpDisplayShell
   GtkWidget         *zoom_button;      /*  NE: zoom toggle button             */
   GtkWidget         *nav_ebox;         /*  SE: navigation event box           */
 
-  GtkWidget         *statusbar;        /*  statusbar                          */
-
   guchar            *render_buf;       /*  buffer for rendering the image     */
 
   guint              title_idle_id;    /*  title update idle ID               */
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 9a1f9e5..af2b777 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -26,6 +26,7 @@
 
 #include "widgets/gimpactiongroup.h"
 #include "widgets/gimpdialogfactory.h"
+#include "widgets/gimphelp-ids.h"
 #include "widgets/gimpmenufactory.h"
 #include "widgets/gimpuimanager.h"
 
@@ -33,6 +34,7 @@
 #include "gimpdisplay-foreach.h"
 #include "gimpdisplayshell.h"
 #include "gimpimagewindow.h"
+#include "gimpstatusbar.h"
 
 #include "gimp-log.h"
 #include "gimp-intl.h"
@@ -65,6 +67,12 @@ static void      gimp_image_window_destroy      (GtkObject           *object);
 static gboolean  gimp_image_window_window_state (GtkWidget           *widget,
                                                  GdkEventWindowState *event);
 
+static void      gimp_image_window_show_tooltip (GimpUIManager       *manager,
+                                                 const gchar         *tooltip,
+                                                 GimpImageWindow     *window);
+static void      gimp_image_window_hide_tooltip (GimpUIManager       *manager,
+                                                 GimpImageWindow     *window);
+
 
 G_DEFINE_TYPE (GimpImageWindow, gimp_image_window, GIMP_TYPE_WINDOW)
 
@@ -127,6 +135,13 @@ gimp_image_window_constructor (GType                  type,
   gtk_window_add_accel_group (GTK_WINDOW (window),
                               gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (window->menubar_manager)));
 
+  g_signal_connect (window->menubar_manager, "show-tooltip",
+                    G_CALLBACK (gimp_image_window_show_tooltip),
+                    window);
+  g_signal_connect (window->menubar_manager, "hide-tooltip",
+                    G_CALLBACK (gimp_image_window_hide_tooltip),
+                    window);
+
   window->main_vbox = gtk_vbox_new (FALSE, 0);
   gtk_container_add (GTK_CONTAINER (window), window->main_vbox);
   gtk_widget_show (window->main_vbox);
@@ -150,6 +165,13 @@ gimp_image_window_constructor (GType                  type,
                         NULL);
     }
 
+  /* FIXME display shell */
+  window->statusbar = gimp_statusbar_new (GIMP_DISPLAY_SHELL (window));
+  gimp_help_set_help_data (window->statusbar, NULL,
+                           GIMP_HELP_IMAGE_WINDOW_STATUS_BAR);
+  gtk_box_pack_end (GTK_BOX (window->main_vbox), window->statusbar,
+                    FALSE, FALSE, 0);
+
   return object;
 }
 
@@ -243,6 +265,9 @@ gimp_image_window_window_state (GtkWidget           *widget,
         gtk_widget_set_name (window->menubar,
                              fullscreen ? "gimp-menubar-fullscreen" : NULL);
 
+      gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->statusbar),
+                                         ! fullscreen);
+
       group = gimp_ui_manager_get_action_group (window->menubar_manager, "view");
       gimp_action_group_set_action_active (group,
                                            "view-fullscreen", fullscreen);
@@ -310,3 +335,23 @@ gimp_image_window_get_fullscreen (GimpImageWindow *window)
 
   return (window->window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
 }
+
+
+/*  private functions  */
+
+static void
+gimp_image_window_show_tooltip (GimpUIManager   *manager,
+                                const gchar     *tooltip,
+                                GimpImageWindow *window)
+{
+  gimp_statusbar_push (GIMP_STATUSBAR (window->statusbar), "menu-tooltip",
+                       NULL, "%s", tooltip);
+}
+
+static void
+gimp_image_window_hide_tooltip (GimpUIManager   *manager,
+                                GimpImageWindow *window)
+{
+  gimp_statusbar_pop (GIMP_STATUSBAR (window->statusbar), "menu-tooltip");
+}
+
diff --git a/app/display/gimpimagewindow.h b/app/display/gimpimagewindow.h
index aa941bc..d83acab 100644
--- a/app/display/gimpimagewindow.h
+++ b/app/display/gimpimagewindow.h
@@ -40,6 +40,7 @@ struct _GimpImageWindow
 
   GtkWidget       *main_vbox;
   GtkWidget       *menubar;
+  GtkWidget       *statusbar;
 
   GdkWindowState   window_state;
 };
diff --git a/app/gui/gui.c b/app/gui/gui.c
index af3b9c4..c263024 100644
--- a/app/gui/gui.c
+++ b/app/gui/gui.c
@@ -701,9 +701,10 @@ gui_menu_show_tooltip (GimpUIManager *manager,
 
   if (display)
     {
-      GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
+      GtkWidget *toplevel  = gtk_widget_get_toplevel (display->shell);
+      GtkWidget *statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
-      gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "menu-tooltip",
+      gimp_statusbar_push (GIMP_STATUSBAR (statusbar), "menu-tooltip",
                            NULL, "%s", tooltip);
     }
 }
@@ -717,9 +718,10 @@ gui_menu_hide_tooltip (GimpUIManager *manager,
 
   if (display)
     {
-      GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
+      GtkWidget *toplevel  = gtk_widget_get_toplevel (display->shell);
+      GtkWidget *statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
-      gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "menu-tooltip");
+      gimp_statusbar_pop (GIMP_STATUSBAR (statusbar), "menu-tooltip");
     }
 }
 
diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c
index 67edcdb..b6b59f8 100644
--- a/app/tools/gimpmeasuretool.c
+++ b/app/tools/gimpmeasuretool.c
@@ -331,7 +331,8 @@ gimp_measure_tool_button_press (GimpTool            *tool,
 
   /*  create the info window if necessary  */
   if (! measure->dialog && (options->use_info_window ||
-                            ! GTK_WIDGET_VISIBLE (shell->statusbar)))
+                            /* FIXME image window */
+                            ! GTK_WIDGET_VISIBLE (GIMP_IMAGE_WINDOW (shell)->statusbar)))
     {
       measure->dialog = gimp_measure_tool_dialog_new (measure);
       g_object_add_weak_pointer (G_OBJECT (measure->dialog),
diff --git a/app/tools/gimptool.c b/app/tools/gimptool.c
index e4e57a0..143295b 100644
--- a/app/tools/gimptool.c
+++ b/app/tools/gimptool.c
@@ -894,21 +894,23 @@ gimp_tool_push_status (GimpTool    *tool,
                        const gchar *format,
                        ...)
 {
-  GimpDisplayShell *shell;
-  const gchar      *stock_id;
-  va_list           args;
+  GtkWidget   *toplevel;
+  GtkWidget   *statusbar;
+  const gchar *stock_id;
+  va_list      args;
 
   g_return_if_fail (GIMP_IS_TOOL (tool));
   g_return_if_fail (GIMP_IS_DISPLAY (display));
   g_return_if_fail (format != NULL);
 
-  shell = GIMP_DISPLAY_SHELL (display->shell);
+  toplevel  = gtk_widget_get_toplevel (display->shell);
+  statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
   stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
 
   va_start (args, format);
 
-  gimp_statusbar_push_valist (GIMP_STATUSBAR (shell->statusbar),
+  gimp_statusbar_push_valist (GIMP_STATUSBAR (statusbar),
                               G_OBJECT_TYPE_NAME (tool), stock_id,
                               format, args);
 
@@ -928,17 +930,19 @@ gimp_tool_push_status_coords (GimpTool            *tool,
                               gdouble              y,
                               const gchar         *help)
 {
-  GimpDisplayShell *shell;
-  const gchar      *stock_id;
+  GtkWidget   *toplevel;
+  GtkWidget   *statusbar;
+  const gchar *stock_id;
 
   g_return_if_fail (GIMP_IS_TOOL (tool));
   g_return_if_fail (GIMP_IS_DISPLAY (display));
 
-  shell = GIMP_DISPLAY_SHELL (display->shell);
+  toplevel  = gtk_widget_get_toplevel (display->shell);
+  statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
   stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
 
-  gimp_statusbar_push_coords (GIMP_STATUSBAR (shell->statusbar),
+  gimp_statusbar_push_coords (GIMP_STATUSBAR (statusbar),
                               G_OBJECT_TYPE_NAME (tool), stock_id,
                               precision, title, x, separator, y,
                               help);
@@ -955,17 +959,19 @@ gimp_tool_push_status_length (GimpTool            *tool,
                               gdouble              value,
                               const gchar         *help)
 {
-  GimpDisplayShell *shell;
-  const gchar      *stock_id;
+  GtkWidget   *toplevel;
+  GtkWidget   *statusbar;
+  const gchar *stock_id;
 
   g_return_if_fail (GIMP_IS_TOOL (tool));
   g_return_if_fail (GIMP_IS_DISPLAY (display));
 
-  shell = GIMP_DISPLAY_SHELL (display->shell);
+  toplevel  = gtk_widget_get_toplevel (display->shell);
+  statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
   stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
 
-  gimp_statusbar_push_length (GIMP_STATUSBAR (shell->statusbar),
+  gimp_statusbar_push_length (GIMP_STATUSBAR (statusbar),
                               G_OBJECT_TYPE_NAME (tool), stock_id,
                               title, axis, value, help);
 
@@ -979,21 +985,23 @@ gimp_tool_replace_status (GimpTool    *tool,
                           const gchar *format,
                           ...)
 {
-  GimpDisplayShell *shell;
-  const gchar      *stock_id;
-  va_list           args;
+  GtkWidget   *toplevel;
+  GtkWidget   *statusbar;
+  const gchar *stock_id;
+  va_list      args;
 
   g_return_if_fail (GIMP_IS_TOOL (tool));
   g_return_if_fail (GIMP_IS_DISPLAY (display));
   g_return_if_fail (format != NULL);
 
-  shell = GIMP_DISPLAY_SHELL (display->shell);
+  toplevel  = gtk_widget_get_toplevel (display->shell);
+  statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
   stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
 
   va_start (args, format);
 
-  gimp_statusbar_replace_valist (GIMP_STATUSBAR (shell->statusbar),
+  gimp_statusbar_replace_valist (GIMP_STATUSBAR (statusbar),
                                  G_OBJECT_TYPE_NAME (tool), stock_id,
                                  format, args);
 
@@ -1007,14 +1015,16 @@ void
 gimp_tool_pop_status (GimpTool    *tool,
                       GimpDisplay *display)
 {
-  GimpDisplayShell *shell;
+  GtkWidget *toplevel;
+  GtkWidget *statusbar;
 
   g_return_if_fail (GIMP_IS_TOOL (tool));
   g_return_if_fail (GIMP_IS_DISPLAY (display));
 
-  shell = GIMP_DISPLAY_SHELL (display->shell);
+  toplevel  = gtk_widget_get_toplevel (display->shell);
+  statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar;
 
-  gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar),
+  gimp_statusbar_pop (GIMP_STATUSBAR (statusbar),
                       G_OBJECT_TYPE_NAME (tool));
 
   tool->status_displays = g_list_remove (tool->status_displays, display);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]