[gimp] app: in GimpFilterTool, make region combo insensitive when selection is empty
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: in GimpFilterTool, make region combo insensitive when selection is empty
- Date: Sun, 30 Dec 2018 01:56:10 +0000 (UTC)
commit 093e017df80c19ad981bd3338814aa4021241d09
Author: Ell <ell_se yahoo com>
Date: Sat Dec 29 20:54:35 2018 -0500
app: in GimpFilterTool, make region combo insensitive when selection is empty
app/tools/gimpfiltertool.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
---
diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c
index 3bcfeae742..6b87b97bf7 100644
--- a/app/tools/gimpfiltertool.c
+++ b/app/tools/gimpfiltertool.c
@@ -43,6 +43,7 @@
#include "gegl/gimp-gegl-utils.h"
#include "core/gimp.h"
+#include "core/gimpchannel.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawablefilter.h"
#include "core/gimperror.h"
@@ -160,6 +161,8 @@ static void gimp_filter_tool_flush (GimpDrawableFilter *filter,
static void gimp_filter_tool_config_notify (GObject *object,
const GParamSpec *pspec,
GimpFilterTool *filter_tool);
+static void gimp_filter_tool_mask_changed (GimpImage *image,
+ GimpFilterTool *filter_tool);
static void gimp_filter_tool_add_guide (GimpFilterTool *filter_tool);
static void gimp_filter_tool_remove_guide (GimpFilterTool *filter_tool);
@@ -448,6 +451,12 @@ gimp_filter_tool_initialize (GimpTool *tool,
gimp_filter_tool_create_filter (filter_tool);
+ g_signal_connect_object (image, "mask-changed",
+ G_CALLBACK (gimp_filter_tool_mask_changed),
+ filter_tool, 0);
+
+ gimp_filter_tool_mask_changed (image, filter_tool);
+
return TRUE;
}
@@ -946,6 +955,15 @@ gimp_filter_tool_halt (GimpFilterTool *filter_tool)
gimp_filter_tool_disable_color_picking (filter_tool);
+ if (tool->display)
+ {
+ GimpImage *image = gimp_display_get_image (tool->display);
+
+ g_signal_handlers_disconnect_by_func (image,
+ gimp_filter_tool_mask_changed,
+ filter_tool);
+ }
+
if (filter_tool->gui)
{
/* explicitly clear the dialog contents first, since we might be called
@@ -1110,6 +1128,19 @@ gimp_filter_tool_config_notify (GObject *object,
pspec);
}
+static void
+gimp_filter_tool_mask_changed (GimpImage *image,
+ GimpFilterTool *filter_tool)
+{
+ if (filter_tool->gui)
+ {
+ GimpChannel *mask = gimp_image_get_mask (image);
+
+ gtk_widget_set_sensitive (filter_tool->region_combo,
+ ! gimp_channel_is_empty (mask));
+ }
+}
+
static void
gimp_filter_tool_add_guide (GimpFilterTool *filter_tool)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]