[meld/ui-next: 20/35] filediff: Use a revealer for sourcemap visibility



commit ab16d2a78df316a64328255fcf714a0727bd867f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Mon Jan 28 08:38:58 2019 +1000

    filediff: Use a revealer for sourcemap visibility

 meld/filediff.py              |  7 ++++--
 meld/resources/ui/filediff.ui | 55 ++++++++++++++++++++++++++++++-------------
 2 files changed, 43 insertions(+), 19 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 4a7731ff..02635a9d 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -130,6 +130,7 @@ class FileDiff(Gtk.VBox, MeldDoc):
     dummy_toolbar_actiongutter3 = Template.Child()
     dummy_toolbar_linkmap0 = Template.Child()
     dummy_toolbar_linkmap1 = Template.Child()
+    dummy_toolbar_sourcemap = Template.Child()
     fileentry0 = Template.Child()
     fileentry1 = Template.Child()
     fileentry2 = Template.Child()
@@ -158,7 +159,7 @@ class FileDiff(Gtk.VBox, MeldDoc):
     scrolledwindow0 = Template.Child()
     scrolledwindow1 = Template.Child()
     scrolledwindow2 = Template.Child()
-    sourcemap_hbox = Template.Child()
+    sourcemap_revealer = Template.Child()
     sourcemap0 = Template.Child()
     sourcemap1 = Template.Child()
     sourcemap2 = Template.Child()
@@ -271,7 +272,9 @@ class FileDiff(Gtk.VBox, MeldDoc):
         # Set up per-view action group for top-level menu insertion
         self.view_action_group = Gio.SimpleActionGroup()
         action = Gio.PropertyAction.new(
-            'show-overview-map', self.sourcemap_hbox, 'visible')
+            'show-overview-map', self.sourcemap_revealer, 'reveal-child')
+        self.sourcemap_revealer.bind_property(
+            'child-revealed', self.dummy_toolbar_sourcemap, 'visible')
         self.view_action_group.add_action(action)
 
         for buf in self.textbuffer:
diff --git a/meld/resources/ui/filediff.ui b/meld/resources/ui/filediff.ui
index f1e5b16d..8f7c4f84 100644
--- a/meld/resources/ui/filediff.ui
+++ b/meld/resources/ui/filediff.ui
@@ -606,27 +606,48 @@
           </packing>
         </child>
         <child>
-          <object class="GtkBox" id="sourcemap_hbox">
+          <object class="GtkToolbar" id="dummy_toolbar_sourcemap">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="orientation">horizontal</property>
-            <property name="spacing">2</property>
-            <child>
-              <object class="MeldSourceMap" id="sourcemap0">
-                <property name="view">textview0</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
-            <child>
-              <object class="MeldSourceMap" id="sourcemap1">
-                <property name="view">textview1</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
+            <style>
+              <class name="meld-notebook-toolbar"/>
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">9</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkRevealer" id="sourcemap_revealer">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="reveal-child">True</property>
+            <property name="transition-type">GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT</property>
             <child>
-              <object class="MeldSourceMap" id="sourcemap2">
-                <property name="view">textview2</property>
+              <object class="GtkBox" id="sourcemap_hbox">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">horizontal</property>
+                <property name="spacing">2</property>
+                <child>
+                  <object class="MeldSourceMap" id="sourcemap0">
+                    <property name="view">textview0</property>
+                    <property name="visible">True</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="MeldSourceMap" id="sourcemap1">
+                    <property name="view">textview1</property>
+                    <property name="visible">True</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="MeldSourceMap" id="sourcemap2">
+                    <property name="view">textview2</property>
+                    <property name="visible">True</property>
+                  </object>
+                </child>
               </object>
             </child>
           </object>


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