all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [PATCH pmg-yew-quarantine-gui 2/2] spam list: show seen/unseen slidable action depending on state
Date: Mon,  8 Jun 2026 16:33:10 +0200	[thread overview]
Message-ID: <20260608143315.3410623-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260608143315.3410623-1-d.csapak@proxmox.com>

Show a 'mark as unseen' action instead of 'mark as seen' if it's already
seen.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/spam_list.rs | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/spam_list.rs b/src/spam_list.rs
index a7f1bd2..7a34df8 100644
--- a/src/spam_list.rs
+++ b/src/spam_list.rs
@@ -298,6 +298,16 @@ fn render_list_item(
                 .with_child(score)
                 .with_child(Fa::new("chevron-right").class(Opacity::Half));
 
+            let seen_action = if item.seen {
+                SlidableAction::new(tr!("Mark as Unseen"))
+                    .icon_class("fa fa-eye-slash")
+                    .on_activate(make_cb(MailAction::MarkUnseen))
+            } else {
+                SlidableAction::new(tr!("Mark as Seen"))
+                    .icon_class("fa fa-eye")
+                    .on_activate(make_cb(MailAction::MarkSeen))
+            };
+
             Slidable::new(main)
                 .class(Overflow::Auto)
                 .on_tap({
@@ -324,11 +334,7 @@ fn render_list_item(
                                 .icon_class("fa fa-check")
                                 .on_activate(make_cb(MailAction::Welcomelist)),
                         )
-                        .with_child(
-                            SlidableAction::new(tr!("Mark as Seen"))
-                                .icon_class("fa fa-eye")
-                                .on_activate(make_cb(MailAction::MarkSeen)),
-                        ),
+                        .with_child(seen_action),
                 )
                 .right_actions(
                     Row::new()
-- 
2.47.3





  parent reply	other threads:[~2026-06-08 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 14:33 [PATCH pmg-yew-quarantine-gui/yew-widget-toolkit-assets 0/2] add 'mark as unseen' action in spam list Dominik Csapak
2026-06-08 14:33 ` [PATCH yew-widget-toolkit-assets 1/2] slidable: make text non-wrapping Dominik Csapak
2026-06-08 14:33 ` Dominik Csapak [this message]
2026-06-09 15:28 ` applied: [PATCH pmg-yew-quarantine-gui/yew-widget-toolkit-assets 0/2] add 'mark as unseen' action in spam list Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260608143315.3410623-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal