2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-01-22 12:17:17 +08:00
|
|
|
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-01-22 12:17:17 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-01-22 12:17:17 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2001-01-22 12:17:17 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2012-03-20 02:57:55 +08:00
|
|
|
#include <gegl.h>
|
2001-01-22 12:17:17 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-22 12:17:17 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "tools-types.h"
|
2001-01-22 12:17:17 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2002-02-22 00:02:30 +08:00
|
|
|
#include "paint/gimppaintoptions.h"
|
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
2011-04-19 03:10:47 +08:00
|
|
|
#include "widgets/gimpspinscale.h"
|
2004-10-12 20:06:50 +08:00
|
|
|
#include "widgets/gimpviewablebox.h"
|
2010-10-30 03:57:26 +08:00
|
|
|
#include "widgets/gimpwidgets-constructors.h"
|
2004-11-24 01:01:51 +08:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
2001-04-11 09:13:53 +08:00
|
|
|
|
2001-04-01 07:04:29 +08:00
|
|
|
#include "gimpairbrushtool.h"
|
2003-06-30 04:40:45 +08:00
|
|
|
#include "gimpclonetool.h"
|
|
|
|
#include "gimpconvolvetool.h"
|
|
|
|
#include "gimpdodgeburntool.h"
|
2001-03-12 12:40:17 +08:00
|
|
|
#include "gimperasertool.h"
|
2006-09-03 02:54:35 +08:00
|
|
|
#include "gimphealtool.h"
|
2001-03-08 09:07:03 +08:00
|
|
|
#include "gimpinktool.h"
|
2003-06-30 04:40:45 +08:00
|
|
|
#include "gimppaintoptions-gui.h"
|
2001-03-12 07:28:16 +08:00
|
|
|
#include "gimppenciltool.h"
|
2006-09-08 01:10:22 +08:00
|
|
|
#include "gimpperspectiveclonetool.h"
|
2001-04-12 01:20:34 +08:00
|
|
|
#include "gimpsmudgetool.h"
|
2003-06-30 04:40:45 +08:00
|
|
|
#include "gimptooloptions-gui.h"
|
2001-02-27 13:21:12 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2001-01-22 12:17:17 +08:00
|
|
|
|
2011-01-08 02:45:29 +08:00
|
|
|
|
2011-01-24 00:14:25 +08:00
|
|
|
static void gimp_paint_options_gui_reset_size (GtkWidget *button,
|
|
|
|
GimpPaintOptions *paint_options);
|
|
|
|
static void gimp_paint_options_gui_reset_aspect_ratio
|
|
|
|
(GtkWidget *button,
|
|
|
|
GimpPaintOptions *paint_options);
|
|
|
|
static void gimp_paint_options_gui_reset_angle (GtkWidget *button,
|
|
|
|
GimpPaintOptions *paint_options);
|
|
|
|
|
|
|
|
static GtkWidget * dynamics_options_gui (GimpPaintOptions *paint_options,
|
|
|
|
GType tool_type);
|
|
|
|
static GtkWidget * jitter_options_gui (GimpPaintOptions *paint_options,
|
|
|
|
GType tool_type);
|
|
|
|
static GtkWidget * smoothing_options_gui (GimpPaintOptions *paint_options,
|
|
|
|
GType tool_type);
|
2001-02-28 07:20:51 +08:00
|
|
|
|
2008-05-10 18:03:21 +08:00
|
|
|
|
2004-09-24 20:01:35 +08:00
|
|
|
/* public functions */
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GtkWidget *
|
2003-02-05 22:39:40 +08:00
|
|
|
gimp_paint_options_gui (GimpToolOptions *tool_options)
|
2001-01-22 12:17:17 +08:00
|
|
|
{
|
2004-10-08 19:08:50 +08:00
|
|
|
GObject *config = G_OBJECT (tool_options);
|
|
|
|
GimpPaintOptions *options = GIMP_PAINT_OPTIONS (tool_options);
|
2006-08-28 06:19:35 +08:00
|
|
|
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
|
2004-10-08 19:08:50 +08:00
|
|
|
GtkWidget *menu;
|
2012-03-10 03:29:19 +08:00
|
|
|
GtkWidget *scale;
|
2004-10-08 19:08:50 +08:00
|
|
|
GType tool_type;
|
2001-01-22 12:17:17 +08:00
|
|
|
|
2003-07-15 23:38:24 +08:00
|
|
|
tool_type = tool_options->tool_info->tool_type;
|
|
|
|
|
2001-01-22 12:17:17 +08:00
|
|
|
/* the paint mode menu */
|
2012-03-10 03:29:19 +08:00
|
|
|
menu = gimp_prop_paint_mode_menu_new (config, "paint-mode", TRUE, FALSE);
|
2013-06-03 22:40:24 +08:00
|
|
|
gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (menu), _("Mode"));
|
2013-06-03 23:35:36 +08:00
|
|
|
g_object_set (menu, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
2013-06-03 22:40:24 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), menu, FALSE, FALSE, 0);
|
2012-03-10 03:29:19 +08:00
|
|
|
gtk_widget_show (menu);
|
2002-03-10 23:05:58 +08:00
|
|
|
|
2004-04-21 18:55:45 +08:00
|
|
|
if (tool_type == GIMP_TYPE_ERASER_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
|
2003-07-15 23:38:24 +08:00
|
|
|
tool_type == GIMP_TYPE_SMUDGE_TOOL)
|
2001-01-22 12:17:17 +08:00
|
|
|
{
|
2004-10-08 19:08:50 +08:00
|
|
|
gtk_widget_set_sensitive (menu, FALSE);
|
2001-01-22 12:17:17 +08:00
|
|
|
}
|
|
|
|
|
2005-11-20 06:19:14 +08:00
|
|
|
/* the opacity scale */
|
2013-06-15 07:28:54 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "opacity",
|
|
|
|
_("Opacity"),
|
|
|
|
0.01, 0.1, 0);
|
|
|
|
gimp_prop_widget_set_factor (scale, 100.0, 1);
|
2010-11-03 05:14:34 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
2010-11-02 05:07:55 +08:00
|
|
|
gtk_widget_show (scale);
|
2005-11-20 06:19:14 +08:00
|
|
|
|
2013-05-22 00:52:40 +08:00
|
|
|
/* temp debug foo */
|
|
|
|
if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL))
|
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
|
|
|
|
button = gimp_prop_check_button_new (config, "use-applicator",
|
|
|
|
"Use GimpApplicator");
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
}
|
|
|
|
|
2005-11-20 06:19:14 +08:00
|
|
|
/* the brush */
|
2006-11-23 04:38:36 +08:00
|
|
|
if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
|
2002-06-17 18:34:28 +08:00
|
|
|
{
|
2012-03-10 03:29:19 +08:00
|
|
|
GtkWidget *button;
|
2010-11-02 19:16:19 +08:00
|
|
|
GtkWidget *hbox;
|
2012-03-10 03:29:19 +08:00
|
|
|
GtkWidget *frame;
|
2009-04-26 01:53:09 +08:00
|
|
|
|
2010-11-02 21:05:47 +08:00
|
|
|
button = gimp_prop_brush_box_new (NULL, GIMP_CONTEXT (tool_options),
|
|
|
|
_("Brush"), 2,
|
2011-04-08 05:48:08 +08:00
|
|
|
"brush-view-type", "brush-view-size",
|
|
|
|
"gimp-brush-editor");
|
2010-11-03 05:14:34 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
2010-11-02 21:05:47 +08:00
|
|
|
gtk_widget_show (button);
|
2006-11-16 23:11:27 +08:00
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
|
2010-11-03 05:14:34 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
2010-11-02 19:16:19 +08:00
|
|
|
gtk_widget_show (hbox);
|
2009-02-06 05:47:57 +08:00
|
|
|
|
2010-11-02 19:16:19 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "brush-size",
|
|
|
|
_("Size"),
|
2012-09-12 02:28:20 +08:00
|
|
|
1.0, 10.0, 2);
|
2011-04-19 03:53:05 +08:00
|
|
|
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 1.0, 1000.0);
|
2012-03-31 07:55:15 +08:00
|
|
|
gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (scale), 1.7);
|
2010-11-02 19:16:19 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (scale);
|
2010-10-30 03:57:26 +08:00
|
|
|
|
2010-11-25 05:31:56 +08:00
|
|
|
button = gimp_stock_button_new (GIMP_STOCK_RESET, NULL);
|
2010-11-03 04:57:37 +08:00
|
|
|
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
|
|
|
gtk_image_set_from_stock (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))),
|
2010-11-25 05:31:56 +08:00
|
|
|
GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU);
|
2010-11-02 19:16:19 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
2010-10-30 03:57:26 +08:00
|
|
|
|
2010-10-31 01:56:24 +08:00
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (gimp_paint_options_gui_reset_size),
|
|
|
|
options);
|
2010-10-30 03:57:26 +08:00
|
|
|
|
2010-11-25 05:31:56 +08:00
|
|
|
gimp_help_set_help_data (button,
|
|
|
|
_("Reset size to brush's native size"), NULL);
|
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
|
2011-01-24 00:14:25 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2010-11-03 05:01:15 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "brush-aspect-ratio",
|
|
|
|
_("Aspect Ratio"),
|
2012-09-12 02:28:20 +08:00
|
|
|
0.1, 1.0, 2);
|
2011-01-24 00:14:25 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
2010-11-03 05:01:15 +08:00
|
|
|
gtk_widget_show (scale);
|
|
|
|
|
2011-01-24 00:14:25 +08:00
|
|
|
button = gimp_stock_button_new (GIMP_STOCK_RESET, NULL);
|
|
|
|
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
|
|
|
gtk_image_set_from_stock (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))),
|
|
|
|
GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (gimp_paint_options_gui_reset_aspect_ratio),
|
|
|
|
options);
|
|
|
|
|
|
|
|
gimp_help_set_help_data (button,
|
|
|
|
_("Reset aspect ratio to brush's native"), NULL);
|
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
|
2011-01-24 00:14:25 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2010-11-03 05:01:15 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "brush-angle",
|
|
|
|
_("Angle"),
|
|
|
|
1.0, 5.0, 2);
|
2011-01-24 00:14:25 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
2010-11-03 05:01:15 +08:00
|
|
|
gtk_widget_show (scale);
|
2004-10-11 21:27:42 +08:00
|
|
|
|
2011-01-24 00:14:25 +08:00
|
|
|
button = gimp_stock_button_new (GIMP_STOCK_RESET, NULL);
|
|
|
|
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
|
|
|
gtk_image_set_from_stock (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))),
|
|
|
|
GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (gimp_paint_options_gui_reset_angle),
|
|
|
|
options);
|
|
|
|
|
|
|
|
gimp_help_set_help_data (button,
|
|
|
|
_("Reset angle to zero"), NULL);
|
|
|
|
|
2010-11-25 05:34:00 +08:00
|
|
|
button = gimp_prop_dynamics_box_new (NULL, GIMP_CONTEXT (tool_options),
|
|
|
|
_("Dynamics"), 2,
|
|
|
|
"dynamics-view-type",
|
2011-04-08 05:48:08 +08:00
|
|
|
"dynamics-view-size",
|
|
|
|
"gimp-dynamics-editor");
|
2010-11-25 05:34:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
frame = dynamics_options_gui (options, tool_type);
|
2004-09-20 03:15:03 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
2003-04-09 04:08:37 +08:00
|
|
|
|
2008-05-27 17:44:16 +08:00
|
|
|
frame = jitter_options_gui (options, tool_type);
|
2005-10-04 03:03:14 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
}
|
|
|
|
|
2011-02-14 17:38:32 +08:00
|
|
|
/* the "smooth stroke" options */
|
|
|
|
if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL))
|
|
|
|
{
|
2012-03-10 03:29:19 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
|
2011-02-14 17:38:32 +08:00
|
|
|
frame = smoothing_options_gui (options, tool_type);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
}
|
2010-10-22 20:47:36 +08:00
|
|
|
|
2001-01-22 12:17:17 +08:00
|
|
|
/* the "incremental" toggle */
|
2004-11-26 23:14:21 +08:00
|
|
|
if (tool_type == GIMP_TYPE_PENCIL_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_ERASER_TOOL)
|
2001-01-22 12:17:17 +08:00
|
|
|
{
|
2012-03-10 03:29:19 +08:00
|
|
|
GtkWidget *button;
|
|
|
|
|
|
|
|
button = gimp_prop_enum_check_button_new (config,
|
|
|
|
"application-mode",
|
|
|
|
_("Incremental"),
|
|
|
|
GIMP_PAINT_CONSTANT,
|
|
|
|
GIMP_PAINT_INCREMENTAL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
2001-01-22 12:17:17 +08:00
|
|
|
}
|
|
|
|
|
2003-07-15 23:38:24 +08:00
|
|
|
/* the "hard edge" toggle */
|
2006-09-08 01:10:22 +08:00
|
|
|
if (tool_type == GIMP_TYPE_ERASER_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_CLONE_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_HEAL_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
|
|
|
|
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
|
2003-07-15 23:38:24 +08:00
|
|
|
tool_type == GIMP_TYPE_SMUDGE_TOOL)
|
|
|
|
{
|
2012-03-10 03:29:19 +08:00
|
|
|
GtkWidget *button;
|
|
|
|
|
2004-06-24 04:29:46 +08:00
|
|
|
button = gimp_prop_check_button_new (config, "hard", _("Hard edge"));
|
2003-07-15 23:38:24 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
return vbox;
|
2001-01-22 12:17:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
static GtkWidget *
|
2010-11-25 05:34:00 +08:00
|
|
|
dynamics_options_gui (GimpPaintOptions *paint_options,
|
|
|
|
GType tool_type)
|
2001-02-28 07:20:51 +08:00
|
|
|
{
|
2004-09-24 20:01:35 +08:00
|
|
|
GObject *config = G_OBJECT (paint_options);
|
2008-05-27 17:44:16 +08:00
|
|
|
GtkWidget *frame;
|
2010-11-25 05:34:00 +08:00
|
|
|
GtkWidget *inner_frame;
|
2010-11-02 05:19:59 +08:00
|
|
|
GtkWidget *scale;
|
2008-05-27 17:44:16 +08:00
|
|
|
GtkWidget *menu;
|
2009-12-07 02:03:39 +08:00
|
|
|
GtkWidget *combo;
|
|
|
|
GtkWidget *checkbox;
|
2010-11-25 05:34:00 +08:00
|
|
|
GtkWidget *vbox;
|
2010-11-26 04:30:29 +08:00
|
|
|
GtkWidget *inner_vbox;
|
|
|
|
GtkWidget *hbox;
|
2010-11-25 05:34:00 +08:00
|
|
|
GtkWidget *box;
|
2003-02-08 01:12:21 +08:00
|
|
|
|
2010-11-26 04:30:29 +08:00
|
|
|
frame = gimp_prop_expander_new (config, "dynamics-expanded",
|
|
|
|
_("Dynamics Options"));
|
2004-11-24 01:01:51 +08:00
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
2010-11-25 05:34:00 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
2002-03-19 03:34:06 +08:00
|
|
|
|
2010-11-26 04:30:29 +08:00
|
|
|
inner_frame = gimp_frame_new (_("Fade Options"));
|
2010-11-25 05:34:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), inner_frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (inner_frame);
|
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
inner_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
2010-11-26 04:30:29 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (inner_frame), inner_vbox);
|
|
|
|
gtk_widget_show (inner_vbox);
|
|
|
|
|
|
|
|
/* the fade-out scale & unitmenu */
|
2011-09-30 17:29:11 +08:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
|
2010-11-26 04:30:29 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (inner_vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2010-11-02 05:19:59 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "fade-length",
|
2010-11-25 05:34:00 +08:00
|
|
|
_("Fade length"), 1.0, 50.0, 0);
|
2011-04-19 03:35:41 +08:00
|
|
|
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 1.0, 1000.0);
|
2010-11-26 04:30:29 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
2010-11-02 05:19:59 +08:00
|
|
|
gtk_widget_show (scale);
|
2002-03-10 23:05:58 +08:00
|
|
|
|
2010-10-15 05:03:34 +08:00
|
|
|
menu = gimp_prop_unit_combo_box_new (config, "fade-unit");
|
2010-11-26 04:30:29 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0);
|
2008-05-27 17:44:16 +08:00
|
|
|
gtk_widget_show (menu);
|
2002-03-10 23:05:58 +08:00
|
|
|
|
2010-10-15 05:03:34 +08:00
|
|
|
#if 0
|
|
|
|
/* FIXME pixel digits */
|
2008-05-27 17:44:16 +08:00
|
|
|
g_object_set_data (G_OBJECT (menu), "set_digits", spinbutton);
|
|
|
|
gimp_unit_menu_set_pixel_digits (GIMP_UNIT_MENU (menu), 0);
|
2010-10-15 05:03:34 +08:00
|
|
|
#endif
|
2002-03-10 23:05:58 +08:00
|
|
|
|
2010-11-26 04:30:29 +08:00
|
|
|
/* the repeat type */
|
2009-12-07 02:03:39 +08:00
|
|
|
combo = gimp_prop_enum_combo_box_new (config, "fade-repeat", 0, 0);
|
2013-06-03 22:40:24 +08:00
|
|
|
gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Repeat"));
|
2013-06-03 23:35:36 +08:00
|
|
|
g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
2013-06-03 22:40:24 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (inner_vbox), combo, TRUE, TRUE, 0);
|
2012-03-13 03:12:11 +08:00
|
|
|
gtk_widget_show (combo);
|
2009-12-07 02:03:39 +08:00
|
|
|
|
2010-11-26 04:30:29 +08:00
|
|
|
checkbox = gimp_prop_check_button_new (config, "fade-reverse",
|
|
|
|
_("Reverse"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (inner_vbox), checkbox, FALSE, FALSE, 0);
|
2009-12-07 02:03:39 +08:00
|
|
|
gtk_widget_show (checkbox);
|
|
|
|
|
2010-11-26 04:30:29 +08:00
|
|
|
/* Color UI */
|
2010-11-25 05:34:00 +08:00
|
|
|
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL))
|
|
|
|
{
|
2010-11-26 04:30:29 +08:00
|
|
|
inner_frame = gimp_frame_new (_("Color Options"));
|
2010-11-25 05:34:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), inner_frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (inner_frame);
|
|
|
|
|
|
|
|
box = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (config),
|
|
|
|
_("Gradient"), 2,
|
|
|
|
"gradient-view-type",
|
|
|
|
"gradient-view-size",
|
2011-04-08 05:48:08 +08:00
|
|
|
"gradient-reverse",
|
|
|
|
"gimp-gradient-editor");
|
2010-11-26 04:30:29 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (inner_frame), box);
|
|
|
|
gtk_widget_show (box);
|
2010-11-25 05:34:00 +08:00
|
|
|
}
|
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2005-10-04 03:03:14 +08:00
|
|
|
static GtkWidget *
|
2008-05-27 02:54:28 +08:00
|
|
|
jitter_options_gui (GimpPaintOptions *paint_options,
|
|
|
|
GType tool_type)
|
2005-10-04 03:03:14 +08:00
|
|
|
{
|
|
|
|
GObject *config = G_OBJECT (paint_options);
|
2008-05-27 17:44:16 +08:00
|
|
|
GtkWidget *frame;
|
2010-11-02 04:03:01 +08:00
|
|
|
GtkWidget *scale;
|
2005-10-04 03:03:14 +08:00
|
|
|
|
2010-11-02 04:03:01 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "jitter-amount",
|
|
|
|
_("Amount"),
|
|
|
|
0.01, 1.0, 2);
|
2005-10-04 03:03:14 +08:00
|
|
|
|
2008-05-27 17:44:16 +08:00
|
|
|
frame = gimp_prop_expanding_frame_new (config, "use-jitter",
|
|
|
|
_("Apply Jitter"),
|
2010-11-02 04:03:01 +08:00
|
|
|
scale, NULL);
|
2005-10-04 03:03:14 +08:00
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2010-10-22 20:47:36 +08:00
|
|
|
static GtkWidget *
|
|
|
|
smoothing_options_gui (GimpPaintOptions *paint_options,
|
|
|
|
GType tool_type)
|
|
|
|
{
|
|
|
|
GObject *config = G_OBJECT (paint_options);
|
|
|
|
GtkWidget *frame;
|
2011-01-09 07:21:10 +08:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *scale;
|
2010-10-22 20:47:36 +08:00
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
2010-10-22 20:47:36 +08:00
|
|
|
|
|
|
|
frame = gimp_prop_expanding_frame_new (config, "use-smoothing",
|
2011-01-08 02:45:29 +08:00
|
|
|
_("Smooth stroke"),
|
2011-01-09 07:21:10 +08:00
|
|
|
vbox, NULL);
|
2010-10-22 20:47:36 +08:00
|
|
|
|
2011-01-09 07:21:10 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "smoothing-quality",
|
|
|
|
_("Quality"),
|
|
|
|
1, 10, 1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
2011-01-08 02:45:29 +08:00
|
|
|
|
2011-01-09 07:21:10 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (config, "smoothing-factor",
|
2011-04-21 02:24:19 +08:00
|
|
|
_("Weight"),
|
2011-01-09 07:21:10 +08:00
|
|
|
1, 10, 1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
2011-01-08 02:45:29 +08:00
|
|
|
|
2010-10-22 20:47:36 +08:00
|
|
|
return frame;
|
|
|
|
}
|
2011-01-09 07:21:10 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_paint_options_gui_reset_size (GtkWidget *button,
|
|
|
|
GimpPaintOptions *paint_options)
|
|
|
|
{
|
|
|
|
GimpBrush *brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
|
|
|
|
|
|
|
|
if (brush)
|
2014-01-04 22:45:25 +08:00
|
|
|
gimp_paint_options_set_default_brush_size (paint_options, brush);
|
2011-01-09 07:21:10 +08:00
|
|
|
}
|
2011-01-24 00:14:25 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_paint_options_gui_reset_aspect_ratio (GtkWidget *button,
|
|
|
|
GimpPaintOptions *paint_options)
|
|
|
|
{
|
|
|
|
g_object_set (paint_options,
|
2011-01-26 05:27:23 +08:00
|
|
|
"brush-aspect-ratio", 0.0,
|
2011-01-24 00:14:25 +08:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_paint_options_gui_reset_angle (GtkWidget *button,
|
|
|
|
GimpPaintOptions *paint_options)
|
|
|
|
{
|
|
|
|
g_object_set (paint_options,
|
|
|
|
"brush-angle", 0.0,
|
|
|
|
NULL);
|
2011-01-24 15:10:01 +08:00
|
|
|
}
|