public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH yew-widget-toolkit 1/2] form: field: make peek icon tooltip overridable
Date: Thu, 28 May 2026 13:11:13 +0200	[thread overview]
Message-ID: <20260528111123.1225933-2-c.heiss@proxmox.com> (raw)
In-Reply-To: <20260528111123.1225933-1-c.heiss@proxmox.com>

A field with `InputType::Password` may also be useful in other
contexts, which don't necessarily need to be passwords.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 src/widget/form/field.rs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/widget/form/field.rs b/src/widget/form/field.rs
index 1d694b0..ee49f08 100644
--- a/src/widget/form/field.rs
+++ b/src/widget/form/field.rs
@@ -184,6 +184,10 @@ pub struct Field {
     #[builder]
     pub show_peek_icon: bool,
 
+    #[prop_or((tr!("Show Password").into(), tr!("Hide Password").into()))]
+    #[builder]
+    pub peek_icon_tip: (AttrValue, AttrValue),
+
     /// Icons to show on the left (false) or right(true) side of the input
     #[prop_or_default]
     #[builder]
@@ -481,9 +485,9 @@ impl ManagedField for StandardField {
                     "pwt-pointer"
                 );
                 let tooltip_text = if is_hidden {
-                    tr!("Show Password")
+                    &props.peek_icon_tip.0
                 } else {
-                    tr!("Hide Password")
+                    &props.peek_icon_tip.1
                 };
                 Some(Tooltip::new(html! { <i {class} {onclick}/> }).tip(tooltip_text))
             } else {
-- 
2.53.0





  reply	other threads:[~2026-05-28 11:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 11:11 [PATCH datacenter-manager/yew-widget-toolkit 0/2] auto-installer: set proper tooltip for command line show/hide Christoph Heiss
2026-05-28 11:11 ` Christoph Heiss [this message]
2026-05-28 11:11 ` [PATCH datacenter-manager 2/2] ui: auto-installer: use correct tooltip for command line peek icon Christoph Heiss
2026-05-28 11:19 ` [PATCH datacenter-manager/yew-widget-toolkit 0/2] auto-installer: set proper tooltip for command line show/hide Dominik Csapak
2026-05-28 12:15   ` Thomas Lamprecht
2026-05-28 12:56     ` Dominik Csapak

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=20260528111123.1225933-2-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pdm-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal