This commit is contained in:
Ignacio Casal Quinteiro 2015-10-02 21:07:43 +02:00
parent 721bc14e2b
commit 77251e129c
5 changed files with 61 additions and 28 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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]
@ -80,6 +86,8 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
[GtkChild]
private DashView d_dash_view;
[GtkChild]
private Gtk.Label d_title_label;
[GtkChild]
private Gtk.Stack d_stack_activities;
@ -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();

View file

@ -313,7 +313,7 @@ namespace GitgHistory
public string? icon
{
owned get { return "view-list-symbolic"; }
owned get { return null; }
}
public Gtk.Widget? widget

View file

@ -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>