[gnome-builder/wip/chergert/layout] editor: make spaces v tabs property editing work



commit db8e23bba3c3dd35c4b84f97964c84808d7e040c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jul 7 03:11:27 2017 -0700

    editor: make spaces v tabs property editing work
    
    This required a feature in dazzle to force the use of our state as the
    parameter to the action activate callback.

 libide/editor/ide-editor-properties.ui  |    8 ++++----
 libide/editor/ide-editor-view-actions.c |    5 ++++-
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/libide/editor/ide-editor-properties.ui b/libide/editor/ide-editor-properties.ui
index 25765e4..f20b6ae 100644
--- a/libide/editor/ide-editor-properties.ui
+++ b/libide/editor/ide-editor-properties.ui
@@ -102,24 +102,24 @@
                       <class name="linked"/>
                     </style>
                     <child>
-                      <object class="GtkRadioButton">
+                      <object class="GtkToggleButton">
                         <property name="draw-indicator">false</property>
                         <property name="visible">true</property>
                         <property name="label" translatable="yes">Spaces</property>
                         <property name="focus-on-click">false</property>
                         <property name="halign">fill</property>
-                        <property name="action-name">source-view.insert-spaces-instead-of-tabs</property>
+                        <property name="action-name">source-view.use-spaces</property>
                         <property name="action-target">true</property>
                       </object>
                     </child>
                     <child>
-                      <object class="GtkRadioButton" id="tabs_button">
+                      <object class="GtkToggleButton" id="tabs_button">
                         <property name="draw-indicator">false</property>
                         <property name="visible">true</property>
                         <property name="label" translatable="yes">Tabs</property>
                         <property name="focus-on-click">false</property>
                         <property name="halign">fill</property>
-                        <property name="action-name">source-view.insert-spaces-instead-of-tabs</property>
+                        <property name="action-name">source-view.use-spaces</property>
                         <property name="action-target">false</property>
                       </object>
                     </child>
diff --git a/libide/editor/ide-editor-view-actions.c b/libide/editor/ide-editor-view-actions.c
index 9c616c2..062b27c 100644
--- a/libide/editor/ide-editor-view-actions.c
+++ b/libide/editor/ide-editor-view-actions.c
@@ -386,7 +386,6 @@ static const gchar *source_view_property_actions[] = {
   "auto-indent",
   "smart-backspace",
   "highlight-current-line",
-  "insert-spaces-instead-of-tabs",
   "show-line-numbers",
   "show-right-margin",
   "tab-width",
@@ -415,6 +414,10 @@ _ide_editor_view_init_actions (IdeEditorView *self)
       const gchar *name = source_view_property_actions[i];
       dzl_properties_group_add_property (properties, name, name);
     }
+  dzl_properties_group_add_property_full (properties,
+                                          "use-spaces",
+                                          "insert-spaces-instead-of-tabs",
+                                          DZL_PROPERTIES_FLAGS_STATEFUL_BOOLEANS);
 
   /* Our groups will be copied up to be accessed outside of our widget
    * hierarchy. So we expose them all on the IdeEditorView directly


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