[gimp] app: make sure the style editor moves with the text layer
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: make sure the style editor moves with the text layer
- Date: Fri, 26 Feb 2010 01:10:27 +0000 (UTC)
commit ebfbc5a0306dbfa687b94fbabf9ac700a38985f7
Author: Michael Natterer <mitch gimp org>
Date: Fri Feb 26 02:10:03 2010 +0100
app: make sure the style editor moves with the text layer
app/tools/gimptexttool-editor.c | 39 +++++++++++++++++++++++++--------------
app/tools/gimptexttool-editor.h | 1 +
app/tools/gimptexttool.c | 2 ++
3 files changed, 28 insertions(+), 14 deletions(-)
---
diff --git a/app/tools/gimptexttool-editor.c b/app/tools/gimptexttool-editor.c
index 4b5d6b3..76d8567 100644
--- a/app/tools/gimptexttool-editor.c
+++ b/app/tools/gimptexttool-editor.c
@@ -134,8 +134,6 @@ gimp_text_tool_editor_start (GimpTextTool *text_tool)
GimpTool *tool = GIMP_TOOL (text_tool);
GimpTextOptions *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
GimpDisplayShell *shell = gimp_display_get_shell (tool->display);
- GtkRequisition requisition;
- gint x, y;
gtk_im_context_set_client_window (text_tool->im_context,
gtk_widget_get_window (shell->canvas));
@@ -169,22 +167,35 @@ gimp_text_tool_editor_start (GimpTextTool *text_tool)
gtk_widget_show (text_tool->style_editor);
}
- gtk_widget_size_request (text_tool->style_overlay, &requisition);
-
- g_object_get (text_tool,
- "x1", &x,
- "y1", &y,
- NULL);
-
- gimp_display_shell_move_overlay (shell,
- text_tool->style_overlay,
- x,
- y - requisition.height - 6);
-
+ gimp_text_tool_editor_position (text_tool);
gtk_widget_show (text_tool->style_overlay);
}
void
+gimp_text_tool_editor_position (GimpTextTool *text_tool)
+{
+ if (text_tool->style_overlay)
+ {
+ GimpTool *tool = GIMP_TOOL (text_tool);
+ GimpDisplayShell *shell = gimp_display_get_shell (tool->display);
+ GtkRequisition requisition;
+ gint x, y;
+
+ gtk_widget_size_request (text_tool->style_overlay, &requisition);
+
+ g_object_get (text_tool,
+ "x1", &x,
+ "y1", &y,
+ NULL);
+
+ gimp_display_shell_move_overlay (shell,
+ text_tool->style_overlay,
+ x,
+ y - requisition.height - 6);
+ }
+}
+
+void
gimp_text_tool_editor_halt (GimpTextTool *text_tool)
{
GimpTextOptions *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
diff --git a/app/tools/gimptexttool-editor.h b/app/tools/gimptexttool-editor.h
index 69cffa2..59d4992 100644
--- a/app/tools/gimptexttool-editor.h
+++ b/app/tools/gimptexttool-editor.h
@@ -28,6 +28,7 @@ void gimp_text_tool_editor_init (GimpTextTool *text_tool
void gimp_text_tool_editor_finalize (GimpTextTool *text_tool);
void gimp_text_tool_editor_start (GimpTextTool *text_tool);
+void gimp_text_tool_editor_position (GimpTextTool *text_tool);
void gimp_text_tool_editor_halt (GimpTextTool *text_tool);
void gimp_text_tool_editor_button_press (GimpTextTool *text_tool,
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index 640f3d8..06e0db2 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -885,6 +885,8 @@ gimp_text_tool_rectangle_change_complete (GimpRectangleTool *rect_tool)
gimp_text_tool_apply (text_tool);
gimp_image_undo_group_end (text_tool->image);
+
+ gimp_text_tool_editor_position (text_tool);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]