[gimp] app: in filter tools, remember state of the fade and color-options expanders
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: in filter tools, remember state of the fade and color-options expanders
- Date: Tue, 7 Apr 2020 16:43:19 +0000 (UTC)
commit ddd3199e0234364d0d667191d574e8fa6139f0c3
Author: Ell <ell_se yahoo com>
Date: Tue Apr 7 18:52:28 2020 +0300
app: in filter tools, remember state of the fade and color-options expanders
In GimpFilterTool, remember the last expanded state of the color-
options and fade expanders.
app/tools/gimpfilteroptions.c | 32 +++++++++++++++++++++++++++++++-
app/tools/gimpfilteroptions.h | 3 +++
app/tools/gimpfiltertool.c | 9 +++++++++
3 files changed, 43 insertions(+), 1 deletion(-)
---
diff --git a/app/tools/gimpfilteroptions.c b/app/tools/gimpfilteroptions.c
index d1bbb85927..19adef91ba 100644
--- a/app/tools/gimpfilteroptions.c
+++ b/app/tools/gimpfilteroptions.c
@@ -37,7 +37,9 @@ enum
PROP_PREVIEW_SPLIT,
PROP_PREVIEW_SPLIT_ALIGNMENT,
PROP_PREVIEW_SPLIT_POSITION,
- PROP_CONTROLLER
+ PROP_CONTROLLER,
+ PROP_FADE_EXPANDED,
+ PROP_COLOR_OPTIONS_EXPANDED
};
@@ -101,6 +103,18 @@ gimp_filter_options_class_init (GimpFilterOptionsClass *klass)
_("Show on-canvas filter controls"),
TRUE,
GIMP_PARAM_STATIC_STRINGS);
+
+ GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_FADE_EXPANDED,
+ "fade-expanded",
+ NULL, NULL,
+ FALSE,
+ GIMP_PARAM_STATIC_STRINGS);
+
+ GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_COLOR_OPTIONS_EXPANDED,
+ "color-options-expanded",
+ NULL, NULL,
+ FALSE,
+ GIMP_PARAM_STATIC_STRINGS);
}
static void
@@ -138,6 +152,14 @@ gimp_filter_options_set_property (GObject *object,
options->controller = g_value_get_boolean (value);
break;
+ case PROP_FADE_EXPANDED:
+ options->fade_expanded = g_value_get_boolean (value);
+ break;
+
+ case PROP_COLOR_OPTIONS_EXPANDED:
+ options->color_options_expanded = g_value_get_boolean (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -174,6 +196,14 @@ gimp_filter_options_get_property (GObject *object,
g_value_set_boolean (value, options->controller);
break;
+ case PROP_FADE_EXPANDED:
+ g_value_set_boolean (value, options->fade_expanded);
+ break;
+
+ case PROP_COLOR_OPTIONS_EXPANDED:
+ g_value_set_boolean (value, options->color_options_expanded);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
diff --git a/app/tools/gimpfilteroptions.h b/app/tools/gimpfilteroptions.h
index 9cda679d8d..bf1d59fedf 100644
--- a/app/tools/gimpfilteroptions.h
+++ b/app/tools/gimpfilteroptions.h
@@ -41,6 +41,9 @@ struct _GimpFilterOptions
GimpAlignmentType preview_split_alignment;
gdouble preview_split_position;
gboolean controller;
+
+ gboolean fade_expanded;
+ gboolean color_options_expanded;
};
struct _GimpFilterOptionsClass
diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c
index 3b6aeb6ef7..54c6ee6375 100644
--- a/app/tools/gimpfiltertool.c
+++ b/app/tools/gimpfiltertool.c
@@ -1096,6 +1096,11 @@ gimp_filter_tool_update_dialog_operation_settings (GimpFilterTool *filter_tool)
FALSE, FALSE, 0);
gtk_widget_show (expander);
+ g_object_bind_property (options, "fade-expanded",
+ expander, "expanded",
+ G_BINDING_SYNC_CREATE |
+ G_BINDING_BIDIRECTIONAL);
+
frame = gimp_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (expander), frame);
gtk_widget_show (frame);
@@ -1133,6 +1138,10 @@ gimp_filter_tool_update_dialog_operation_settings (GimpFilterTool *filter_tool)
"filter-tool-show-color-options",
expander, "visible",
G_BINDING_SYNC_CREATE);
+ g_object_bind_property (options, "color-options-expanded",
+ expander, "expanded",
+ G_BINDING_SYNC_CREATE |
+ G_BINDING_BIDIRECTIONAL);
frame = gimp_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (expander), frame);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]