mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
07dfe4a5eb
commit
29fee56914
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue