[gimp] libgimpwidgets: order enum combos of GimpDesaturateMode more logically
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: order enum combos of GimpDesaturateMode more logically
- Date: Fri, 17 Mar 2017 21:52:09 +0000 (UTC)
commit 461d807b05f4363cf8f2b13964511436f83f4b9a
Author: Michael Natterer <mitch gimp org>
Date: Fri Mar 17 22:50:12 2017 +0100
libgimpwidgets: order enum combos of GimpDesaturateMode more logically
This is a bad hack that hardcodes a special case for
GIMP_TYPE_DESATURATE_MODE right into gimp_prop_enum_combo_box_new(),
we should think of something better if we get more special cases.
libgimpwidgets/gimppropwidgets.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c
index 722af62..bc3597e 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -528,7 +528,26 @@ gimp_prop_enum_combo_box_new (GObject *config,
combo_box = g_object_new (GIMP_TYPE_ENUM_COMBO_BOX,
"model", store,
NULL);
+ g_object_unref (store);
+ }
+ else if (param_spec->value_type == GIMP_TYPE_DESATURATE_MODE)
+ {
+ /* this is a bad hack, if we get more of those, we should probably
+ * think of something less ugly
+ */
+ GtkListStore *store;
+ store = gimp_enum_store_new_with_values (param_spec->value_type,
+ 5,
+ GIMP_DESATURATE_LUMINANCE,
+ GIMP_DESATURATE_LUMA,
+ GIMP_DESATURATE_LIGHTNESS,
+ GIMP_DESATURATE_AVERAGE,
+ GIMP_DESATURATE_VALUE);
+
+ combo_box = g_object_new (GIMP_TYPE_ENUM_COMBO_BOX,
+ "model", store,
+ NULL);
g_object_unref (store);
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]