[gimp/blend-tool-fun: 61/163] app: fix visibility of the color picker tools info window
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/blend-tool-fun: 61/163] app: fix visibility of the color picker tools info window
- Date: Mon, 26 Oct 2015 02:23:20 +0000 (UTC)
commit c7477c97dea819511876b7faf18cd8c40325aacc
Author: Michael Natterer <mitch gimp org>
Date: Sun Sep 20 00:37:05 2015 +0200
app: fix visibility of the color picker tools info window
Since commit 867b1f7e the window did always pop if it was set to
visible once, even if closed and "Use info window" disabled.
Fix this by adapting the show logic to the fact that we now keep the
widget alive across images/displays.
app/display/gimptoolgui.c | 15 +++++++++++++++
app/display/gimptoolgui.h | 1 +
app/tools/gimpcolorpickertool.c | 12 ++++++++----
3 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/app/display/gimptoolgui.c b/app/display/gimptoolgui.c
index e12bb30..f2b3dee 100644
--- a/app/display/gimptoolgui.c
+++ b/app/display/gimptoolgui.c
@@ -391,6 +391,21 @@ gimp_tool_gui_get_vbox (GimpToolGui *gui)
return GET_PRIVATE (gui)->vbox;
}
+gboolean
+gimp_tool_gui_get_visible (GimpToolGui *gui)
+{
+ GimpToolGuiPrivate *private;
+
+ g_return_if_fail (GIMP_IS_TOOL_GUI (gui));
+
+ private = GET_PRIVATE (gui);
+
+ if (private->overlay)
+ return gtk_widget_get_parent (private->dialog) != NULL;
+ else
+ return gtk_widget_get_visible (private->dialog);
+}
+
void
gimp_tool_gui_show (GimpToolGui *gui)
{
diff --git a/app/display/gimptoolgui.h b/app/display/gimptoolgui.h
index 9e77e18..fe6867d 100644
--- a/app/display/gimptoolgui.h
+++ b/app/display/gimptoolgui.h
@@ -72,6 +72,7 @@ void gimp_tool_gui_set_viewable (GimpToolGui *gui,
GtkWidget * gimp_tool_gui_get_dialog (GimpToolGui *gui);
GtkWidget * gimp_tool_gui_get_vbox (GimpToolGui *gui);
+gboolean gimp_tool_gui_get_visible (GimpToolGui *gui);
void gimp_tool_gui_show (GimpToolGui *gui);
void gimp_tool_gui_hide (GimpToolGui *gui);
diff --git a/app/tools/gimpcolorpickertool.c b/app/tools/gimpcolorpickertool.c
index 6c86943..2f3b792 100644
--- a/app/tools/gimpcolorpickertool.c
+++ b/app/tools/gimpcolorpickertool.c
@@ -303,10 +303,14 @@ gimp_color_picker_tool_picked (GimpColorTool *color_tool,
if (options->use_info_window && ! picker_tool->gui)
gimp_color_picker_tool_info_create (picker_tool);
- if (picker_tool->gui)
- gimp_color_picker_tool_info_update (picker_tool,
- GIMP_COLOR_OPTIONS (options)->sample_average,
- sample_format, pixel, color);
+ if (picker_tool->gui &&
+ (options->use_info_window ||
+ gimp_tool_gui_get_visible (picker_tool->gui)))
+ {
+ gimp_color_picker_tool_info_update (picker_tool,
+ GIMP_COLOR_OPTIONS (options)->sample_average,
+ sample_format, pixel, color);
+ }
GIMP_COLOR_TOOL_CLASS (parent_class)->picked (color_tool, pick_state,
x, y,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]