summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-01-17 10:46:28 +0100
committerAlexander Larsson <alexl@redhat.com>2012-01-17 11:01:15 +0100
commit511c4c80a7b4b0f6e39b464ef0f3b2c3ecff8c81 (patch)
tree212e1deaf7c46bbf92834eafc7ded2292b114aeb /src
parent72b57b7f3cb7a8c351edcb8b36feb08594fd959a (diff)
downloadgnome-contacts-511c4c80a7b4b0f6e39b464ef0f3b2c3ecff8c81.tar.gz
Add menu style toolbar
Diffstat (limited to 'src')
-rw-r--r--src/contacts-app.vala51
-rw-r--r--src/contacts-list-pane.vala13
2 files changed, 45 insertions, 19 deletions
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index f60c8d5..659cd22 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -247,12 +247,55 @@ public class Contacts.App : Gtk.Application {
window.set_application (this);
window.set_title (_("Contacts"));
window.set_size_request (745, 510);
+ window.hide_titlebar_when_maximized = true;
window.delete_event.connect (window_delete_event);
window.map_event.connect (window_map_event);
window.key_press_event.connect (window_key_press_event);
var grid = new Grid();
+ var toolbar = new Toolbar ();
+ toolbar.set_icon_size (IconSize.MENU);
+ toolbar.get_style_context ().add_class (STYLE_CLASS_MENUBAR);
+ toolbar.set_vexpand (false);
+ toolbar.set_hexpand (true);
+ grid.attach (toolbar, 0, 0, 1, 1);
+
+ var add_button = new ToolButton (null, _("Add..."));
+ add_button.margin_left = 4;
+ add_button.is_important = true;
+ toolbar.add (add_button);
+ add_button.clicked.connect ( (button) => {
+ var dialog = new NewContactDialog (contacts_store, window);
+ dialog.show_all ();
+ });
+
+ var select_button = new ToolButton (null, null);
+ select_button.set_icon_name ("object-select-symbolic");
+ select_button.is_important = false;
+ select_button.set_halign (Align.END);
+ select_button.set_expand (true);
+ toolbar.add (select_button);
+ select_button.clicked.connect ( (button) => {
+ });
+
+ toolbar = new Toolbar ();
+ toolbar.set_icon_size (IconSize.MENU);
+ toolbar.get_style_context ().add_class (STYLE_CLASS_MENUBAR);
+ toolbar.set_vexpand (false);
+ toolbar.set_hexpand (true);
+ grid.attach (toolbar, 1, 0, 1, 1);
+
+ var share_button = new ToolButton (null, null);
+ share_button.margin_right = 4;
+ share_button.set_icon_name ("send-to-symbolic");
+ share_button.is_important = false;
+ share_button.set_halign (Align.END);
+ share_button.set_expand (true);
+ toolbar.add (share_button);
+ share_button.clicked.connect ( (button) => {
+ });
+
var overlay = new Gtk.Overlay ();
overlay.add (grid);
Gdk.RGBA transparent = { 0, 0, 0, 0 };
@@ -261,12 +304,8 @@ public class Contacts.App : Gtk.Application {
list_pane = new ListPane (contacts_store);
list_pane.selection_changed.connect (selection_changed);
- list_pane.create_new.connect ( () => {
- var dialog = new NewContactDialog (contacts_store, window);
- dialog.show_all ();
- });
- grid.attach (list_pane, 0, 0, 1, 2);
+ grid.attach (list_pane, 0, 1, 1, 1);
contacts_pane = new ContactPane (contacts_store);
contacts_pane.set_hexpand (true);
@@ -295,7 +334,7 @@ public class Contacts.App : Gtk.Application {
});
overlay.add_overlay (notification);
});
- grid.attach (contacts_pane, 1, 0, 1, 2);
+ grid.attach (contacts_pane, 1, 1, 1, 1);
overlay.show_all ();
}
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index fa06b41..4f0ec43 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -30,7 +30,6 @@ public class Contacts.ListPane : Frame {
private bool ignore_selection_change;
public signal void selection_changed (Contact? contact);
- public signal void create_new ();
private void refilter () {
string []? values;
@@ -98,18 +97,6 @@ public class Contacts.ListPane : Frame {
separator.set_draw (false);
toolbar.add (separator);
- var add_button = new ToolButton (null, null);
- add_button.set_icon_name ("list-add-symbolic");
- add_button.get_style_context ().add_class (STYLE_CLASS_RAISED);
- add_button.is_important = false;
- // We make the button slightly wider to look better since it
- // becomes taller when added to the toolbar
- add_button.set_size_request (34, -1);
- toolbar.add (add_button);
- add_button.clicked.connect ( (button) => {
- create_new ();
- });
-
this.set_size_request (315, -1);
this.set_hexpand (false);