From: Shannon Sterz <s.sterz@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH yew-widget-toolkit v2 1/1] tab bar: make `TabBarItem::tip` work as intended
Date: Tue, 16 Dec 2025 15:38:55 +0100 [thread overview]
Message-ID: <20251216143856.302676-2-s.sterz@proxmox.com> (raw)
In-Reply-To: <20251216143856.302676-1-s.sterz@proxmox.com>
previously setting a tooltip via the `tip()` function of an
`TabBarItem` had no effect. so actually render a tooltip with the
provided `VNode` as content if a tooltip is set on a `TabBarItem`
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
src/widget/tab/tab_bar.rs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/widget/tab/tab_bar.rs b/src/widget/tab/tab_bar.rs
index d3de24f5..44fb9f39 100644
--- a/src/widget/tab/tab_bar.rs
+++ b/src/widget/tab/tab_bar.rs
@@ -8,7 +8,7 @@ use crate::dom::{element_direction_rtl, DomSizeObserver, IntoHtmlElement};
use crate::props::{IntoStorageLocation, StorageLocation};
use crate::state::{NavigationContext, NavigationContextExt, PersistentState, Selection};
use crate::web_sys_ext::{ResizeObserverBoxOptions, ResizeObserverOptions};
-use crate::widget::Container;
+use crate::widget::{Container, Tooltip};
use crate::{impl_class_prop_builder, impl_yew_std_props_builder, prelude::*};
use super::TabBarItem;
@@ -464,7 +464,7 @@ impl Component for PwtTabBar {
let aria_disabled = if disabled { "true" } else { "false" };
let style = format!("grid-column: {};", i + 1);
- html! {
+ let content = html! {
<a ref={active_ref} aria-disabled={aria_disabled} {style} {onclick} {onkeyup} class={nav_class} {tabindex}>
<span ref={size_ref}>
if let Some(class) = &panel.icon_class {
@@ -473,6 +473,12 @@ impl Component for PwtTabBar {
{panel.label.as_deref().unwrap_or("")}
</span>
</a>
+ };
+
+ if let Some(tip) = panel.tip.clone() {
+ Tooltip::new(content).rich_tip(tip).into()
+ } else {
+ content
}
})
.collect::<Html>();
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-12-16 14:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 14:38 [pdm-devel] [PATCH datacenter-manager/yew-widget-toolkit v2 0/2] disable content tab on pbs datastores when they are in maintenance mode "offline" Shannon Sterz
2025-12-16 14:38 ` Shannon Sterz [this message]
2025-12-17 13:21 ` [pdm-devel] applied: [PATCH yew-widget-toolkit v2 1/1] tab bar: make `TabBarItem::tip` work as intended Dominik Csapak
2025-12-16 14:38 ` [pdm-devel] [PATCH datacenter-manager v2 1/1] ui: datastore panel: disable content tab when datastore is offline Shannon Sterz
2025-12-17 13:23 ` 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=20251216143856.302676-2-s.sterz@proxmox.com \
--to=s.sterz@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