[gitg/xiaoguang/split-view: 4/4] change button for view to radio button



commit 2499461fe31c6a328aaa6fb55dc66649628af87d
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Sat Jun 30 12:54:38 2018 +0200

    change button for view to radio button

 libgitg/gitg-diff-view-file.vala            |  6 ++--
 libgitg/resources/ui/gitg-diff-view-file.ui | 54 ++++++++++++++++++-----------
 2 files changed, 36 insertions(+), 24 deletions(-)
---
diff --git a/libgitg/gitg-diff-view-file.vala b/libgitg/gitg-diff-view-file.vala
index 917fd267..a266264c 100644
--- a/libgitg/gitg-diff-view-file.vala
+++ b/libgitg/gitg-diff-view-file.vala
@@ -35,8 +35,8 @@ class Gitg.DiffViewFile : Gtk.Grid
        [GtkChild( name = "box_file_renderer" )]
        private Gtk.Box d_box_file_renderer;
 
-       [GtkChild( name = "d_split_button" )]
-       private Gtk.ToggleButton d_split_button;
+       [GtkChild( name = "split_button" )]
+       private Gtk.RadioButton split_button;
 
        private Gtk.ScrolledWindow d_scrolledwindow;
        private Gtk.ScrolledWindow d_scrolledwindow_left;
@@ -259,8 +259,6 @@ class Gitg.DiffViewFile : Gtk.Grid
 
                this.renderer_right.bind_property("added", d_diff_stat_file, "added");
                this.renderer_right.bind_property("removed", d_diff_stat_file, "removed");
-
-               d_split_button.visible = true;
        }
 
        public DiffViewFile.binary(Repository? repository, Ggit.DiffDelta delta)
diff --git a/libgitg/resources/ui/gitg-diff-view-file.ui b/libgitg/resources/ui/gitg-diff-view-file.ui
index e37a35cd..2d9b334d 100644
--- a/libgitg/resources/ui/gitg-diff-view-file.ui
+++ b/libgitg/resources/ui/gitg-diff-view-file.ui
@@ -62,29 +62,43 @@
           </packing>
         </child>
         <child>
-          <object class="GtkToggleButton" id="d_split_button">
-            <property name="visible">False</property>
-            <property name="valign">center</property>
-            <property name="can_focus">False</property>
-            <property name="tooltip-text" translatable="yes">Split view</property>
-            <property name="margin_end">6</property>
-            <signal name="toggled" handler="split_button_toggled" swapped="no"/>
+          <object class="GtkBox">
+            <property name="visible">1</property>
             <style>
-              <class name="text-button"/>
+              <class name="linked"/>
             </style>
             <child>
-              <object class="GtkLabel" id="label_split_view">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="halign">center</property>
-                <property name="valign">baseline</property>
-                <property name="label" translatable="yes">Split View</property>
-                <property name="selectable">True</property>
-                <property name="ellipsize">end</property>
-                <property name="max-width-chars">12</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
+              <object class="GtkRadioButton" id="unif_button">
+                <property name="active">1</property>
+                <property name="visible">1</property>
+                <property name="active">1</property>
+                <property name="draw-indicator">0</property>
+                <property name="tooltip-text" translatable="yes">Unified view</property>
+                <property name="label" translatable="yes">Unif</property>
+                <signal name="toggled" handler="split_button_toggled" swapped="no"/>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">1</property>
+                    <property name="icon-size">1</property>
+                    <property name="icon-name">view-list-symbolic</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="split_button">
+                <property name="visible">1</property>
+                <property name="draw-indicator">0</property>
+                <property name="tooltip-text" translatable="yes">Split view</property>
+                <property name="label" translatable="yes">Split</property>
+                <property name="group">unif_button</property>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">1</property>
+                    <property name="icon-size">1</property>
+                    <property name="icon-name">view-grid-symbolic</property>
+                  </object>
+                </child>
               </object>
             </child>
           </object>


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