[gnome-builder] colorpicker: add prefs for color filtering



commit aeb41899e93c3635af5a1ed5a20d563fb15e4e40
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Wed Jul 20 21:34:53 2016 +0200

    colorpicker: add prefs for color filtering

 plugins/color-picker/gb-color-picker-prefs.c       |    5 ++
 ...builder.plugins.color_picker_plugin.gschema.xml |    5 ++
 plugins/color-picker/gtk/color-picker-prefs.ui     |   73 ++++++++++++++++++++
 3 files changed, 83 insertions(+), 0 deletions(-)
---
diff --git a/plugins/color-picker/gb-color-picker-prefs.c b/plugins/color-picker/gb-color-picker-prefs.c
index 17bf87d..8604dc9 100644
--- a/plugins/color-picker/gb-color-picker-prefs.c
+++ b/plugins/color-picker/gb-color-picker-prefs.c
@@ -436,6 +436,10 @@ gb_color_picker_prefs_bind_settings (GbColorPickerPrefs *self)
   g_settings_bind (self->plugin_settings,"strings-visible",
                    self->panel, "strings-visible",
                    G_SETTINGS_BIND_GET);
+
+  g_settings_bind (self->plugin_settings,"filter",
+                   self->panel, "filter",
+                   G_SETTINGS_BIND_GET);
 }
 
 static void
@@ -449,6 +453,7 @@ gb_color_picker_prefs_unbind_settings (GbColorPickerPrefs *self)
   g_settings_unbind (self->panel, "rgb-visible");
   g_settings_unbind (self->panel, "rgb-unit");
   g_settings_unbind (self->panel, "string-visible");
+  g_settings_unbind (self->panel, "filter");
 }
 
 void
diff --git a/plugins/color-picker/gsettings/org.gnome.builder.plugins.color_picker_plugin.gschema.xml 
b/plugins/color-picker/gsettings/org.gnome.builder.plugins.color_picker_plugin.gschema.xml
index 8d6f127..c4df1f1 100644
--- a/plugins/color-picker/gsettings/org.gnome.builder.plugins.color_picker_plugin.gschema.xml
+++ b/plugins/color-picker/gsettings/org.gnome.builder.plugins.color_picker_plugin.gschema.xml
@@ -40,5 +40,10 @@
       <summary>Color strings visibility</summary>
       <description>The visible color strings.</description>
     </key>
+    <key name="filter" type="s">
+      <default>"none"</default>
+      <summary>color filter</summary>
+      <description>The filter used on the color scales and color plane.</description>
+    </key>
   </schema>
 </schemalist>
diff --git a/plugins/color-picker/gtk/color-picker-prefs.ui b/plugins/color-picker/gtk/color-picker-prefs.ui
index bbb2baa..c7ee23f 100644
--- a/plugins/color-picker/gtk/color-picker-prefs.ui
+++ b/plugins/color-picker/gtk/color-picker-prefs.ui
@@ -190,6 +190,79 @@
         </child>
       </object>
     </child>
+    <child>
+      <object class="GtkLabel">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="halign">start</property>
+        <property name="label" translatable="yes">Filters:</property>
+        <style>
+          <class name="cp-prefs-grouptitle"/>
+        </style>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkLabel">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_top">6</property>
+        <property name="margin_bottom">6</property>
+        <property name="label" translatable="yes">Select a filter that act on the colors or 
'None'.</property>
+        <property name="justify">fill</property>
+        <property name="wrap">True</property>
+        <style>
+          <class name="cp-prefs-resume"/>
+          <class name="dim-label"/>
+        </style>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GbColorPickerPrefsList">
+        <property name="visible">True</property>
+        <child>
+          <object class="IdePreferencesSwitch" id="none-filter_switch">
+            <property name="visible">True</property>
+            <property name="key">filter</property>
+            <property name="is-radio">True</property>
+            <property name="schema-id">org.gnome.builder.plugins.color_picker_plugin</property>
+            <property name="target">"none"</property>
+            <property name="title">None</property>
+            <style>
+              <class name="cp-prefs-switch"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="IdePreferencesSwitch" id="websafe_filter_switch">
+            <property name="visible">True</property>
+            <property name="key">filter</property>
+            <property name="is-radio">True</property>
+            <property name="schema-id">org.gnome.builder.plugins.color_picker_plugin</property>
+            <property name="target">"websafe"</property>
+            <property name="title">Websafe</property>
+            <style>
+              <class name="cp-prefs-switch"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+          </packing>
+        </child>
+      </object>
+    </child>
   </object>
   <object class="GtkBox" id="colorstrings_page">
     <property name="visible">True</property>


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