public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH yew-widget-toolkit] widget: navigation drawer: match menu item indents with the icon width
@ 2026-12-01 11:02 Shannon Sterz
  2026-12-01 11:42 ` Dominik Csapak
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Shannon Sterz @ 2026-12-01 11:02 UTC (permalink / raw)
  To: yew-devel

Icons have a fixed width of 16px in essentially all themes. 1rem is
equivalent to the font-size of the root element of the current
document. This varies by theme between 13 and 20px. So the icons here
aligned differently depending on the theme. Make the indent always
match the width of an icon to avoid that. This should improve
usability for deeply nested menus.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 src/widget/nav/navigation_drawer.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/widget/nav/navigation_drawer.rs b/src/widget/nav/navigation_drawer.rs
index ab8ac2e8..491cccd4 100644
--- a/src/widget/nav/navigation_drawer.rs
+++ b/src/widget/nav/navigation_drawer.rs
@@ -264,7 +264,7 @@ impl PwtNavigationDrawer {
             .onkeydown(onkeydown)
             // add indentation
             .with_optional_child((indent_level > 0).then(|| {
-                html! {<span style={format!("width: {}rem", (indent_level as f32) * 1.0)}/>}
+                html! {<span style={format!("width: {}px", indent_level * 16)}/>}
             }))
             // add optional icon on the left
             .with_optional_child(
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-01 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 11:02 [PATCH yew-widget-toolkit] widget: navigation drawer: match menu item indents with the icon width Shannon Sterz
2026-12-01 11:42 ` Dominik Csapak
2026-12-01 12:27   ` Shannon Sterz
2026-12-01 12:48 ` Superseded: " Shannon Sterz
2026-12-01 14:21 ` applied: " Thomas Lamprecht
2026-12-01 14:33   ` Thomas Lamprecht

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