mirror of https://github.com/GNOME/gimp.git
Add a GimpDisplayShell::scaled() handler to GimpImageWindow
...which is connected to the window's active display. Remove updating the window's menubar_manager from GimpDisplayShell's scaled() impl. Had to hack around a bit with the new API to set the window's active display because they are still the same widget.
This commit is contained in:
parent
a82169ee13
commit
3547a25390
|
@ -386,6 +386,10 @@ gimp_display_new (Gimp *gimp,
|
|||
display_factory);
|
||||
gtk_widget_show (display->shell);
|
||||
|
||||
/* FIXME image window */
|
||||
gimp_image_window_set_active_display (GIMP_IMAGE_WINDOW (display->shell),
|
||||
display);
|
||||
|
||||
/* FIXME image window */
|
||||
g_signal_connect (GIMP_IMAGE_WINDOW (display->shell)->statusbar, "cancel",
|
||||
G_CALLBACK (gimp_display_progress_canceled),
|
||||
|
|
|
@ -675,11 +675,6 @@ gimp_display_shell_real_scaled (GimpDisplayShell *shell)
|
|||
|
||||
gimp_display_shell_title_update (shell);
|
||||
|
||||
/* FIXME image window */
|
||||
/* update the <Image>/View/Zoom menu */
|
||||
gimp_ui_manager_update (GIMP_IMAGE_WINDOW (shell)->menubar_manager,
|
||||
shell->display);
|
||||
|
||||
user_context = gimp_get_user_context (shell->display->gimp);
|
||||
|
||||
if (shell->display == gimp_context_get_display (user_context))
|
||||
|
@ -804,13 +799,12 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||
|
||||
shell->display = display;
|
||||
|
||||
/* FIXME image window */
|
||||
GIMP_IMAGE_WINDOW (shell)->active_display = display;
|
||||
|
||||
shell->popup_manager = popup_manager;
|
||||
shell->display_factory = display_factory;
|
||||
|
||||
/* FIXME image window */
|
||||
gimp_image_window_set_active_display (GIMP_IMAGE_WINDOW (shell),
|
||||
display);
|
||||
|
||||
if (display->image)
|
||||
{
|
||||
options = shell->options;
|
||||
|
|
|
@ -75,6 +75,9 @@ static void gimp_image_window_show_tooltip (GimpUIManager *manager,
|
|||
static void gimp_image_window_hide_tooltip (GimpUIManager *manager,
|
||||
GimpImageWindow *window);
|
||||
|
||||
static void gimp_image_window_shell_scaled (GimpDisplayShell *shell,
|
||||
GimpImageWindow *window);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpImageWindow, gimp_image_window, GIMP_TYPE_WINDOW)
|
||||
|
||||
|
@ -352,17 +355,36 @@ void
|
|||
gimp_image_window_set_active_display (GimpImageWindow *window,
|
||||
GimpDisplay *display)
|
||||
{
|
||||
GimpDisplayShell *active_shell;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE_WINDOW (window));
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||
|
||||
#if 0
|
||||
/* FIXME enable this when the display is a separate widget */
|
||||
if (display == window->active_display)
|
||||
return;
|
||||
|
||||
if (window->active_display)
|
||||
{
|
||||
active_shell = GIMP_DISPLAY_SHELL (window->active_display->shell);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (active_shell,
|
||||
gimp_image_window_shell_scaled,
|
||||
window);
|
||||
}
|
||||
|
||||
window->active_display = display;
|
||||
#endif
|
||||
|
||||
active_shell = GIMP_DISPLAY_SHELL (window->active_display->shell);
|
||||
|
||||
g_signal_connect (active_shell, "scaled",
|
||||
G_CALLBACK (gimp_image_window_shell_scaled),
|
||||
window);
|
||||
|
||||
gimp_ui_manager_update (window->menubar_manager,
|
||||
window->active_display);
|
||||
}
|
||||
|
||||
GimpDisplay *
|
||||
|
@ -415,3 +437,11 @@ gimp_image_window_hide_tooltip (GimpUIManager *manager,
|
|||
gimp_statusbar_pop (GIMP_STATUSBAR (window->statusbar), "menu-tooltip");
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_image_window_shell_scaled (GimpDisplayShell *shell,
|
||||
GimpImageWindow *window)
|
||||
{
|
||||
/* update the <Image>/View/Zoom menu */
|
||||
gimp_ui_manager_update (window->menubar_manager,
|
||||
shell->display);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue