mirror of https://github.com/GNOME/gimp.git
Move the window part of gimp_display_shell_empty() to GimpImageWindow
This commit is contained in:
parent
c7fdac4894
commit
4cc8f8e6f8
|
@ -51,7 +51,6 @@
|
|||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpmenufactory.h"
|
||||
#include "widgets/gimpsessioninfo.h"
|
||||
#include "widgets/gimpuimanager.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
|
@ -1303,40 +1302,12 @@ gimp_display_shell_reconnect (GimpDisplayShell *shell)
|
|||
void
|
||||
gimp_display_shell_empty (GimpDisplayShell *shell)
|
||||
{
|
||||
GimpSessionInfo *session_info;
|
||||
GimpContext *user_context;
|
||||
gint width;
|
||||
gint height;
|
||||
GimpContext *user_context;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
|
||||
g_return_if_fail (shell->display->image == NULL);
|
||||
|
||||
gtk_window_unfullscreen (GTK_WINDOW (shell));
|
||||
|
||||
/* get the NIW size before adding the display to the dialog factory
|
||||
* so the window's current size doesn't affect the stored session
|
||||
* info entry.
|
||||
*/
|
||||
session_info =
|
||||
gimp_dialog_factory_find_session_info (shell->display_factory,
|
||||
"gimp-empty-image-window");
|
||||
|
||||
if (session_info)
|
||||
{
|
||||
width = gimp_session_info_get_width (session_info);
|
||||
height = gimp_session_info_get_height (session_info);
|
||||
}
|
||||
else
|
||||
{
|
||||
width = GTK_WIDGET (shell)->allocation.width;
|
||||
height = GTK_WIDGET (shell)->allocation.height;
|
||||
}
|
||||
|
||||
gimp_dialog_factory_add_foreign (shell->display_factory,
|
||||
"gimp-empty-image-window",
|
||||
GTK_WIDGET (shell));
|
||||
|
||||
if (shell->fill_idle_id)
|
||||
{
|
||||
g_source_remove (shell->fill_idle_id);
|
||||
|
@ -1347,9 +1318,6 @@ gimp_display_shell_empty (GimpDisplayShell *shell)
|
|||
|
||||
gimp_display_shell_unset_cursor (shell);
|
||||
|
||||
/* FIXME image window */
|
||||
gimp_statusbar_empty (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar));
|
||||
|
||||
gimp_display_shell_appearance_update (shell);
|
||||
|
||||
gimp_help_set_help_data (shell->canvas,
|
||||
|
@ -1357,15 +1325,6 @@ gimp_display_shell_empty (GimpDisplayShell *shell)
|
|||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
|
||||
gtk_window_unmaximize (GTK_WINDOW (shell));
|
||||
gtk_window_resize (GTK_WINDOW (shell), width, height);
|
||||
|
||||
/* update the ui managers */
|
||||
|
||||
/* FIXME image window */
|
||||
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))
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpmenufactory.h"
|
||||
#include "widgets/gimpsessioninfo.h"
|
||||
#include "widgets/gimpuimanager.h"
|
||||
|
||||
#include "gimpdisplay.h"
|
||||
|
@ -512,6 +513,41 @@ gimp_image_window_image_notify (GimpDisplay *display,
|
|||
}
|
||||
else
|
||||
{
|
||||
GimpSessionInfo *session_info;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
gtk_window_unfullscreen (GTK_WINDOW (window));
|
||||
|
||||
/* get the NIW size before adding the display to the dialog
|
||||
* factory so the window's current size doesn't affect the
|
||||
* stored session info entry.
|
||||
*/
|
||||
session_info =
|
||||
gimp_dialog_factory_find_session_info (window->display_factory,
|
||||
"gimp-empty-image-window");
|
||||
|
||||
if (session_info)
|
||||
{
|
||||
width = gimp_session_info_get_width (session_info);
|
||||
height = gimp_session_info_get_height (session_info);
|
||||
}
|
||||
else
|
||||
{
|
||||
width = GTK_WIDGET (window)->allocation.width;
|
||||
height = GTK_WIDGET (window)->allocation.height;
|
||||
}
|
||||
|
||||
gimp_dialog_factory_add_foreign (window->display_factory,
|
||||
"gimp-empty-image-window",
|
||||
GTK_WIDGET (window));
|
||||
|
||||
gimp_statusbar_empty (GIMP_STATUSBAR (window->statusbar));
|
||||
|
||||
gtk_window_unmaximize (GTK_WINDOW (window));
|
||||
gtk_window_resize (GTK_WINDOW (window), width, height);
|
||||
|
||||
gimp_ui_manager_update (window->menubar_manager, display);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue