From 4b41ac1c3fb7297818094930ff200e3e33a76b07 Mon Sep 17 00:00:00 2001 From: Evangelos Paterakis Date: Thu, 17 Nov 2022 22:35:01 +0200 Subject: [PATCH] feat: open profile on name click --- src/Widgets/RichLabelContainer.vala | 4 ++-- src/Widgets/Status.vala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Widgets/RichLabelContainer.vala b/src/Widgets/RichLabelContainer.vala index c839186..e11861a 100644 --- a/src/Widgets/RichLabelContainer.vala +++ b/src/Widgets/RichLabelContainer.vala @@ -19,7 +19,7 @@ public class Tooth.Widgets.RichLabelContainer : Adw.Bin { widget.clicked.connect (on_click); } - public void set_label (string text, string? url, Gee.HashMap? emojis) { + public void set_label (string text, string? url, Gee.HashMap? emojis, bool force_no_style = false) { if (text.contains(":") && emojis != null) { string[] labelss = text.split (":"); @@ -80,7 +80,7 @@ public class Tooth.Widgets.RichLabelContainer : Adw.Bin { // if there's no url // make the button look // like a label - if (url ==null) { + if (url ==null || force_no_style) { widget.add_css_class("ttl-label-emoji-no-click"); } diff --git a/src/Widgets/Status.vala b/src/Widgets/Status.vala index bca9ab9..688e994 100644 --- a/src/Widgets/Status.vala +++ b/src/Widgets/Status.vala @@ -138,7 +138,7 @@ public class Tooth.Widgets.Status : ListBoxRow { status.formal.bind_property ("content", content, "content", BindingFlags.SYNC_CREATE); // bind_property ("title_text", name_label, "label", BindingFlags.SYNC_CREATE); // title_text - name_label.set_label(title_text, null, status.formal.account.emojis_map); + name_label.set_label(title_text, status.formal.account.handle, status.formal.account.emojis_map, true); bind_property ("subtitle_text", handle_label, "label", BindingFlags.SYNC_CREATE); bind_property ("date", date_label, "label", BindingFlags.SYNC_CREATE); status.formal.bind_property ("pinned", pin_indicator, "visible", BindingFlags.SYNC_CREATE);