[gitg/wip/mockups-aday] Wip



commit 77251e129ce2b06f39f97ea55dc93bf7ba8cd400
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Oct 2 21:07:43 2015 +0200

    Wip

 gitg/commit/gitg-commit.vala     |    4 +-
 gitg/gitg-ui-elements.vala       |    2 +-
 gitg/gitg-window.vala            |   38 ++++++++++++++-------------------
 gitg/history/gitg-history.vala   |    2 +-
 gitg/resources/ui/gitg-window.ui |   43 ++++++++++++++++++++++++++++++++++++-
 5 files changed, 61 insertions(+), 28 deletions(-)
---
diff --git a/gitg/commit/gitg-commit.vala b/gitg/commit/gitg-commit.vala
index 016263f..e994c7b 100644
--- a/gitg/commit/gitg-commit.vala
+++ b/gitg/commit/gitg-commit.vala
@@ -101,7 +101,7 @@ namespace GitgCommit
 
                public string display_name
                {
-                       owned get { return C_("Activity", "Commit"); }
+                       owned get { return C_("Activity", "Changes"); }
                }
 
                public string description
@@ -111,7 +111,7 @@ namespace GitgCommit
 
                public string? icon
                {
-                       owned get { return "document-save-symbolic"; }
+                       owned get { return null; }
                }
 
                public Gtk.Widget? widget
diff --git a/gitg/gitg-ui-elements.vala b/gitg/gitg-ui-elements.vala
index 0374dfd..f1112d6 100644
--- a/gitg/gitg-ui-elements.vala
+++ b/gitg/gitg-ui-elements.vala
@@ -199,7 +199,7 @@ public class UIElements<T> : Object
 
                d_stack.add_with_properties(e.widget,
                                            "name", e.id,
-                                           "title", e.description,
+                                           "title", e.display_name,
                                            "icon-name", e.icon,
                                            "position", insert_position);
        }
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index a10337c..8d7b3e6 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -67,6 +67,12 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        [GtkChild]
        private Gtk.Image dash_image;
        [GtkChild]
+       private Gtk.Button d_branch_button;
+       [GtkChild]
+       private Gtk.Label d_repository_name_label;
+       [GtkChild]
+       private Gtk.Label d_branch_name_label;
+       [GtkChild]
        private Gtk.StackSwitcher d_activities_switcher;
 
        [GtkChild]
@@ -81,6 +87,8 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        private DashView d_dash_view;
 
        [GtkChild]
+       private Gtk.Label d_title_label;
+       [GtkChild]
        private Gtk.Stack d_stack_activities;
 
        [GtkChild]
@@ -368,22 +376,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                if (d_repository != null)
                {
                        // set title
-                       File? workdir = d_repository.get_workdir();
-                       string name;
-
-                       if (workdir != null)
-                       {
-                               var parent_path = Utils.replace_home_dir_with_tilde(workdir.get_parent());
-
-                               name = @"$(d_repository.name) ($parent_path)";
-                               title = @"$name - gitg";
-                       }
-                       else
-                       {
-                               name = d_repository.name;
-                       }
-
-                       d_header_bar.set_title(name);
+                       d_repository_name_label.set_text(d_repository.name);
 
                        string? head_name = null;
 
@@ -396,19 +389,16 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
 
                        if (head_name != null)
                        {
-                               d_header_bar.set_subtitle(Markup.escape_text(head_name));
+                               d_branch_name_label.set_text(Markup.escape_text(head_name));
                        }
                        else
                        {
-                               d_header_bar.set_subtitle(null);
+                               d_branch_name_label.set_text("");
                        }
                }
                else
                {
-                       title = "gitg";
-
-                       d_header_bar.set_title(_("Projects"));
-                       d_header_bar.set_subtitle(null);
+                       d_title_label.set_text(_("Projects"));
                }
        }
 
@@ -424,6 +414,8 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                        d_main_stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT;
                        d_main_stack.set_visible_child(d_stack_activities);
                        d_activities_switcher.show();
+                       d_branch_button.show();
+                       d_title_label.hide();
                        d_dash_button.show();
                        d_dash_view.add_repository(d_repository);
                        d_gear_menu.menu_model = d_activities_model;
@@ -436,6 +428,8 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                        d_main_stack.transition_type = Gtk.StackTransitionType.SLIDE_RIGHT;
                        d_main_stack.set_visible_child(d_dash_view);
                        d_activities_switcher.hide();
+                       d_branch_button.hide();
+                       d_title_label.show();
                        d_dash_button.hide();
                        d_gear_menu.menu_model = d_dash_model;
                        d_gear_menu.hide();
diff --git a/gitg/history/gitg-history.vala b/gitg/history/gitg-history.vala
index 07c1c1d..60b0bb4 100644
--- a/gitg/history/gitg-history.vala
+++ b/gitg/history/gitg-history.vala
@@ -313,7 +313,7 @@ namespace GitgHistory
 
                public string? icon
                {
-                       owned get { return "view-list-symbolic"; }
+                       owned get { return null; }
                }
 
                public Gtk.Widget? widget
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index 98e8ac0..997b2a1 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -18,6 +18,21 @@
         <style>
           <class name="titlebar"/>
         </style>
+        <child type="title">
+          <object class="GtkGrid" id="title_grid">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkStackSwitcher" id="d_activities_switcher">
+                <property name="visible">False</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel" id="d_title_label">
+                <property name="visible">False</property>
+              </object>
+            </child>
+          </object>
+        </child>
         <child>
           <object class="GtkButton" id="d_dash_button">
             <property name="visible">False</property>
@@ -41,11 +56,35 @@
           </packing>
         </child>
         <child>
-          <object class="GtkStackSwitcher" id="d_activities_switcher">
+          <object class="GtkButton" id="d_branch_button">
             <property name="visible">False</property>
+            <property name="valign">center</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="text-button"/>
+            </style>
+            <child>
+              <object class="GtkGrid" id="branch_button_grid">
+                <property name="visible">True</property>
+                <property name="column-spacing">5</property>
+                <child>
+                  <object class="GtkLabel" id="d_repository_name_label">
+                    <property name="visible">True</property>
+                    <style>
+                      <class name="dim-label"/>
+                    </style>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="d_branch_name_label">
+                    <property name="visible">True</property>
+                  </object>
+                </child>
+              </object>
+            </child>
           </object>
           <packing>
-            <property name="pack_type">end</property>
+            <property name="pack_type">start</property>
           </packing>
         </child>
         <child>


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