[gitg/wip/submodules: 8/8] Bind orientation preference to submodule diff



commit 92a13b1e293f54065fed0b297990d51c48b77a08
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sun Dec 14 10:04:13 2014 +0100

    Bind orientation preference to submodule diff

 gitg/commit/gitg-commit-submodule-diff-view.vala   |   13 ++
 .../ui/gitg-commit-submodule-diff-view.ui          |  123 +++++++++++---------
 2 files changed, 83 insertions(+), 53 deletions(-)
---
diff --git a/gitg/commit/gitg-commit-submodule-diff-view.vala 
b/gitg/commit/gitg-commit-submodule-diff-view.vala
index 1d2add9..ee4d299 100644
--- a/gitg/commit/gitg-commit-submodule-diff-view.vala
+++ b/gitg/commit/gitg-commit-submodule-diff-view.vala
@@ -32,6 +32,19 @@ class SubmoduleDiffView : Gtk.Box
   [GtkChild (name = "diff_view_unstaged")]
   private Gitg.DiffView d_diff_view_unstaged;
 
+  [GtkChild (name = "box_diffs")]
+  private Gtk.Box d_box_diffs;
+
+  construct
+  {
+    var interface_settings = new Settings("org.gnome.gitg.preferences.interface");
+
+    interface_settings.bind("orientation",
+                            d_box_diffs,
+                            "orientation",
+                            SettingsBindFlags.GET);
+  }
+
   public SubmoduleInfo info
   {
     get { return d_info; }
diff --git a/gitg/resources/ui/gitg-commit-submodule-diff-view.ui 
b/gitg/resources/ui/gitg-commit-submodule-diff-view.ui
index b843dae..7842ab5 100644
--- a/gitg/resources/ui/gitg-commit-submodule-diff-view.ui
+++ b/gitg/resources/ui/gitg-commit-submodule-diff-view.ui
@@ -4,7 +4,7 @@
   <requires lib="gitg" version="3.0"/>
   <template class="GitgCommitSubmoduleDiffView" parent="GtkBox">
     <property name="orientation">vertical</property>
-    <property name="spacing">6</property>
+    <property name="spacing">12</property>
     <child>
       <object class="GitgCommitSubmoduleInfo" id="info">
         <property name="visible">True</property>
@@ -17,15 +17,11 @@
       </packing>
     </child>
     <child>
-      <object class="GtkLabel" id="label_staged">
+      <object class="GtkLabel" id="label_message">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="halign">start</property>
-        <property name="margin_top">12</property>
-        <property name="label" translatable="yes">Staged:</property>
-        <style>
-          <class name="title-label"/>
-        </style>
+        <property name="label" translatable="yes">The submodule is in a dirty state and has staged and/or 
unstaged changes that are not yet committed as shown below.</property>
       </object>
       <packing>
         <property name="expand">False</property>
@@ -34,63 +30,84 @@
       </packing>
     </child>
     <child>
-      <object class="GtkFrame" id="frame_staged">
+      <object class="GtkBox" id="box_diffs">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
         <child>
-          <object class="GitgDiffView" id="diff_view_staged">
+          <object class="GtkBox" id="box_staged">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="hexpand">True</property>
-            <property name="vexpand">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label_staged">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="valign">start</property>
+                <property name="label" translatable="yes">Staged:</property>
+                <style>
+                  <class name="title-label"/>
+                </style>
+              </object>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame_staged">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <child>
+                  <object class="GitgDiffView" id="diff_view_staged">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                  </object>
+                </child>
+              </object>
+            </child>
           </object>
         </child>
-      </object>
-      <packing>
-        <property name="expand">True</property>
-        <property name="fill">True</property>
-        <property name="position">2</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkLabel" id="label_nstaged">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="halign">start</property>
-        <property name="margin_top">12</property>
-        <property name="label" translatable="yes">Unstaged:</property>
-        <style>
-          <class name="title-label"/>
-        </style>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">3</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkFrame" id="frame_unstaged">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
         <child>
-          <object class="GitgDiffView" id="diff_view_unstaged">
+          <object class="GtkBox" id="box_unstaged">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="hexpand">True</property>
-            <property name="vexpand">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label_unstaged">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="valign">start</property>
+                <property name="label" translatable="yes">Unstaged:</property>
+                <style>
+                  <class name="title-label"/>
+                </style>
+              </object>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame_unstaged">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <child>
+                  <object class="GitgDiffView" id="diff_view_unstaged">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                  </object>
+                </child>
+              </object>
+            </child>
           </object>
         </child>
       </object>
-      <packing>
-        <property name="expand">True</property>
-        <property name="fill">True</property>
-        <property name="position">4</property>
-      </packing>
     </child>
   </template>
 </interface>
\ No newline at end of file


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