diff --git a/data/ui/dialogs/main.ui b/data/ui/dialogs/main.ui index d827b9b..94fe514 100644 --- a/data/ui/dialogs/main.ui +++ b/data/ui/dialogs/main.ui @@ -75,9 +75,9 @@ True - + False @@ -113,11 +113,27 @@ 1 + + + True + False + slide-left + 200 + + + + + + end + 2 + + True False slide-right + 200 True diff --git a/data/ui/views/profile_header.ui b/data/ui/views/profile_header.ui index 936cc7c..c99941b 100644 --- a/data/ui/views/profile_header.ui +++ b/data/ui/views/profile_header.ui @@ -2,102 +2,11 @@ - - False - - - True - False - 8 - 8 - 8 - 8 - vertical - 8 - True - - - Posts - True - True - False - True - True - - - False - True - 0 - - - - - Posts and Replies - True - True - False - True - True - filter_all - - - False - True - 1 - - - - - Media - True - True - False - True - True - filter_all - - - False - True - 2 - - - - - - - True - False - - - True - False - __glade_unnamed_3 - True - - - - - True - False - __glade_unnamed_8 - True - - - - - True - False - __glade_unnamed_9 - True - - - 400 True False - 8 + 16 8 8 @@ -181,85 +90,6 @@ - - - True - False - False - False - - - True - False - 8 - 8 - 8 - 8 - 8 - - - True - False - False - 0 - - - True - True - 0 - - - - - True - False - False - - - Follow - True - True - True - - - False - True - 0 - - - - - True - True - True - True - options - False - - - - - - False - True - 1 - - - - - - False - True - 1 - - - - - - True @@ -300,4 +130,16 @@ + + True + False + True + True + + + True + False + + + diff --git a/data/ui/widgets/timeline_filter.ui b/data/ui/widgets/timeline_filter.ui index 648b5ee..aaa40c4 100644 --- a/data/ui/widgets/timeline_filter.ui +++ b/data/ui/widgets/timeline_filter.ui @@ -275,15 +275,16 @@ True popover - + True False - 100 - crossfade + center + 6 True False + User end True @@ -291,47 +292,21 @@ - title + False + True + 0 - + True False - center - 8 - - - True - False - mail-send-symbolic - - - False - True - 0 - - - - - True - False - 1K - end - True - - - - - - False - True - 1 - - + pan-down-symbolic - title_scrolled + False + True + end 1 diff --git a/src/Dialogs/MainWindow.vala b/src/Dialogs/MainWindow.vala index dbe1771..dd15c3e 100644 --- a/src/Dialogs/MainWindow.vala +++ b/src/Dialogs/MainWindow.vala @@ -16,6 +16,8 @@ public class Tootle.Dialogs.MainWindow: Gtk.Window, ISavedWindow { [GtkChild] protected Revealer view_navigation; [GtkChild] + protected Revealer view_controls; + [GtkChild] protected Button back_button; [GtkChild] protected Button compose_button; @@ -130,6 +132,18 @@ public class Tootle.Dialogs.MainWindow: Gtk.Window, ISavedWindow { timeline_stack.visible_child_name = num.to_string (); } + public void set_header_controls (Widget w) { + reset_header_controls (); + view_controls.add (w); + view_controls.reveal_child = true; + } + public void reset_header_controls () { + view_controls.reveal_child = false; + view_controls.get_children ().@foreach (w => { + view_controls.remove (w); + }); + } + bool on_button_press (EventButton ev) { if (ev.button == 8) return back (); @@ -147,7 +161,7 @@ public class Tootle.Dialogs.MainWindow: Gtk.Window, ISavedWindow { void update_header () { bool primary_mode = get_visible_id () == 0; switcher_navbar.visible = timeline_switcher.sensitive = primary_mode; - timeline_switcher.opacity = primary_mode ? 1 : 0; //Prevent HeaderBar height jitter + // timeline_switcher.opacity = primary_mode ? 1 : 0; //Prevent HeaderBar height jitter view_navigation.reveal_child = !primary_mode; if (primary_mode) diff --git a/src/Views/Profile.vala b/src/Views/Profile.vala index 4fbfdd2..ff6be99 100644 --- a/src/Views/Profile.vala +++ b/src/Views/Profile.vala @@ -7,12 +7,11 @@ public class Tootle.Views.Profile : Views.Timeline { ListBox profile_list; Label relationship; - Box actions; - Button follow_button; - MenuButton options_button; - Widgets.TimelineFilter filter; + Button rs_button; + Label rs_button_label; + public bool exclude_replies { get; set; default = true; } public bool only_media { get; set; default = false; } @@ -40,16 +39,15 @@ public class Tootle.Views.Profile : Views.Timeline { return true; }); + var note_row = builder.get_object ("note_row") as ListBoxRow; var note = builder.get_object ("note") as Widgets.RichLabel; profile.bind_property ("note", note, "text", BindingFlags.SYNC_CREATE, (b, src, ref target) => { - target.set_string (Html.simplify ((string) src)); + var text = Html.simplify ((string) src); + target.set_string (text); + note_row.visible = text != ""; return true; }); - actions = builder.get_object ("actions") as Box; - follow_button = builder.get_object ("follow_button") as Button; - follow_button.clicked.connect (on_follow_button_clicked); - options_button = builder.get_object ("options_button") as MenuButton; relationship = builder.get_object ("relationship") as Label; // posts_label = builder.get_object ("posts_label") as Label; @@ -71,6 +69,10 @@ public class Tootle.Views.Profile : Views.Timeline { // return true; // }); + rs_button = builder.get_object ("rs_button") as Button; + rs_button.clicked.connect (on_rs_button_clicked); + rs_button_label = builder.get_object ("rs_button_label") as Label; + rebuild_fields (); } @@ -84,20 +86,22 @@ public class Tootle.Views.Profile : Views.Timeline { public override void on_shown () { window.header.custom_title = filter; + window.set_header_controls (rs_button); } public override void on_hidden () { window.header.custom_title = null; + window.reset_header_controls (); } - void on_follow_button_clicked () { - actions.sensitive = false; + void on_rs_button_clicked () { + rs_button.sensitive = false; profile.set_following (!profile.rs.following); } void on_rs_updated () { var rs = profile.rs; var label = ""; - if (actions.sensitive = rs != null) { + if (rs_button.sensitive = rs != null) { if (rs.requested) label = _("Sent follow request"); else if (rs.followed_by && rs.following) @@ -105,22 +109,14 @@ public class Tootle.Views.Profile : Views.Timeline { else if (rs.followed_by) label = _("Follows you"); - foreach (Widget w in new Widget[] { follow_button, options_button }) { + foreach (Widget w in new Widget[] { rs_button }) { var ctx = w.get_style_context (); ctx.remove_class (STYLE_CLASS_SUGGESTED_ACTION); ctx.remove_class (STYLE_CLASS_DESTRUCTIVE_ACTION); ctx.add_class (rs.following ? STYLE_CLASS_DESTRUCTIVE_ACTION : STYLE_CLASS_SUGGESTED_ACTION); } - var label2 = ""; - if (rs.followed_by && !rs.following) - label2 = _("Follow back"); - else if (rs.following) - label2 = _("Unfollow"); - else - label2 = _("Follow"); - - follow_button.label = label2; + rs_button_label.label = rs.following ? _("Unfollow") : _("Follow"); } relationship.label = label; @@ -171,7 +167,7 @@ public class Tootle.Views.Profile : Views.Timeline { if (profile.fields != null) { foreach (Entity e in profile.fields) { var w = new Field (e as API.AccountField); - profile_list.insert (w, 2); + profile_list.insert (w, -1); } } } diff --git a/src/Widgets/Status.vala b/src/Widgets/Status.vala index c77bf24..6936698 100644 --- a/src/Widgets/Status.vala +++ b/src/Widgets/Status.vala @@ -106,7 +106,7 @@ public class Tootle.Widgets.Status : EventBox { bind_property ("escaped-spoiler", content, "text", BindingFlags.SYNC_CREATE); bind_property ("escaped-content", revealer_content, "text", BindingFlags.SYNC_CREATE); status.formal.account.bind_property ("avatar", avatar, "url", BindingFlags.SYNC_CREATE); - status.account.bind_property ("handle", handle_label, "label", BindingFlags.SYNC_CREATE); + status.formal.account.bind_property ("handle", handle_label, "label", BindingFlags.SYNC_CREATE); bind_property ("display_name", name_label, "text", BindingFlags.SYNC_CREATE); bind_property ("date", date_label, "label", BindingFlags.SYNC_CREATE); status.formal.bind_property ("pinned", pin_indicator, "visible", BindingFlags.SYNC_CREATE);