[gitg/wip/clone: 1/4] Add Clone Repository button
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/clone: 1/4] Add Clone Repository button
- Date: Thu, 21 Mar 2013 16:43:05 +0000 (UTC)
commit 4578150ee892cfd034920fc21fc6ef851fd978db
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Mar 20 20:33:50 2013 +0100
Add Clone Repository button
gitg/gitg-window.vala | 14 +++++++++-----
gitg/resources/ui/gitg-window.ui | 21 +++++++++++++++++++--
2 files changed, 28 insertions(+), 7 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index c117887..63bb64e 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -35,7 +35,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
private Gd.HeaderBar d_header_bar;
private Gtk.MenuButton d_gear_menu;
- private Gd.HeaderSimpleButton d_button_open_repository;
+ private Gtk.Box d_dash_buttons_box;
private Gd.HeaderSimpleButton d_button_dash;
private Gd.StackSwitcher d_commit_view_switcher;
@@ -118,7 +118,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
d_main_stack.set_visible_child(d_paned_views);
d_commit_view_switcher.show();
d_button_dash.show();
- d_button_open_repository.hide();
+ d_dash_buttons_box.hide();
d_dash_view.add_repository(d_repository);
}
else
@@ -129,7 +129,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
d_main_stack.set_visible_child(d_dash_scrolled_window);
d_commit_view_switcher.hide();
d_button_dash.hide();
- d_button_open_repository.show();
+ d_dash_buttons_box.show();
}
d_views.update();
@@ -176,8 +176,12 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
{
// Extract widgets from the builder
d_header_bar = builder.get_object("header-bar") as Gd.HeaderBar;
- d_button_open_repository = builder.get_object("button_open_repository") as
Gd.HeaderSimpleButton;
- d_button_open_repository.clicked.connect(on_open_repository);
+
+ d_dash_buttons_box = builder.get_object("dash_buttons_box") as Gtk.Box;
+ var button_open_repository = builder.get_object("button_open_repository") as
Gd.HeaderSimpleButton;
+ button_open_repository.clicked.connect(on_open_repository);
+ var button_clone_repository = builder.get_object("button_clone_repository") as
Gd.HeaderSimpleButton;
+
d_button_dash = builder.get_object("button_dash") as Gd.HeaderSimpleButton;
d_button_dash.clicked.connect((b) => {
repository = null;
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index 74c0f89..3e0ded2 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -19,10 +19,27 @@
<property name="can_focus">False</property>
<property name="vexpand">False</property>
<child>
- <object class="GdHeaderSimpleButton" id="button_open_repository">
+ <object class="GtkBox" id="dash_buttons_box">
<property name="visible">False</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Open Repository</property>
+ <property name="orientation">horizontal</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GdHeaderSimpleButton" id="button_open_repository">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Open Repository</property>
+ </object>
+ </child>
+ <child>
+ <object class="GdHeaderSimpleButton" id="button_clone_repository">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Clone Repository</property>
+ </object>
+ </child>
</object>
<packing>
<property name="pack_type">start</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]