Widgets.Status: use different reply icon for threads

This commit is contained in:
Bleak Grey 2020-10-24 07:26:27 +03:00
parent 25c49a634e
commit dbf724bc6f
2 changed files with 35 additions and 54 deletions

View File

@ -12,16 +12,16 @@
<property name="can_focus">False</property>
<property name="icon_name">non-starred-symbolic</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">mail-replied-symbolic</property>
</object>
<object class="GtkImage" id="reblog_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-playlist-repeat-symbolic</property>
</object>
<object class="GtkImage" id="reply_button_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">mail-reply-sender-symbolic</property>
</object>
<template class="TootleWidgetsStatus" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
@ -290,7 +290,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">image3</property>
<property name="image">reply_button_icon</property>
<property name="always_show_image">True</property>
<style>
<class name="flat"/>

View File

@ -7,58 +7,35 @@ public class Tootle.Widgets.Status : ListBoxRow {
public API.Status status { get; construct set; }
public API.NotificationType? kind { get; construct set; }
[GtkChild]
protected Grid grid;
[GtkChild] protected Grid grid;
[GtkChild]
protected Image header_icon;
[GtkChild]
protected Widgets.RichLabel header_label;
[GtkChild] protected Image header_icon;
[GtkChild] protected Widgets.RichLabel header_label;
[GtkChild]
public Widgets.Avatar avatar;
[GtkChild]
protected Widgets.RichLabel name_label;
[GtkChild]
protected Widgets.RichLabel handle_label;
[GtkChild]
protected Box indicators;
[GtkChild]
protected Widgets.RichLabel date_label;
[GtkChild]
protected Image pin_indicator;
[GtkChild]
protected Image indicator;
[GtkChild] public Widgets.Avatar avatar;
[GtkChild] protected Widgets.RichLabel name_label;
[GtkChild] protected Widgets.RichLabel handle_label;
[GtkChild] protected Box indicators;
[GtkChild] protected Widgets.RichLabel date_label;
[GtkChild] protected Image pin_indicator;
[GtkChild] protected Image indicator;
[GtkChild]
protected Box content_column;
[GtkChild]
protected Stack spoiler_stack;
[GtkChild]
protected Box content_box;
[GtkChild]
protected Widgets.RichLabel content;
[GtkChild]
protected Widgets.Attachment.Box attachments;
[GtkChild]
protected Button spoiler_button;
[GtkChild]
protected Widgets.RichLabel spoiler_label;
[GtkChild] protected Box content_column;
[GtkChild] protected Stack spoiler_stack;
[GtkChild] protected Box content_box;
[GtkChild] protected Widgets.RichLabel content;
[GtkChild] protected Widgets.Attachment.Box attachments;
[GtkChild] protected Button spoiler_button;
[GtkChild] protected Widgets.RichLabel spoiler_label;
[GtkChild]
protected Box actions;
[GtkChild]
protected Button reply_button;
[GtkChild]
protected ToggleButton reblog_button;
[GtkChild]
protected Image reblog_icon;
[GtkChild]
protected ToggleButton favorite_button;
[GtkChild]
protected ToggleButton bookmark_button;
[GtkChild]
protected Button menu_button;
[GtkChild] protected Box actions;
[GtkChild] protected Button reply_button;
[GtkChild] protected Image reply_button_icon;
[GtkChild] protected ToggleButton reblog_button;
[GtkChild] protected Image reblog_icon;
[GtkChild] protected ToggleButton favorite_button;
[GtkChild] protected ToggleButton bookmark_button;
[GtkChild] protected Button menu_button;
protected string spoiler_text {
owned get {
@ -129,6 +106,10 @@ public class Tootle.Widgets.Status : ListBoxRow {
});
reply_button.clicked.connect (() => new Dialogs.Compose.reply (status));
if (status.formal.in_reply_to_id != null)
reply_button_icon.icon_name = "mail-reply-all-symbolic";
else
reply_button_icon.icon_name = "mail-reply-sender-symbolic";
bind_property ("spoiler-text", spoiler_label, "text", BindingFlags.SYNC_CREATE);
status.formal.bind_property ("content", content, "text", BindingFlags.SYNC_CREATE);