[gimp] Move the GtkWidget::style_set() handler to GimpImageWindow
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Move the GtkWidget::style_set() handler to GimpImageWindow
- Date: Tue, 29 Sep 2009 18:36:33 +0000 (UTC)
commit 03fcc99bbfc8568e71cfc0f917d8cac977523fab
Author: Michael Natterer <mitch gimp org>
Date: Wed Sep 23 18:13:08 2009 +0200
Move the GtkWidget::style_set() handler to GimpImageWindow
...and remove it from GimpDisplayShell completely.
app/display/gimpdisplayshell.c | 45 ----------------------------------------
app/display/gimpimagewindow.c | 43 ++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 45 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 90b9b94..9adb19e 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -123,8 +123,6 @@ static gboolean
gimp_display_shell_window_state_event (GtkWidget *widget,
GdkEventWindowState *event);
static gboolean gimp_display_shell_popup_menu (GtkWidget *widget);
-static void gimp_display_shell_style_set (GtkWidget *widget,
- GtkStyle *prev_style);
static void gimp_display_shell_real_scaled (GimpDisplayShell *shell);
@@ -205,7 +203,6 @@ gimp_display_shell_class_init (GimpDisplayShellClass *klass)
widget_class->configure_event = gimp_display_shell_configure_event;
widget_class->window_state_event = gimp_display_shell_window_state_event;
widget_class->popup_menu = gimp_display_shell_popup_menu;
- widget_class->style_set = gimp_display_shell_style_set;
klass->scaled = gimp_display_shell_real_scaled;
klass->scrolled = NULL;
@@ -669,48 +666,6 @@ gimp_display_shell_popup_menu (GtkWidget *widget)
}
static void
-gimp_display_shell_style_set (GtkWidget *widget,
- GtkStyle *prev_style)
-{
- GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
- GtkRequisition requisition;
- GdkGeometry geometry;
- GdkWindowHints geometry_mask;
-
- GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
-
- /* FIXME image window */
- gtk_widget_size_request (GIMP_IMAGE_WINDOW (shell)->statusbar, &requisition);
-
- geometry.min_height = 23;
-
- geometry.min_width = requisition.width;
- geometry.min_height += requisition.height;
-
- /* FIXME image window */
- if (GIMP_IMAGE_WINDOW (shell)->menubar)
- {
- gtk_widget_size_request (GIMP_IMAGE_WINDOW (shell)->menubar, &requisition);
-
- geometry.min_height += requisition.height;
- }
-
- geometry_mask = GDK_HINT_MIN_SIZE;
-
- /* Only set user pos on the empty display because it gets a pos
- * set by gimp. All other displays should be placed by the window
- * manager. See http://bugzilla.gnome.org/show_bug.cgi?id=559580
- */
- if (! shell->display->image)
- geometry_mask |= GDK_HINT_USER_POS;
-
- gtk_window_set_geometry_hints (GTK_WINDOW (widget), NULL,
- &geometry, geometry_mask);
-
- gimp_dialog_factory_set_has_min_size (GTK_WINDOW (widget), TRUE);
-}
-
-static void
gimp_display_shell_real_scaled (GimpDisplayShell *shell)
{
GimpContext *user_context;
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index af2b777..5c886be 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -66,6 +66,8 @@ static void gimp_image_window_destroy (GtkObject *object);
static gboolean gimp_image_window_window_state (GtkWidget *widget,
GdkEventWindowState *event);
+static void gimp_image_window_style_set (GtkWidget *widget,
+ GtkStyle *prev_style);
static void gimp_image_window_show_tooltip (GimpUIManager *manager,
const gchar *tooltip,
@@ -102,6 +104,7 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
gtk_object_class->destroy = gimp_image_window_destroy;
widget_class->window_state_event = gimp_image_window_window_state;
+ widget_class->style_set = gimp_image_window_style_set;
g_object_class_install_property (object_class, PROP_MENU_FACTORY,
g_param_spec_object ("menu-factory",
@@ -302,6 +305,46 @@ gimp_image_window_window_state (GtkWidget *widget,
return FALSE;
}
+static void
+gimp_image_window_style_set (GtkWidget *widget,
+ GtkStyle *prev_style)
+{
+ GimpImageWindow *window = GIMP_IMAGE_WINDOW (widget);
+ GtkRequisition requisition;
+ GdkGeometry geometry;
+ GdkWindowHints geometry_mask;
+
+ GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
+
+ gtk_widget_size_request (window->statusbar, &requisition);
+
+ geometry.min_height = 23;
+
+ geometry.min_width = requisition.width;
+ geometry.min_height += requisition.height;
+
+ if (window->menubar)
+ {
+ gtk_widget_size_request (window->menubar, &requisition);
+
+ geometry.min_height += requisition.height;
+ }
+
+ geometry_mask = GDK_HINT_MIN_SIZE;
+
+ /* Only set user pos on the empty display because it gets a pos
+ * set by gimp. All other displays should be placed by the window
+ * manager. See http://bugzilla.gnome.org/show_bug.cgi?id=559580
+ */
+ if (! gimp_image_window_get_active_display (window)->image)
+ geometry_mask |= GDK_HINT_USER_POS;
+
+ gtk_window_set_geometry_hints (GTK_WINDOW (widget), NULL,
+ &geometry, geometry_mask);
+
+ gimp_dialog_factory_set_has_min_size (GTK_WINDOW (widget), TRUE);
+}
+
/* public functions */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]