app: some cosmetic code cleanup in the color picker tools

This commit is contained in:
Michael Natterer 2014-12-01 13:49:40 +01:00
parent d03b33f1d9
commit 3a6962e0bd
2 changed files with 23 additions and 23 deletions

View File

@ -218,6 +218,7 @@ gimp_color_picker_tool_oper_update (GimpTool *tool,
GIMP_COLOR_TOOL (tool)->pick_mode = options->pick_mode;
gimp_tool_pop_status (tool, display);
if (proximity)
{
gchar *status_help = NULL;

View File

@ -108,10 +108,6 @@ static gboolean gimp_color_tool_real_pick (GimpColorTool *color_tool,
const Babl **sample_format,
GimpRGB *color,
gint *color_index);
static void gimp_color_tool_pick (GimpColorTool *tool,
GimpColorPickState pick_state,
gint x,
gint y);
static void gimp_color_tool_real_picked (GimpColorTool *color_tool,
GimpColorPickState pick_state,
gdouble x,
@ -120,6 +116,11 @@ static void gimp_color_tool_real_picked (GimpColorTool *color_tool,
const GimpRGB *color,
gint color_index);
static void gimp_color_tool_pick (GimpColorTool *tool,
GimpColorPickState pick_state,
gint x,
gint y);
G_DEFINE_TYPE (GimpColorTool, gimp_color_tool, GIMP_TYPE_DRAW_TOOL);
@ -609,8 +610,8 @@ gimp_color_tool_real_picked (GimpColorTool *color_tool,
const GimpRGB *color,
gint color_index)
{
GimpTool *tool = GIMP_TOOL (color_tool);
GimpContext *context;
GimpTool *tool = GIMP_TOOL (color_tool);
GimpContext *context;
/* use this tool's own options here (NOT color_tool->options) */
context = GIMP_CONTEXT (gimp_tool_get_options (tool));
@ -626,29 +627,25 @@ gimp_color_tool_real_picked (GimpColorTool *color_tool,
"gimp-indexed-palette");
if (widget)
{
GimpColormapEditor *editor;
GtkWidget *editor = gtk_bin_get_child (GTK_BIN (widget));
editor = GIMP_COLORMAP_EDITOR (gtk_bin_get_child (GTK_BIN (widget)));
gimp_colormap_editor_set_index (editor, color_index, NULL);
gimp_colormap_editor_set_index (GIMP_COLORMAP_EDITOR (editor),
color_index, NULL);
}
}
if (TRUE)
widget = gimp_dialog_factory_find_widget (gimp_dialog_factory_get_singleton (),
"gimp-palette-editor");
if (widget)
{
widget = gimp_dialog_factory_find_widget (gimp_dialog_factory_get_singleton (),
"gimp-palette-editor");
if (widget)
{
GimpPaletteEditor *editor;
gint index;
GtkWidget *editor = gtk_bin_get_child (GTK_BIN (widget));
gint index;
editor = GIMP_PALETTE_EDITOR (gtk_bin_get_child (GTK_BIN (widget)));
index = gimp_palette_editor_get_index (editor, color);
if (index != -1)
gimp_palette_editor_set_index (editor, index, NULL);
}
index = gimp_palette_editor_get_index (GIMP_PALETTE_EDITOR (editor),
color);
if (index != -1)
gimp_palette_editor_set_index (GIMP_PALETTE_EDITOR (editor),
index, NULL);
}
}
@ -733,6 +730,8 @@ gimp_color_tool_pick (GimpColorTool *tool,
}
/* public functions */
void
gimp_color_tool_enable (GimpColorTool *color_tool,
GimpColorOptions *options)