diff --git a/data/app.css b/data/app.css
index 3df38e7..b1ffb14 100644
--- a/data/app.css
+++ b/data/app.css
@@ -20,3 +20,7 @@
.app-view:not(.padded) .preferences row {
border-radius: 0px;
}
+
+.app-action-bar .circular {
+ box-shadow: none;
+}
diff --git a/data/ui/dialogs/main.ui b/data/ui/dialogs/main.ui
index 057e8e2..cca278f 100644
--- a/data/ui/dialogs/main.ui
+++ b/data/ui/dialogs/main.ui
@@ -62,7 +62,6 @@
diff --git a/data/ui/views/profile_header.ui b/data/ui/views/profile_header.ui
index c99941b..135804e 100644
--- a/data/ui/views/profile_header.ui
+++ b/data/ui/views/profile_header.ui
@@ -139,6 +139,7 @@
diff --git a/data/ui/widgets/accounts_button.ui b/data/ui/widgets/accounts_button.ui
index 87be52b..5e2a404 100644
--- a/data/ui/widgets/accounts_button.ui
+++ b/data/ui/widgets/accounts_button.ui
@@ -35,12 +35,150 @@
-
+
+
+ False
+ True
+ 1
+
-
-
+
True
- True
- True
- Favorites
+ False
+ 4
False
@@ -61,42 +198,6 @@
3
-
-
- True
- True
- True
- Conversations
-
-
- False
- True
- 4
-
-
-
-
- True
- True
- Watchlist
-
-
- False
- True
- 5
-
-
-
-
- True
- False
-
-
- False
- True
- 6
-
-
True
@@ -107,7 +208,7 @@
False
True
- 7
+ 4
@@ -120,7 +221,7 @@
False
True
- 8
+ 5
@@ -133,7 +234,7 @@
False
True
- 9
+ 6
diff --git a/meson.build b/meson.build
index ead80fc..5acab04 100644
--- a/meson.build
+++ b/meson.build
@@ -96,6 +96,7 @@ executable(
'src/Views/Federated.vala',
'src/Views/Notifications.vala',
'src/Views/Conversations.vala',
+ 'src/Views/Bookmarks.vala',
'src/Views/ExpandedStatus.vala',
'src/Views/Profile.vala',
'src/Views/Favorites.vala',
diff --git a/src/API/Status.vala b/src/API/Status.vala
index 535fa08..3134b2a 100644
--- a/src/API/Status.vala
+++ b/src/API/Status.vala
@@ -15,6 +15,7 @@ public class Tootle.API.Status : Entity, Widgetizable {
public string created_at { get; set; default = "0"; }
public bool reblogged { get; set; default = false; }
public bool favourited { get; set; default = false; }
+ public bool bookmarked { get; set; default = false; }
public bool sensitive { get; set; default = false; }
public bool muted { get; set; default = false; }
public bool pinned { get; set; default = false; }
diff --git a/src/Views/Bookmarks.vala b/src/Views/Bookmarks.vala
new file mode 100644
index 0000000..67a9283
--- /dev/null
+++ b/src/Views/Bookmarks.vala
@@ -0,0 +1,11 @@
+public class Tootle.Views.Bookmarks : Views.Timeline {
+
+ public Bookmarks () {
+ Object (
+ url: "/api/v1/bookmarks",
+ label: _("Bookmarks"),
+ icon: "user-bookmarks-symbolic"
+ );
+ }
+
+}
diff --git a/src/Widgets/AccountsButton.vala b/src/Widgets/AccountsButton.vala
index 09ae75e..7c63531 100644
--- a/src/Widgets/AccountsButton.vala
+++ b/src/Widgets/AccountsButton.vala
@@ -4,17 +4,17 @@ using Gtk;
public class Tootle.Widgets.AccountsButton : Gtk.MenuButton, IAccountListener {
[GtkTemplate (ui = "/com/github/bleakgrey/tootle/ui/widgets/accounts_button_item.ui")]
- private class Item : Grid {
+ class Item : Grid {
[GtkChild]
- private Widgets.Avatar avatar;
+ Widgets.Avatar avatar;
[GtkChild]
- private Label title;
+ Label title;
[GtkChild]
- private Label handle;
+ Label handle;
[GtkChild]
- private Button profile;
+ Button profile;
[GtkChild]
- private Button forget;
+ Button forget;
public Item (InstanceAccount acc, AccountsButton _self) {
avatar.url = acc.avatar;
@@ -40,42 +40,57 @@ public class Tootle.Widgets.AccountsButton : Gtk.MenuButton, IAccountListener {
}
}
- private bool invalidated = true;
+ bool invalidated = true;
[GtkChild]
- private Widgets.Avatar avatar;
- // [GtkChild]
- // private Spinner spinner;
+ Widgets.Avatar avatar;
[GtkChild]
- private ListBox account_list;
+ ListBox account_list;
[GtkChild]
- private ModelButton item_accounts;
+ ModelButton item_accounts;
[GtkChild]
- private ModelButton item_prefs;
+ ModelButton item_prefs;
[GtkChild]
- private ModelButton item_refresh;
+ ModelButton item_refresh;
[GtkChild]
- private ModelButton item_search;
+ ModelButton item_search;
[GtkChild]
- private ModelButton item_favs;
+ Button item_favs;
[GtkChild]
- private ModelButton item_conversations;
+ Button item_conversations;
+ [GtkChild]
+ Button item_bookmarks;
construct {
connect_account ();
- item_refresh.clicked.connect (() => app.refresh ());
+ item_refresh.clicked.connect (() => {
+ app.refresh ();
+ });
Desktop.set_hotkey_tooltip (item_refresh, null, app.ACCEL_REFRESH);
- item_favs.clicked.connect (() => window.open_view (new Views.Favorites ()));
- item_conversations.clicked.connect (() => window.open_view (new Views.Conversations ()));
- item_search.clicked.connect (() => window.open_view (new Views.Search ()));
- item_prefs.clicked.connect (() => Dialogs.Preferences.open ());
-
- // network.started.connect (() => spinner.show ());
- // network.finished.connect (() => spinner.hide ());
+ item_favs.clicked.connect (() => {
+ window.open_view (new Views.Favorites ());
+ popover.popdown ();
+ });
+ item_conversations.clicked.connect (() => {
+ window.open_view (new Views.Conversations ());
+ popover.popdown ();
+ });
+ item_bookmarks.clicked.connect (() => {
+ window.open_view (new Views.Bookmarks ());
+ popover.popdown ();
+ });
+ item_search.clicked.connect (() => {
+ window.open_view (new Views.Search ());
+ popover.popdown ();
+ });
+ item_prefs.clicked.connect (() => {
+ Dialogs.Preferences.open ();
+ popover.popdown ();
+ });
on_account_changed (null);
@@ -84,7 +99,7 @@ public class Tootle.Widgets.AccountsButton : Gtk.MenuButton, IAccountListener {
rebuild ();
});
- account_list.row_activated.connect (on_selection_changed) ;
+ account_list.row_activated.connect (on_selection_changed);
}
protected void on_selection_changed (ListBoxRow r) {
@@ -92,6 +107,7 @@ public class Tootle.Widgets.AccountsButton : Gtk.MenuButton, IAccountListener {
if (i >= accounts.saved.size) {
active = false;
window.open_view (new Views.NewAccount (true));
+ popover.popdown ();
return;
}
@@ -100,6 +116,7 @@ public class Tootle.Widgets.AccountsButton : Gtk.MenuButton, IAccountListener {
return;
accounts.switch_account (i);
+ popover.popdown ();
}
public virtual void on_accounts_changed (Gee.ArrayList accounts) {
@@ -120,7 +137,7 @@ public class Tootle.Widgets.AccountsButton : Gtk.MenuButton, IAccountListener {
item_accounts.use_markup = true;
}
- private void rebuild () {
+ void rebuild () {
account_list.@foreach (w => account_list.remove (w));
accounts.saved.@foreach (acc => {
var item = new Item (acc, this);
diff --git a/src/Widgets/Status.vala b/src/Widgets/Status.vala
index 5b33433..b7f7062 100644
--- a/src/Widgets/Status.vala
+++ b/src/Widgets/Status.vala
@@ -112,6 +112,11 @@ public class Tootle.Widgets.Status : ListBoxRow {
reblog_button.clicked.connect (() => {
status.action (status.formal.reblogged ? "unreblog" : "reblog");
});
+
+ status.formal.bind_property ("bookmarked", bookmark_button, "active", BindingFlags.SYNC_CREATE);
+ bookmark_button.clicked.connect (() => {
+ status.action (status.formal.bookmarked ? "unbookmark" : "bookmark");
+ });
reply_button.clicked.connect (() => new Dialogs.Compose.reply (status));