jarek-foksa / xel

Xel - Widget toolkit for building native-like Electron and Web apps
https://xel-toolkit.org
Other
677 stars 58 forks source link

<x-tooltip> does not work with <x-menuitem> #139

Open edgardozoppi opened 6 months ago

edgardozoppi commented 6 months ago

The following HTML fragment does not show the tooltip when mouse hover over the menu item.

<x-menuitem>
    <x-icon href="#history-undo"></x-icon>
    <x-tooltip>Undo</x-tooltip>
</x-menuitem>
jarek-foksa commented 5 months ago

I don't recall ever seeing a menu item tooltip in a desktop app. If it is not mentioned in either macOS, Windows, GNOME or Material HIG then I believe Xel should not implement it.

edgardozoppi commented 5 months ago

That's ok, make sense. I have managed to make it work using some CSS. But just to give you some context I am using <x-menuitem> inside a <x-menubar> to implement a toolbar. I know I can use <x-buttons> instead but I like more how it looks the other way (no borders and highlight on hover etc. is nicer IMO).

Screenshot 2024-01-10 at 13 06 38
jarek-foksa commented 5 months ago

I think the proper solution should be to add a new "toolbar" skin to <x-button> with stylings matching each HIG (e.g. hovering the button should highlight it on Windows, but not on macOS).

edgardozoppi commented 2 months ago

Since <x-menuitem> is used for displaying <x-select> options, it would be nice to be able to add a <x-tooltip> to each option so we can provide to the user additional information while hovering over the options.