[gimp] Move the window part of gimp_display_shell_empty() to GimpImageWindow
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Move the window part of gimp_display_shell_empty() to GimpImageWindow
- Date: Tue, 29 Sep 2009 18:38:14 +0000 (UTC)
commit 4cc8f8e6f8c6935dbfb0c3abe98c7adf171a623b
Author: Michael Natterer <mitch gimp org>
Date: Fri Sep 25 01:56:30 2009 +0200
Move the window part of gimp_display_shell_empty() to GimpImageWindow
app/display/gimpdisplayshell.c | 43 +---------------------------------------
app/display/gimpimagewindow.c | 36 +++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 42 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 0c6a1fc..5010c75 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -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))
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 1c6f7c6..300a36f 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]