[gtksourceview/wip/minimap] Add a toggle to show the map to the test widget



commit 69b1c0b7f694114900f8481567300ed1e545dcf0
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat May 2 19:36:59 2015 +0200

    Add a toggle to show the map to the test widget

 tests/test-widget.c  |   10 ++++++++++
 tests/test-widget.ui |   24 +++++++++++++++++++-----
 2 files changed, 29 insertions(+), 5 deletions(-)
---
diff --git a/tests/test-widget.c b/tests/test-widget.c
index 1702d3b..ac8e7e9 100644
--- a/tests/test-widget.c
+++ b/tests/test-widget.c
@@ -52,6 +52,8 @@ struct _TestWidgetPrivate
        GtkSourceView *view;
        GtkSourceBuffer *buffer;
        GtkSourceFile *file;
+       GtkWidget *map_scrolledwindow;
+       GtkCheckButton *show_map_checkbutton;
        GtkCheckButton *indent_width_checkbutton;
        GtkSpinButton *indent_width_spinbutton;
        GtkLabel *cursor_position_info;
@@ -980,6 +982,8 @@ test_widget_class_init (TestWidgetClass *klass)
        gtk_widget_class_bind_template_callback (widget_class, smart_home_end_changed_cb);
 
        gtk_widget_class_bind_template_child_private (widget_class, TestWidget, view);
+       gtk_widget_class_bind_template_child_private (widget_class, TestWidget, map_scrolledwindow);
+       gtk_widget_class_bind_template_child_private (widget_class, TestWidget, show_map_checkbutton);
        gtk_widget_class_bind_template_child_private (widget_class, TestWidget, indent_width_checkbutton);
        gtk_widget_class_bind_template_child_private (widget_class, TestWidget, indent_width_spinbutton);
        gtk_widget_class_bind_template_child_private (widget_class, TestWidget, cursor_position_info);
@@ -1037,6 +1041,12 @@ test_widget_init (TestWidget *self)
                                "style-scheme",
                                G_BINDING_SYNC_CREATE);
 
+       g_object_bind_property (self->priv->show_map_checkbutton,
+                               "active",
+                               self->priv->map_scrolledwindow,
+                               "visible",
+                               G_BINDING_SYNC_CREATE);
+
        g_signal_connect (self->priv->background_pattern,
                          "changed",
                          G_CALLBACK (on_background_pattern_changed),
diff --git a/tests/test-widget.ui b/tests/test-widget.ui
index c5ada05..b34c7cb 100644
--- a/tests/test-widget.ui
+++ b/tests/test-widget.ui
@@ -171,6 +171,20 @@
               </packing>
             </child>
             <child>
+              <object class="GtkCheckButton" id="show_map_checkbutton">
+                <property name="label">Show source map</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">6</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkCheckButton" id="highlight_current_line">
                 <property name="label">Highlight current line</property>
                 <property name="visible">True</property>
@@ -181,7 +195,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">6</property>
+                <property name="top_attach">7</property>
               </packing>
             </child>
             <child>
@@ -195,7 +209,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">7</property>
+                <property name="top_attach">8</property>
               </packing>
             </child>
             <child>
@@ -209,7 +223,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">8</property>
+                <property name="top_attach">9</property>
               </packing>
             </child>
             <child>
@@ -249,7 +263,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">9</property>
+                <property name="top_attach">10</property>
               </packing>
             </child>
             <child>
@@ -528,7 +542,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkScrolledWindow" id="scrolledwindow2">
+          <object class="GtkScrolledWindow" id="map_scrolledwindow">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <child>


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