all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH proxmox-yew-comp v3 2/2] schema_validation: add translated description as tooltip to field and checkbox
Date: Thu,  9 Oct 2025 15:31:20 +0200	[thread overview]
Message-ID: <20251009133120.425255-4-h.laimer@proxmox.com> (raw)
In-Reply-To: <20251009133120.425255-1-h.laimer@proxmox.com>

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/schema_validation.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/schema_validation.rs b/src/schema_validation.rs
index fbdf96d..dfbd92f 100644
--- a/src/schema_validation.rs
+++ b/src/schema_validation.rs
@@ -3,6 +3,7 @@ use std::collections::HashMap;
 
 use proxmox_schema::Schema;
 use pwt::{
+    gettext,
     props::FieldBuilder,
     state::Store,
     widget::form::{InputType, NumberTypeInfo, ValidateFn},
@@ -39,6 +40,7 @@ impl SchemaValidation for pwt::widget::form::Field {
                 self.max = s.maximum.map(|v| v as f64);
                 self.step = Some(1.0);
                 self.input_type = InputType::Number;
+                self.set_tip(gettext(s.description));
                 if let Some(value) = s.default {
                     self.set_placeholder(value.to_string());
                 }
@@ -48,6 +50,7 @@ impl SchemaValidation for pwt::widget::form::Field {
                 self.max = s.maximum;
                 self.step = Some(1.0);
                 self.input_type = InputType::Number;
+                self.set_tip(gettext(s.description));
                 if let Some(value) = s.default {
                     self.set_placeholder(value.to_string());
                 }
-- 
2.47.3



_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel


      parent reply	other threads:[~2025-10-09 13:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-09 13:31 [yew-devel] [PATCH proxmox{-yew-widget-toolkit, -yew-comp} v3 0/3] use Schema to populate field properties Hannes Laimer
2025-10-09 13:31 ` [yew-devel] [PATCH proxmox-yew-widget-toolkit v3 1/1] form: expose NumberTypeInfo Hannes Laimer
2025-10-10  8:18   ` [yew-devel] applied: " Dietmar Maurer
2025-10-09 13:31 ` [yew-devel] [PATCH proxmox-yew-comp v3 1/2] schema_validation: use Schema to populate field properties of number, check- and combobox Hannes Laimer
2025-10-10  8:32   ` Dietmar Maurer
2025-10-10 10:46     ` Thomas Lamprecht
2025-10-10 12:43     ` Hannes Laimer
2025-10-10 13:51       ` Dietmar Maurer
2025-10-09 13:31 ` Hannes Laimer [this message]

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=20251009133120.425255-4-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=yew-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