[gimp] app: minor cleanups in GimpColorPickerTool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: minor cleanups in GimpColorPickerTool
- Date: Sun, 20 Mar 2011 15:57:47 +0000 (UTC)
commit 13bedf69e2e0d57a250fffab19d7dbe19e83bd0c
Author: Michael Natterer <mitch gimp org>
Date: Sun Mar 20 16:57:23 2011 +0100
app: minor cleanups in GimpColorPickerTool
app/tools/gimpcolorpickertool.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimpcolorpickertool.c b/app/tools/gimpcolorpickertool.c
index 1c2295b..53c7e86 100644
--- a/app/tools/gimpcolorpickertool.c
+++ b/app/tools/gimpcolorpickertool.c
@@ -225,9 +225,8 @@ gimp_color_picker_tool_oper_update (GimpTool *tool,
GdkModifierType shift_mod = 0;
if (! picker_tool->dialog)
- {
- shift_mod = GDK_SHIFT_MASK;
- }
+ shift_mod = GDK_SHIFT_MASK;
+
switch (options->pick_mode)
{
case GIMP_COLOR_PICK_MODE_NONE:
@@ -260,6 +259,7 @@ gimp_color_picker_tool_oper_update (GimpTool *tool,
NULL, NULL, NULL);
break;
}
+
if (status_help != NULL)
{
gimp_tool_push_status (tool, display, "%s", status_help);
@@ -299,6 +299,7 @@ static void
gimp_color_picker_tool_info_create (GimpColorPickerTool *picker_tool)
{
GimpTool *tool = GIMP_TOOL (picker_tool);
+ GtkWidget *content_area;
GtkWidget *hbox;
GtkWidget *frame;
GimpRGB color;
@@ -306,7 +307,7 @@ gimp_color_picker_tool_info_create (GimpColorPickerTool *picker_tool)
g_return_if_fail (tool->drawable != NULL);
picker_tool->dialog = gimp_tool_dialog_new (tool->tool_info,
- NULL /* tool->display->shell */,
+ gimp_display_get_shell (tool->display),
_("Color Picker Information"),
GTK_STOCK_CLOSE,
@@ -324,10 +325,11 @@ gimp_color_picker_tool_info_create (GimpColorPickerTool *picker_tool)
G_CALLBACK (gimp_color_picker_tool_info_response),
picker_tool);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (picker_tool->dialog));
+
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
- gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (picker_tool->dialog))),
- hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
picker_tool->color_frame1 = gimp_color_frame_new ();
@@ -389,6 +391,7 @@ gimp_color_picker_tool_info_update (GimpColorPickerTool *picker_tool,
gimp_color_frame_set_color (GIMP_COLOR_FRAME (picker_tool->color_frame2),
sample_type, color, color_index);
+ /* don't use gtk_window_present() because it would focus the dialog */
if (gtk_widget_get_visible (picker_tool->dialog))
gdk_window_show (gtk_widget_get_window (picker_tool->dialog));
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]