[gimp] app: mypaint: Make the reset-to-defaults button reset to the current myb's defaults



commit cba2f07854edd46b13c36131235bd06adfd81e92
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Mon Dec 28 16:02:36 2015 -0800

    app: mypaint: Make the reset-to-defaults button reset to the current myb's defaults

 app/paint/gimpmybrushoptions.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/app/paint/gimpmybrushoptions.c b/app/paint/gimpmybrushoptions.c
index 1858eb7..a659e27 100644
--- a/app/paint/gimpmybrushoptions.c
+++ b/app/paint/gimpmybrushoptions.c
@@ -56,6 +56,8 @@ static void   gimp_mybrush_options_get_property     (GObject      *object,
 static void    gimp_mybrush_options_mybrush_changed (GimpContext  *context,
                                                      GimpMybrush  *brush);
 
+static void    gimp_mybrush_options_reset           (GimpToolOptions *tool_options);
+
 
 G_DEFINE_TYPE (GimpMybrushOptions, gimp_mybrush_options,
                GIMP_TYPE_PAINT_OPTIONS)
@@ -64,14 +66,17 @@ G_DEFINE_TYPE (GimpMybrushOptions, gimp_mybrush_options,
 static void
 gimp_mybrush_options_class_init (GimpMybrushOptionsClass *klass)
 {
-  GObjectClass     *object_class  = G_OBJECT_CLASS (klass);
-  GimpContextClass *context_class = GIMP_CONTEXT_CLASS (klass);
+  GObjectClass         *object_class  = G_OBJECT_CLASS (klass);
+  GimpContextClass     *context_class = GIMP_CONTEXT_CLASS (klass);
+  GimpToolOptionsClass *options_class = GIMP_TOOL_OPTIONS_CLASS (klass);
 
   object_class->set_property     = gimp_mybrush_options_set_property;
   object_class->get_property     = gimp_mybrush_options_get_property;
 
   context_class->mybrush_changed = gimp_mybrush_options_mybrush_changed;
 
+  options_class->reset           = gimp_mybrush_options_reset;
+
   GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_RADIUS,
                                    "radius", _("Radius"),
                                    -2.0, 6.0, 1.0,
@@ -165,3 +170,12 @@ gimp_mybrush_options_mybrush_changed (GimpContext *context,
                   "eraser",   gimp_mybrush_get_is_eraser (brush),
                   NULL);
 }
+
+static void
+gimp_mybrush_options_reset (GimpToolOptions *tool_options)
+{
+  GimpContext *context = GIMP_CONTEXT (tool_options);
+  GimpMybrush *brush   = gimp_context_get_mybrush (context);
+
+  gimp_mybrush_options_mybrush_changed (context, brush);
+}
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]