Move the statusbar back to GimpDisplayShell
Keeping it in GimpImageWindow was a bad idea because - it wasted space - it produced evil code because - it conceptually didn't belong there
This commit is contained in:
@ -631,13 +631,8 @@ action_message (GimpDisplay *display,
|
|||||||
const gchar *format,
|
const gchar *format,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
GimpImageWindow *window;
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
window = gimp_display_shell_get_window (GIMP_DISPLAY_SHELL (display->shell));
|
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
const gchar *stock_id = NULL;
|
const gchar *stock_id = NULL;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
@ -657,4 +652,3 @@ action_message (GimpDisplay *display,
|
|||||||
stock_id, format, args);
|
stock_id, format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -429,8 +429,7 @@ gimp_display_new (Gimp *gimp,
|
|||||||
gimp_image_window_set_active_shell (window,
|
gimp_image_window_set_active_shell (window,
|
||||||
GIMP_DISPLAY_SHELL (display->shell));
|
GIMP_DISPLAY_SHELL (display->shell));
|
||||||
|
|
||||||
/* FIXME image window */
|
g_signal_connect (gimp_display_shell_get_statusbar (GIMP_DISPLAY_SHELL (display->shell)),
|
||||||
g_signal_connect (gimp_image_window_get_statusbar (GIMP_IMAGE_WINDOW (window)),
|
|
||||||
"cancel",
|
"cancel",
|
||||||
G_CALLBACK (gimp_display_progress_canceled),
|
G_CALLBACK (gimp_display_progress_canceled),
|
||||||
display);
|
display);
|
||||||
|
@ -74,8 +74,14 @@ gimp_display_shell_appearance_update (GimpDisplayShell *shell)
|
|||||||
window = gimp_display_shell_get_window (shell);
|
window = gimp_display_shell_get_window (shell);
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
appearance_set_action_active (shell, "view-fullscreen",
|
{
|
||||||
gimp_image_window_get_fullscreen (window));
|
gboolean fullscreen = gimp_image_window_get_fullscreen (window);
|
||||||
|
|
||||||
|
appearance_set_action_active (shell, "view-fullscreen", fullscreen);
|
||||||
|
|
||||||
|
gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (shell->statusbar),
|
||||||
|
! fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
gimp_display_shell_set_show_menubar (shell,
|
gimp_display_shell_set_show_menubar (shell,
|
||||||
options->show_menubar);
|
options->show_menubar);
|
||||||
@ -136,19 +142,14 @@ gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell,
|
|||||||
gboolean show)
|
gboolean show)
|
||||||
{
|
{
|
||||||
GimpDisplayOptions *options;
|
GimpDisplayOptions *options;
|
||||||
GimpImageWindow *window;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
|
||||||
options = appearance_get_options (shell);
|
options = appearance_get_options (shell);
|
||||||
window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
g_object_set (options, "show-statusbar", show, NULL);
|
g_object_set (options, "show-statusbar", show, NULL);
|
||||||
|
|
||||||
if (window && gimp_image_window_get_active_shell (window) == shell)
|
gimp_statusbar_set_visible (GIMP_STATUSBAR (shell->statusbar), show);
|
||||||
{
|
|
||||||
gimp_image_window_set_show_statusbar (window, show);
|
|
||||||
}
|
|
||||||
|
|
||||||
appearance_set_action_active (shell, "view-show-statusbar", show);
|
appearance_set_action_active (shell, "view-show-statusbar", show);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
#include "gimpdisplayshell-cursor.h"
|
#include "gimpdisplayshell-cursor.h"
|
||||||
#include "gimpdisplayshell-expose.h"
|
#include "gimpdisplayshell-expose.h"
|
||||||
#include "gimpdisplayshell-transform.h"
|
#include "gimpdisplayshell-transform.h"
|
||||||
#include "gimpimagewindow.h"
|
|
||||||
#include "gimpstatusbar.h"
|
#include "gimpstatusbar.h"
|
||||||
|
|
||||||
|
|
||||||
@ -126,7 +125,7 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
|
|||||||
gdouble image_x,
|
gdouble image_x,
|
||||||
gdouble image_y)
|
gdouble image_y)
|
||||||
{
|
{
|
||||||
GimpImageWindow *window;
|
GimpStatusbar *statusbar;
|
||||||
GimpDialogFactory *factory;
|
GimpDialogFactory *factory;
|
||||||
GimpSessionInfo *session_info;
|
GimpSessionInfo *session_info;
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
@ -162,14 +161,9 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
|
|||||||
/* use the passed image_coords for the statusbar because they are
|
/* use the passed image_coords for the statusbar because they are
|
||||||
* possibly snapped...
|
* possibly snapped...
|
||||||
*/
|
*/
|
||||||
window = gimp_display_shell_get_window (shell);
|
statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (window && gimp_image_window_get_active_shell (window))
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
|
|
||||||
gimp_statusbar_update_cursor (statusbar, precision, image_x, image_y);
|
gimp_statusbar_update_cursor (statusbar, precision, image_x, image_y);
|
||||||
}
|
|
||||||
|
|
||||||
factory = gimp_dialog_factory_from_name ("dock");
|
factory = gimp_dialog_factory_from_name ("dock");
|
||||||
session_info = gimp_dialog_factory_find_session_info (factory,
|
session_info = gimp_dialog_factory_find_session_info (factory,
|
||||||
@ -200,20 +194,15 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
|
|||||||
void
|
void
|
||||||
gimp_display_shell_clear_cursor (GimpDisplayShell *shell)
|
gimp_display_shell_clear_cursor (GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
GimpImageWindow *window;
|
GimpStatusbar *statusbar;
|
||||||
GimpDialogFactory *factory;
|
GimpDialogFactory *factory;
|
||||||
GimpSessionInfo *session_info;
|
GimpSessionInfo *session_info;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
|
||||||
window = gimp_display_shell_get_window (shell);
|
statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (window && gimp_image_window_get_active_shell (window) == shell)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
|
|
||||||
gimp_statusbar_clear_cursor (statusbar);
|
gimp_statusbar_clear_cursor (statusbar);
|
||||||
}
|
|
||||||
|
|
||||||
factory = gimp_dialog_factory_from_name ("dock");
|
factory = gimp_dialog_factory_from_name ("dock");
|
||||||
session_info = gimp_dialog_factory_find_session_info (factory,
|
session_info = gimp_dialog_factory_find_session_info (factory,
|
||||||
|
@ -586,11 +586,7 @@ gimp_display_shell_saved_handler (GimpImage *image,
|
|||||||
const gchar *uri,
|
const gchar *uri,
|
||||||
GimpDisplayShell *shell)
|
GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (window && gimp_image_window_get_active_shell (window) == shell)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
|
gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
|
||||||
@ -598,18 +594,13 @@ gimp_display_shell_saved_handler (GimpImage *image,
|
|||||||
filename);
|
filename);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_exported_handler (GimpImage *image,
|
gimp_display_shell_exported_handler (GimpImage *image,
|
||||||
const gchar *uri,
|
const gchar *uri,
|
||||||
GimpDisplayShell *shell)
|
GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (window && gimp_image_window_get_active_shell (window) == shell)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
|
gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
|
||||||
@ -617,7 +608,6 @@ gimp_display_shell_exported_handler (GimpImage *image,
|
|||||||
filename);
|
filename);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_vectors_freeze_handler (GimpVectors *vectors,
|
gimp_display_shell_vectors_freeze_handler (GimpVectors *vectors,
|
||||||
|
@ -27,104 +27,74 @@
|
|||||||
|
|
||||||
#include "gimpdisplayshell.h"
|
#include "gimpdisplayshell.h"
|
||||||
#include "gimpdisplayshell-progress.h"
|
#include "gimpdisplayshell-progress.h"
|
||||||
#include "gimpimagewindow.h"
|
|
||||||
#include "gimpstatusbar.h"
|
#include "gimpstatusbar.h"
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: need to store the shell's progress state in the shell itself
|
|
||||||
* instead of simply dispatching to the statusbar. Otherwise it's
|
|
||||||
* impossible to switch an image window between two shells that both
|
|
||||||
* have active progress messages.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
static GimpProgress *
|
|
||||||
gimp_display_shell_progress_get_real_progress (GimpProgress *progress)
|
|
||||||
{
|
|
||||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
|
||||||
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
if (window && gimp_image_window_get_active_shell (window) == shell)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
|
|
||||||
return GIMP_PROGRESS (statusbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GimpProgress *
|
static GimpProgress *
|
||||||
gimp_display_shell_progress_start (GimpProgress *progress,
|
gimp_display_shell_progress_start (GimpProgress *progress,
|
||||||
const gchar *message,
|
const gchar *message,
|
||||||
gboolean cancelable)
|
gboolean cancelable)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
return gimp_progress_start (GIMP_PROGRESS (statusbar), message, cancelable);
|
||||||
return gimp_progress_start (progress, message, cancelable);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_progress_end (GimpProgress *progress)
|
gimp_display_shell_progress_end (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
gimp_progress_end (GIMP_PROGRESS (statusbar));
|
||||||
gimp_progress_end (progress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_display_shell_progress_is_active (GimpProgress *progress)
|
gimp_display_shell_progress_is_active (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
return gimp_progress_is_active (GIMP_PROGRESS (statusbar));
|
||||||
return gimp_progress_is_active (progress);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_progress_set_text (GimpProgress *progress,
|
gimp_display_shell_progress_set_text (GimpProgress *progress,
|
||||||
const gchar *message)
|
const gchar *message)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
gimp_progress_set_text (GIMP_PROGRESS (statusbar), message);
|
||||||
gimp_progress_set_text (progress, message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_progress_set_value (GimpProgress *progress,
|
gimp_display_shell_progress_set_value (GimpProgress *progress,
|
||||||
gdouble percentage)
|
gdouble percentage)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
gimp_progress_set_value (GIMP_PROGRESS (statusbar), percentage);
|
||||||
gimp_progress_set_value (progress, percentage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gdouble
|
static gdouble
|
||||||
gimp_display_shell_progress_get_value (GimpProgress *progress)
|
gimp_display_shell_progress_get_value (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
return gimp_progress_get_value (GIMP_PROGRESS (statusbar));
|
||||||
return gimp_progress_get_value (progress);
|
|
||||||
|
|
||||||
return 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_progress_pulse (GimpProgress *progress)
|
gimp_display_shell_progress_pulse (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
gimp_progress_pulse (GIMP_PROGRESS (statusbar));
|
||||||
gimp_progress_pulse (progress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint32
|
static guint32
|
||||||
@ -145,10 +115,9 @@ gimp_display_shell_progress_message (GimpProgress *progress,
|
|||||||
const gchar *domain,
|
const gchar *domain,
|
||||||
const gchar *message)
|
const gchar *message)
|
||||||
{
|
{
|
||||||
progress = gimp_display_shell_progress_get_real_progress (progress);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (progress)
|
|
||||||
{
|
|
||||||
switch (severity)
|
switch (severity)
|
||||||
{
|
{
|
||||||
case GIMP_MESSAGE_ERROR:
|
case GIMP_MESSAGE_ERROR:
|
||||||
@ -157,21 +126,20 @@ gimp_display_shell_progress_message (GimpProgress *progress,
|
|||||||
|
|
||||||
case GIMP_MESSAGE_WARNING:
|
case GIMP_MESSAGE_WARNING:
|
||||||
/* warning messages go to the statusbar, if it's visible */
|
/* warning messages go to the statusbar, if it's visible */
|
||||||
if (! gimp_statusbar_get_visible (GIMP_STATUSBAR (progress)))
|
if (! gimp_statusbar_get_visible (statusbar))
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
return gimp_progress_message (progress, gimp,
|
return gimp_progress_message (GIMP_PROGRESS (statusbar), gimp,
|
||||||
severity, domain, message);
|
severity, domain, message);
|
||||||
|
|
||||||
case GIMP_MESSAGE_INFO:
|
case GIMP_MESSAGE_INFO:
|
||||||
/* info messages go to the statusbar;
|
/* info messages go to the statusbar;
|
||||||
* if they are not handled there, they are swallowed
|
* if they are not handled there, they are swallowed
|
||||||
*/
|
*/
|
||||||
gimp_progress_message (progress, gimp,
|
gimp_progress_message (GIMP_PROGRESS (statusbar), gimp,
|
||||||
severity, domain, message);
|
severity, domain, message);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -859,10 +859,12 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||||||
* | +-- vscrollbar
|
* | +-- vscrollbar
|
||||||
* |
|
* |
|
||||||
* +-- lower_hbox
|
* +-- lower_hbox
|
||||||
|
* | |
|
||||||
|
* | +-- quick_mask
|
||||||
|
* | +-- hscrollbar
|
||||||
|
* | +-- navbutton
|
||||||
* |
|
* |
|
||||||
* +-- quick_mask
|
* +-- statusbar
|
||||||
* +-- hscrollbar
|
|
||||||
* +-- navbutton
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* first, set up the container hierarchy *********************************/
|
/* first, set up the container hierarchy *********************************/
|
||||||
@ -1080,6 +1082,14 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||||||
_("Navigate the image display"),
|
_("Navigate the image display"),
|
||||||
GIMP_HELP_IMAGE_WINDOW_NAV_BUTTON);
|
GIMP_HELP_IMAGE_WINDOW_NAV_BUTTON);
|
||||||
|
|
||||||
|
/* the statusbar ********************************************************/
|
||||||
|
|
||||||
|
shell->statusbar = gimp_statusbar_new ();
|
||||||
|
gimp_statusbar_set_shell (GIMP_STATUSBAR (shell->statusbar), shell);
|
||||||
|
gimp_help_set_help_data (shell->statusbar, NULL,
|
||||||
|
GIMP_HELP_IMAGE_WINDOW_STATUS_BAR);
|
||||||
|
gtk_box_pack_end (GTK_BOX (shell), shell->statusbar, FALSE, FALSE, 0);
|
||||||
|
|
||||||
/* pack all the widgets **************************************************/
|
/* pack all the widgets **************************************************/
|
||||||
|
|
||||||
/* fill the inner_table */
|
/* fill the inner_table */
|
||||||
@ -1139,6 +1149,8 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||||||
gimp_help_set_help_data (shell->canvas,
|
gimp_help_set_help_data (shell->canvas,
|
||||||
_("Drop image files here to open them"),
|
_("Drop image files here to open them"),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure the information is up-to-date */
|
/* make sure the information is up-to-date */
|
||||||
@ -1156,6 +1168,14 @@ gimp_display_shell_get_window (GimpDisplayShell *shell)
|
|||||||
GIMP_TYPE_IMAGE_WINDOW));
|
GIMP_TYPE_IMAGE_WINDOW));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GimpStatusbar *
|
||||||
|
gimp_display_shell_get_statusbar (GimpDisplayShell *shell)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
|
||||||
|
|
||||||
|
return GIMP_STATUSBAR (shell->statusbar);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_reconnect (GimpDisplayShell *shell)
|
gimp_display_shell_reconnect (GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
@ -1206,6 +1226,8 @@ gimp_display_shell_empty (GimpDisplayShell *shell)
|
|||||||
gimp_help_set_help_data (shell->canvas,
|
gimp_help_set_help_data (shell->canvas,
|
||||||
_("Drop image files here to open them"), NULL);
|
_("Drop image files here to open them"), NULL);
|
||||||
|
|
||||||
|
gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
|
||||||
|
|
||||||
gimp_display_shell_expose_full (shell);
|
gimp_display_shell_expose_full (shell);
|
||||||
|
|
||||||
user_context = gimp_get_user_context (shell->display->gimp);
|
user_context = gimp_get_user_context (shell->display->gimp);
|
||||||
@ -1251,6 +1273,8 @@ gimp_display_shell_fill (GimpDisplayShell *shell,
|
|||||||
|
|
||||||
gimp_help_set_help_data (shell->canvas, NULL, NULL);
|
gimp_help_set_help_data (shell->canvas, NULL, NULL);
|
||||||
|
|
||||||
|
gimp_statusbar_fill (GIMP_STATUSBAR (shell->statusbar));
|
||||||
|
|
||||||
/* A size-allocate will always occur because the scrollbars will
|
/* A size-allocate will always occur because the scrollbars will
|
||||||
* become visible forcing the canvas to become smaller
|
* become visible forcing the canvas to become smaller
|
||||||
*/
|
*/
|
||||||
|
@ -135,6 +135,8 @@ struct _GimpDisplayShell
|
|||||||
GtkWidget *zoom_button; /* NE: zoom toggle button */
|
GtkWidget *zoom_button; /* NE: zoom toggle button */
|
||||||
GtkWidget *nav_ebox; /* SE: navigation event box */
|
GtkWidget *nav_ebox; /* SE: navigation event box */
|
||||||
|
|
||||||
|
GtkWidget *statusbar; /* statusbar */
|
||||||
|
|
||||||
guchar *render_buf; /* buffer for rendering the image */
|
guchar *render_buf; /* buffer for rendering the image */
|
||||||
|
|
||||||
guint title_idle_id; /* title update idle ID */
|
guint title_idle_id; /* title update idle ID */
|
||||||
@ -223,6 +225,8 @@ GtkWidget * gimp_display_shell_new (GimpDisplay *display,
|
|||||||
|
|
||||||
GimpImageWindow * gimp_display_shell_get_window (GimpDisplayShell *shell);
|
GimpImageWindow * gimp_display_shell_get_window (GimpDisplayShell *shell);
|
||||||
|
|
||||||
|
GimpStatusbar * gimp_display_shell_get_statusbar (GimpDisplayShell *shell);
|
||||||
|
|
||||||
void gimp_display_shell_reconnect (GimpDisplayShell *shell);
|
void gimp_display_shell_reconnect (GimpDisplayShell *shell);
|
||||||
|
|
||||||
void gimp_display_shell_empty (GimpDisplayShell *shell);
|
void gimp_display_shell_empty (GimpDisplayShell *shell);
|
||||||
|
@ -81,7 +81,6 @@ struct _GimpImageWindowPrivate
|
|||||||
GtkWidget *right_hpane;
|
GtkWidget *right_hpane;
|
||||||
GtkWidget *notebook;
|
GtkWidget *notebook;
|
||||||
GtkWidget *right_docks;
|
GtkWidget *right_docks;
|
||||||
GtkWidget *statusbar;
|
|
||||||
|
|
||||||
GdkWindowState window_state;
|
GdkWindowState window_state;
|
||||||
gboolean is_empty;
|
gboolean is_empty;
|
||||||
@ -142,9 +141,6 @@ static void gimp_image_window_shell_scaled (GimpDisplayShell *she
|
|||||||
static void gimp_image_window_shell_title_notify (GimpDisplayShell *shell,
|
static void gimp_image_window_shell_title_notify (GimpDisplayShell *shell,
|
||||||
const GParamSpec *pspec,
|
const GParamSpec *pspec,
|
||||||
GimpImageWindow *window);
|
GimpImageWindow *window);
|
||||||
static void gimp_image_window_shell_status_notify (GimpDisplayShell *shell,
|
|
||||||
const GParamSpec *pspec,
|
|
||||||
GimpImageWindow *window);
|
|
||||||
static void gimp_image_window_shell_icon_notify (GimpDisplayShell *shell,
|
static void gimp_image_window_shell_icon_notify (GimpDisplayShell *shell,
|
||||||
const GParamSpec *pspec,
|
const GParamSpec *pspec,
|
||||||
GimpImageWindow *window);
|
GimpImageWindow *window);
|
||||||
@ -319,13 +315,6 @@ gimp_image_window_constructor (GType type,
|
|||||||
if (config->single_window_mode)
|
if (config->single_window_mode)
|
||||||
gtk_widget_show (private->right_docks);
|
gtk_widget_show (private->right_docks);
|
||||||
|
|
||||||
/* Create the statusbar */
|
|
||||||
private->statusbar = gimp_statusbar_new ();
|
|
||||||
gimp_help_set_help_data (private->statusbar, NULL,
|
|
||||||
GIMP_HELP_IMAGE_WINDOW_STATUS_BAR);
|
|
||||||
gtk_box_pack_end (GTK_BOX (private->main_vbox), private->statusbar,
|
|
||||||
FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,14 +469,12 @@ gimp_image_window_window_state_event (GtkWidget *widget,
|
|||||||
gtk_widget_set_name (private->menubar,
|
gtk_widget_set_name (private->menubar,
|
||||||
fullscreen ? "gimp-menubar-fullscreen" : NULL);
|
fullscreen ? "gimp-menubar-fullscreen" : NULL);
|
||||||
|
|
||||||
gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (private->statusbar),
|
|
||||||
! fullscreen);
|
|
||||||
|
|
||||||
gimp_display_shell_appearance_update (shell);
|
gimp_display_shell_appearance_update (shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)
|
if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)
|
||||||
{
|
{
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
gboolean iconified = gimp_image_window_is_iconified (window);
|
gboolean iconified = gimp_image_window_is_iconified (window);
|
||||||
|
|
||||||
GIMP_LOG (WM, "Image window '%s' [%p] set %s",
|
GIMP_LOG (WM, "Image window '%s' [%p] set %s",
|
||||||
@ -509,10 +496,8 @@ gimp_image_window_window_state_event (GtkWidget *widget,
|
|||||||
gimp_dialog_factories_show_with_display ();
|
gimp_dialog_factories_show_with_display ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gimp_progress_is_active (GIMP_PROGRESS (private->statusbar)))
|
if (gimp_progress_is_active (GIMP_PROGRESS (statusbar)))
|
||||||
{
|
{
|
||||||
GimpStatusbar *statusbar = GIMP_STATUSBAR (private->statusbar);
|
|
||||||
|
|
||||||
if (iconified)
|
if (iconified)
|
||||||
gimp_statusbar_override_window_title (statusbar);
|
gimp_statusbar_override_window_title (statusbar);
|
||||||
else
|
else
|
||||||
@ -529,13 +514,15 @@ gimp_image_window_style_set (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GimpImageWindow *window = GIMP_IMAGE_WINDOW (widget);
|
GimpImageWindow *window = GIMP_IMAGE_WINDOW (widget);
|
||||||
GimpImageWindowPrivate *private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
GimpImageWindowPrivate *private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
||||||
|
GimpDisplayShell *shell = gimp_image_window_get_active_shell (window);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
GdkGeometry geometry;
|
GdkGeometry geometry;
|
||||||
GdkWindowHints geometry_mask;
|
GdkWindowHints geometry_mask;
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
||||||
|
|
||||||
gtk_widget_size_request (private->statusbar, &requisition);
|
gtk_widget_size_request (GTK_WIDGET (statusbar), &requisition);
|
||||||
|
|
||||||
geometry.min_height = 23;
|
geometry.min_height = 23;
|
||||||
|
|
||||||
@ -579,18 +566,6 @@ gimp_image_window_get_ui_manager (GimpImageWindow *window)
|
|||||||
return private->menubar_manager;
|
return private->menubar_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
GimpStatusbar *
|
|
||||||
gimp_image_window_get_statusbar (GimpImageWindow *window)
|
|
||||||
{
|
|
||||||
GimpImageWindowPrivate *private;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE_WINDOW (window), FALSE);
|
|
||||||
|
|
||||||
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
|
||||||
|
|
||||||
return GIMP_STATUSBAR (private->statusbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
GimpDockColumns *
|
GimpDockColumns *
|
||||||
gimp_image_window_get_left_docks (GimpImageWindow *window)
|
gimp_image_window_get_left_docks (GimpImageWindow *window)
|
||||||
{
|
{
|
||||||
@ -777,31 +752,6 @@ gimp_image_window_get_show_menubar (GimpImageWindow *window)
|
|||||||
return GTK_WIDGET_VISIBLE (private->menubar);
|
return GTK_WIDGET_VISIBLE (private->menubar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gimp_image_window_set_show_statusbar (GimpImageWindow *window,
|
|
||||||
gboolean show)
|
|
||||||
{
|
|
||||||
GimpImageWindowPrivate *private;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_IMAGE_WINDOW (window));
|
|
||||||
|
|
||||||
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
|
||||||
|
|
||||||
gimp_statusbar_set_visible (GIMP_STATUSBAR (private->statusbar), show);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
gimp_image_window_get_show_statusbar (GimpImageWindow *window)
|
|
||||||
{
|
|
||||||
GimpImageWindowPrivate *private;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE_WINDOW (window), FALSE);
|
|
||||||
|
|
||||||
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
|
||||||
|
|
||||||
return GTK_WIDGET_VISIBLE (private->statusbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_image_window_set_show_docks (GimpImageWindow *window,
|
gimp_image_window_set_show_docks (GimpImageWindow *window,
|
||||||
gboolean show)
|
gboolean show)
|
||||||
@ -942,8 +892,10 @@ gimp_image_window_shrink_wrap (GimpImageWindow *window,
|
|||||||
|
|
||||||
if (resize)
|
if (resize)
|
||||||
{
|
{
|
||||||
if (width < private->statusbar->requisition.width)
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (active_shell);
|
||||||
width = private->statusbar->requisition.width;
|
|
||||||
|
if (width < GTK_WIDGET (statusbar)->requisition.width)
|
||||||
|
width = GTK_WIDGET (statusbar)->requisition.width;
|
||||||
|
|
||||||
width = width + border_width;
|
width = width + border_width;
|
||||||
height = height + border_height;
|
height = height + border_height;
|
||||||
@ -976,9 +928,10 @@ gimp_image_window_show_tooltip (GimpUIManager *manager,
|
|||||||
const gchar *tooltip,
|
const gchar *tooltip,
|
||||||
GimpImageWindow *window)
|
GimpImageWindow *window)
|
||||||
{
|
{
|
||||||
GimpImageWindowPrivate *private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
GimpDisplayShell *shell = gimp_image_window_get_active_shell (window);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
gimp_statusbar_push (GIMP_STATUSBAR (private->statusbar), "menu-tooltip",
|
gimp_statusbar_push (statusbar, "menu-tooltip",
|
||||||
NULL, "%s", tooltip);
|
NULL, "%s", tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -986,9 +939,10 @@ static void
|
|||||||
gimp_image_window_hide_tooltip (GimpUIManager *manager,
|
gimp_image_window_hide_tooltip (GimpUIManager *manager,
|
||||||
GimpImageWindow *window)
|
GimpImageWindow *window)
|
||||||
{
|
{
|
||||||
GimpImageWindowPrivate *private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
GimpDisplayShell *shell = gimp_image_window_get_active_shell (window);
|
||||||
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
gimp_statusbar_pop (GIMP_STATUSBAR (private->statusbar), "menu-tooltip");
|
gimp_statusbar_pop (statusbar, "menu-tooltip");
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -1030,12 +984,11 @@ gimp_image_window_switch_page (GtkNotebook *notebook,
|
|||||||
g_signal_handlers_disconnect_by_func (private->active_shell,
|
g_signal_handlers_disconnect_by_func (private->active_shell,
|
||||||
gimp_image_window_shell_title_notify,
|
gimp_image_window_shell_title_notify,
|
||||||
window);
|
window);
|
||||||
g_signal_handlers_disconnect_by_func (private->active_shell,
|
|
||||||
gimp_image_window_shell_status_notify,
|
|
||||||
window);
|
|
||||||
g_signal_handlers_disconnect_by_func (private->active_shell,
|
g_signal_handlers_disconnect_by_func (private->active_shell,
|
||||||
gimp_image_window_shell_icon_notify,
|
gimp_image_window_shell_icon_notify,
|
||||||
window);
|
window);
|
||||||
|
|
||||||
|
gimp_image_window_hide_tooltip (private->menubar_manager, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
private->active_shell = shell;
|
private->active_shell = shell;
|
||||||
@ -1046,18 +999,12 @@ gimp_image_window_switch_page (GtkNotebook *notebook,
|
|||||||
G_CALLBACK (gimp_image_window_image_notify),
|
G_CALLBACK (gimp_image_window_image_notify),
|
||||||
window);
|
window);
|
||||||
|
|
||||||
gimp_statusbar_set_shell (GIMP_STATUSBAR (private->statusbar),
|
|
||||||
private->active_shell);
|
|
||||||
|
|
||||||
g_signal_connect (private->active_shell, "scaled",
|
g_signal_connect (private->active_shell, "scaled",
|
||||||
G_CALLBACK (gimp_image_window_shell_scaled),
|
G_CALLBACK (gimp_image_window_shell_scaled),
|
||||||
window);
|
window);
|
||||||
g_signal_connect (private->active_shell, "notify::title",
|
g_signal_connect (private->active_shell, "notify::title",
|
||||||
G_CALLBACK (gimp_image_window_shell_title_notify),
|
G_CALLBACK (gimp_image_window_shell_title_notify),
|
||||||
window);
|
window);
|
||||||
g_signal_connect (private->active_shell, "notify::status",
|
|
||||||
G_CALLBACK (gimp_image_window_shell_status_notify),
|
|
||||||
window);
|
|
||||||
g_signal_connect (private->active_shell, "notify::icon",
|
g_signal_connect (private->active_shell, "notify::icon",
|
||||||
G_CALLBACK (gimp_image_window_shell_icon_notify),
|
G_CALLBACK (gimp_image_window_shell_icon_notify),
|
||||||
window);
|
window);
|
||||||
@ -1066,8 +1013,6 @@ gimp_image_window_switch_page (GtkNotebook *notebook,
|
|||||||
|
|
||||||
if (! active_display->image)
|
if (! active_display->image)
|
||||||
{
|
{
|
||||||
gimp_statusbar_empty (GIMP_STATUSBAR (private->statusbar));
|
|
||||||
|
|
||||||
gimp_dialog_factory_add_foreign (private->display_factory,
|
gimp_dialog_factory_add_foreign (private->display_factory,
|
||||||
"gimp-empty-image-window",
|
"gimp-empty-image-window",
|
||||||
GTK_WIDGET (window));
|
GTK_WIDGET (window));
|
||||||
@ -1092,8 +1037,6 @@ gimp_image_window_image_notify (GimpDisplay *display,
|
|||||||
|
|
||||||
gimp_dialog_factory_remove_dialog (private->display_factory,
|
gimp_dialog_factory_remove_dialog (private->display_factory,
|
||||||
GTK_WIDGET (window));
|
GTK_WIDGET (window));
|
||||||
|
|
||||||
gimp_statusbar_fill (GIMP_STATUSBAR (private->statusbar));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_list_length (private->shells) == 1)
|
else if (g_list_length (private->shells) == 1)
|
||||||
@ -1129,8 +1072,6 @@ gimp_image_window_image_notify (GimpDisplay *display,
|
|||||||
"gimp-empty-image-window",
|
"gimp-empty-image-window",
|
||||||
GTK_WIDGET (window));
|
GTK_WIDGET (window));
|
||||||
|
|
||||||
gimp_statusbar_empty (GIMP_STATUSBAR (private->statusbar));
|
|
||||||
|
|
||||||
gtk_window_unmaximize (GTK_WINDOW (window));
|
gtk_window_unmaximize (GTK_WINDOW (window));
|
||||||
gtk_window_resize (GTK_WINDOW (window), width, height);
|
gtk_window_resize (GTK_WINDOW (window), width, height);
|
||||||
}
|
}
|
||||||
@ -1163,17 +1104,6 @@ gimp_image_window_shell_title_notify (GimpDisplayShell *shell,
|
|||||||
gtk_window_set_title (GTK_WINDOW (window), shell->title);
|
gtk_window_set_title (GTK_WINDOW (window), shell->title);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_image_window_shell_status_notify (GimpDisplayShell *shell,
|
|
||||||
const GParamSpec *pspec,
|
|
||||||
GimpImageWindow *window)
|
|
||||||
{
|
|
||||||
GimpImageWindowPrivate *private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
|
||||||
|
|
||||||
gimp_statusbar_replace (GIMP_STATUSBAR (private->statusbar), "title",
|
|
||||||
NULL, "%s", shell->status);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_window_shell_icon_notify (GimpDisplayShell *shell,
|
gimp_image_window_shell_icon_notify (GimpDisplayShell *shell,
|
||||||
const GParamSpec *pspec,
|
const GParamSpec *pspec,
|
||||||
|
@ -46,7 +46,6 @@ struct _GimpImageWindowClass
|
|||||||
GType gimp_image_window_get_type (void) G_GNUC_CONST;
|
GType gimp_image_window_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GimpUIManager * gimp_image_window_get_ui_manager (GimpImageWindow *window);
|
GimpUIManager * gimp_image_window_get_ui_manager (GimpImageWindow *window);
|
||||||
GimpStatusbar * gimp_image_window_get_statusbar (GimpImageWindow *window);
|
|
||||||
GimpDockColumns * gimp_image_window_get_left_docks (GimpImageWindow *window);
|
GimpDockColumns * gimp_image_window_get_left_docks (GimpImageWindow *window);
|
||||||
GimpDockColumns * gimp_image_window_get_right_docks (GimpImageWindow *window);
|
GimpDockColumns * gimp_image_window_get_right_docks (GimpImageWindow *window);
|
||||||
|
|
||||||
|
@ -110,6 +110,9 @@ static void gimp_statusbar_scale_activated (GimpScaleComboBox *combo,
|
|||||||
GimpStatusbar *statusbar);
|
GimpStatusbar *statusbar);
|
||||||
static void gimp_statusbar_shell_scaled (GimpDisplayShell *shell,
|
static void gimp_statusbar_shell_scaled (GimpDisplayShell *shell,
|
||||||
GimpStatusbar *statusbar);
|
GimpStatusbar *statusbar);
|
||||||
|
static void gimp_statusbar_shell_status_notify(GimpDisplayShell *shell,
|
||||||
|
const GParamSpec *pspec,
|
||||||
|
GimpStatusbar *statusbar);
|
||||||
static guint gimp_statusbar_get_context_id (GimpStatusbar *statusbar,
|
static guint gimp_statusbar_get_context_id (GimpStatusbar *statusbar,
|
||||||
const gchar *context);
|
const gchar *context);
|
||||||
static gboolean gimp_statusbar_temp_timeout (GimpStatusbar *statusbar);
|
static gboolean gimp_statusbar_temp_timeout (GimpStatusbar *statusbar);
|
||||||
@ -676,6 +679,10 @@ gimp_statusbar_set_shell (GimpStatusbar *statusbar,
|
|||||||
g_signal_handlers_disconnect_by_func (statusbar->shell,
|
g_signal_handlers_disconnect_by_func (statusbar->shell,
|
||||||
gimp_statusbar_shell_scaled,
|
gimp_statusbar_shell_scaled,
|
||||||
statusbar);
|
statusbar);
|
||||||
|
|
||||||
|
g_signal_handlers_disconnect_by_func (statusbar->shell,
|
||||||
|
gimp_statusbar_shell_status_notify,
|
||||||
|
statusbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
statusbar->shell = shell;
|
statusbar->shell = shell;
|
||||||
@ -683,6 +690,10 @@ gimp_statusbar_set_shell (GimpStatusbar *statusbar,
|
|||||||
g_signal_connect_object (statusbar->shell, "scaled",
|
g_signal_connect_object (statusbar->shell, "scaled",
|
||||||
G_CALLBACK (gimp_statusbar_shell_scaled),
|
G_CALLBACK (gimp_statusbar_shell_scaled),
|
||||||
statusbar, 0);
|
statusbar, 0);
|
||||||
|
|
||||||
|
g_signal_connect_object (statusbar->shell, "notify::status",
|
||||||
|
G_CALLBACK (gimp_statusbar_shell_status_notify),
|
||||||
|
statusbar, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -1427,6 +1438,15 @@ gimp_statusbar_shell_scaled (GimpDisplayShell *shell,
|
|||||||
gimp_statusbar_clear_cursor (statusbar);
|
gimp_statusbar_clear_cursor (statusbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_statusbar_shell_status_notify (GimpDisplayShell *shell,
|
||||||
|
const GParamSpec *pspec,
|
||||||
|
GimpStatusbar *statusbar)
|
||||||
|
{
|
||||||
|
gimp_statusbar_replace (statusbar, "title",
|
||||||
|
NULL, "%s", shell->status);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_statusbar_unit_changed (GimpUnitComboBox *combo,
|
gimp_statusbar_unit_changed (GimpUnitComboBox *combo,
|
||||||
GimpStatusbar *statusbar)
|
GimpStatusbar *statusbar)
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
#include "display/gimpdisplay-foreach.h"
|
#include "display/gimpdisplay-foreach.h"
|
||||||
#include "display/gimpdisplayshell.h"
|
#include "display/gimpdisplayshell.h"
|
||||||
#include "display/gimpdisplayshell-render.h"
|
#include "display/gimpdisplayshell-render.h"
|
||||||
#include "display/gimpimagewindow.h"
|
|
||||||
#include "display/gimpstatusbar.h"
|
#include "display/gimpstatusbar.h"
|
||||||
|
|
||||||
#include "tools/gimp-tools.h"
|
#include "tools/gimp-tools.h"
|
||||||
@ -722,17 +721,12 @@ gui_menu_show_tooltip (GimpUIManager *manager,
|
|||||||
if (display)
|
if (display)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
|
|
||||||
gimp_statusbar_push (statusbar, "menu-tooltip",
|
gimp_statusbar_push (statusbar, "menu-tooltip",
|
||||||
NULL, "%s", tooltip);
|
NULL, "%s", tooltip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gui_menu_hide_tooltip (GimpUIManager *manager,
|
gui_menu_hide_tooltip (GimpUIManager *manager,
|
||||||
@ -744,16 +738,11 @@ gui_menu_hide_tooltip (GimpUIManager *manager,
|
|||||||
if (display)
|
if (display)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
|
|
||||||
gimp_statusbar_pop (statusbar, "menu-tooltip");
|
gimp_statusbar_pop (statusbar, "menu-tooltip");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gui_display_changed (GimpContext *context,
|
gui_display_changed (GimpContext *context,
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#include "display/gimpdisplay.h"
|
#include "display/gimpdisplay.h"
|
||||||
#include "display/gimpdisplayshell.h"
|
#include "display/gimpdisplayshell.h"
|
||||||
#include "display/gimpimagewindow.h"
|
#include "display/gimpdisplayshell-appearance.h"
|
||||||
|
|
||||||
#include "gimpmeasureoptions.h"
|
#include "gimpmeasureoptions.h"
|
||||||
#include "gimpmeasuretool.h"
|
#include "gimpmeasuretool.h"
|
||||||
@ -333,10 +333,8 @@ gimp_measure_tool_button_press (GimpTool *tool,
|
|||||||
/* create the info window if necessary */
|
/* create the info window if necessary */
|
||||||
if (! measure->dialog)
|
if (! measure->dialog)
|
||||||
{
|
{
|
||||||
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
if (options->use_info_window ||
|
if (options->use_info_window ||
|
||||||
! gimp_image_window_get_show_statusbar (window))
|
! gimp_display_shell_get_show_statusbar (shell))
|
||||||
{
|
{
|
||||||
measure->dialog = gimp_measure_tool_dialog_new (measure);
|
measure->dialog = gimp_measure_tool_dialog_new (measure);
|
||||||
g_object_add_weak_pointer (G_OBJECT (measure->dialog),
|
g_object_add_weak_pointer (G_OBJECT (measure->dialog),
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include "display/gimpdisplay.h"
|
#include "display/gimpdisplay.h"
|
||||||
#include "display/gimpdisplayshell.h"
|
#include "display/gimpdisplayshell.h"
|
||||||
#include "display/gimpdisplayshell-cursor.h"
|
#include "display/gimpdisplayshell-cursor.h"
|
||||||
#include "display/gimpimagewindow.h"
|
|
||||||
#include "display/gimpstatusbar.h"
|
#include "display/gimpstatusbar.h"
|
||||||
|
|
||||||
#include "gimptool.h"
|
#include "gimptool.h"
|
||||||
@ -896,31 +895,24 @@ gimp_tool_push_status (GimpTool *tool,
|
|||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell;
|
||||||
GimpImageWindow *window;
|
const gchar *stock_id;
|
||||||
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_TOOL (tool));
|
g_return_if_fail (GIMP_IS_TOOL (tool));
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||||
g_return_if_fail (format != NULL);
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
const gchar *stock_id;
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
|
||||||
gimp_statusbar_push_valist (statusbar,
|
gimp_statusbar_push_valist (gimp_display_shell_get_statusbar (shell),
|
||||||
G_OBJECT_TYPE_NAME (tool), stock_id,
|
G_OBJECT_TYPE_NAME (tool), stock_id,
|
||||||
format, args);
|
format, args);
|
||||||
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
|
||||||
|
|
||||||
tool->status_displays = g_list_remove (tool->status_displays, display);
|
tool->status_displays = g_list_remove (tool->status_displays, display);
|
||||||
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
||||||
@ -937,26 +929,19 @@ gimp_tool_push_status_coords (GimpTool *tool,
|
|||||||
const gchar *help)
|
const gchar *help)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell;
|
||||||
GimpImageWindow *window;
|
const gchar *stock_id;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_TOOL (tool));
|
g_return_if_fail (GIMP_IS_TOOL (tool));
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
const gchar *stock_id;
|
|
||||||
|
|
||||||
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
||||||
|
|
||||||
gimp_statusbar_push_coords (statusbar,
|
gimp_statusbar_push_coords (gimp_display_shell_get_statusbar (shell),
|
||||||
G_OBJECT_TYPE_NAME (tool), stock_id,
|
G_OBJECT_TYPE_NAME (tool), stock_id,
|
||||||
precision, title, x, separator, y,
|
precision, title, x, separator, y,
|
||||||
help);
|
help);
|
||||||
}
|
|
||||||
|
|
||||||
tool->status_displays = g_list_remove (tool->status_displays, display);
|
tool->status_displays = g_list_remove (tool->status_displays, display);
|
||||||
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
||||||
@ -971,25 +956,18 @@ gimp_tool_push_status_length (GimpTool *tool,
|
|||||||
const gchar *help)
|
const gchar *help)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell;
|
||||||
GimpImageWindow *window;
|
const gchar *stock_id;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_TOOL (tool));
|
g_return_if_fail (GIMP_IS_TOOL (tool));
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
const gchar *stock_id;
|
|
||||||
|
|
||||||
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
||||||
|
|
||||||
gimp_statusbar_push_length (statusbar,
|
gimp_statusbar_push_length (gimp_display_shell_get_statusbar (shell),
|
||||||
G_OBJECT_TYPE_NAME (tool), stock_id,
|
G_OBJECT_TYPE_NAME (tool), stock_id,
|
||||||
title, axis, value, help);
|
title, axis, value, help);
|
||||||
}
|
|
||||||
|
|
||||||
tool->status_displays = g_list_remove (tool->status_displays, display);
|
tool->status_displays = g_list_remove (tool->status_displays, display);
|
||||||
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
||||||
@ -1002,31 +980,24 @@ gimp_tool_replace_status (GimpTool *tool,
|
|||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell;
|
||||||
GimpImageWindow *window;
|
const gchar *stock_id;
|
||||||
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_TOOL (tool));
|
g_return_if_fail (GIMP_IS_TOOL (tool));
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||||
g_return_if_fail (format != NULL);
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
const gchar *stock_id;
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
|
||||||
gimp_statusbar_replace_valist (statusbar,
|
gimp_statusbar_replace_valist (gimp_display_shell_get_statusbar (shell),
|
||||||
G_OBJECT_TYPE_NAME (tool), stock_id,
|
G_OBJECT_TYPE_NAME (tool), stock_id,
|
||||||
format, args);
|
format, args);
|
||||||
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
|
||||||
|
|
||||||
tool->status_displays = g_list_remove (tool->status_displays, display);
|
tool->status_displays = g_list_remove (tool->status_displays, display);
|
||||||
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
tool->status_displays = g_list_prepend (tool->status_displays, display);
|
||||||
@ -1037,21 +1008,14 @@ gimp_tool_pop_status (GimpTool *tool,
|
|||||||
GimpDisplay *display)
|
GimpDisplay *display)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell;
|
||||||
GimpImageWindow *window;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_TOOL (tool));
|
g_return_if_fail (GIMP_IS_TOOL (tool));
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
window = gimp_display_shell_get_window (shell);
|
|
||||||
|
|
||||||
if (window)
|
gimp_statusbar_pop (gimp_display_shell_get_statusbar (shell),
|
||||||
{
|
|
||||||
GimpStatusbar *statusbar = gimp_image_window_get_statusbar (window);
|
|
||||||
|
|
||||||
gimp_statusbar_pop (statusbar,
|
|
||||||
G_OBJECT_TYPE_NAME (tool));
|
G_OBJECT_TYPE_NAME (tool));
|
||||||
}
|
|
||||||
|
|
||||||
tool->status_displays = g_list_remove (tool->status_displays, display);
|
tool->status_displays = g_list_remove (tool->status_displays, display);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user