From c7c8cde087b65839d57086cecefe2ebae987856d Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 19 Oct 2005 11:34:22 +0000 Subject: [PATCH] set cursor modifier and status bar hints to improve discoverability of 2005-10-19 Sven Neumann * app/tools/gimpcurvestool.c (gimp_curves_tool_oper_update): set cursor modifier and status bar hints to improve discoverability of Curves tool features. --- ChangeLog | 6 ++++++ app/tools/gimpcurvestool.c | 43 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2fdda54e39..5bf4369fa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-19 Sven Neumann + + * app/tools/gimpcurvestool.c (gimp_curves_tool_oper_update): set + cursor modifier and status bar hints to improve discoverability of + Curves tool features. + 2005-10-18 Sven Neumann * plug-ins/gimpressionist/presets.c: added a Save icon. diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index b082865779..4fbe4dd06c 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -76,6 +76,10 @@ static void gimp_curves_tool_finalize (GObject *object); static gboolean gimp_curves_tool_initialize (GimpTool *tool, GimpDisplay *gdisp); +static void gimp_curves_tool_oper_update (GimpTool *tool, + GimpCoords *coords, + GdkModifierType state, + GimpDisplay *gdisp); static void gimp_curves_tool_button_release (GimpTool *tool, GimpCoords *coords, guint32 time, @@ -190,6 +194,7 @@ gimp_curves_tool_class_init (GimpCurvesToolClass *klass) object_class->finalize = gimp_curves_tool_finalize; tool_class->initialize = gimp_curves_tool_initialize; + tool_class->oper_update = gimp_curves_tool_oper_update; tool_class->button_release = gimp_curves_tool_button_release; color_tool_class->picked = gimp_curves_tool_color_picked; @@ -316,6 +321,36 @@ gimp_curves_tool_initialize (GimpTool *tool, return TRUE; } +static void +gimp_curves_tool_oper_update (GimpTool *tool, + GimpCoords *coords, + GdkModifierType state, + GimpDisplay *gdisp) +{ + GimpColorPickMode mode = GIMP_COLOR_PICK_MODE_NONE; + const gchar *status = NULL; + + GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, gdisp); + + gimp_tool_pop_status (tool, gdisp); + + if (state & GDK_SHIFT_MASK) + { + mode = GIMP_COLOR_PICK_MODE_PALETTE; + status = _("Click to add a control point."); + } + else if (state & GDK_CONTROL_MASK) + { + mode = GIMP_COLOR_PICK_MODE_PALETTE; + status = _("Click to add control points to all channels."); + } + + GIMP_COLOR_TOOL (tool)->pick_mode = mode; + + if (status) + gimp_tool_push_status (tool, gdisp, status); +} + static void gimp_curves_tool_button_release (GimpTool *tool, GimpCoords *coords, @@ -343,6 +378,7 @@ gimp_curves_tool_button_release (GimpTool *tool, curves_add_point (c_tool, i); curves_calculate_curve (c_tool->curves, c_tool->channel); } + curves_update (c_tool, GRAPH | XRANGE); } @@ -1063,10 +1099,12 @@ curves_graph_events (GtkWidget *widget, if (new_cursor != cursor_type) { + Gimp *gimp = GIMP_TOOL (tool)->tool_info->gimp; + cursor_type = new_cursor; gimp_cursor_set (tool->graph, - GIMP_GUI_CONFIG (GIMP_TOOL (tool)->tool_info->gimp->config)->cursor_format, + GIMP_GUI_CONFIG (gimp->config)->cursor_format, cursor_type, GIMP_TOOL_CURSOR_NONE, GIMP_CURSOR_MODIFIER_NONE); @@ -1252,7 +1290,8 @@ curves_graph_expose (GtkWidget *widget, gdk_draw_layout (widget->window, graph_gc, RADIUS + - ROUND (((gdouble) width * (tool->col_value[channel])) / 256.0 + x), + ROUND (((gdouble) width * + (tool->col_value[channel])) / 256.0 + x), height - y - 2, tool->xpos_layout); } -- GitLab