Replace text-only tooltips with custom richly styled tooltips (#3436)

* Replace the title attribute with custom FloatingMenu tooltips

* Separate tooltip labels and descriptions into two styled blocks

* Move keyboard shortcut tooltips to a separate section at the bottom

* Update shortcut key styling in tooltips and hints bar

* Fix .to_string()
This commit is contained in:
Keavon Chambers 2025-11-30 13:32:58 -08:00 committed by GitHub
parent 94e5c8fc05
commit e8ebcc2c21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
94 changed files with 1323 additions and 580 deletions

View file

@ -141,7 +141,7 @@ fn derive_enum(enum_attributes: &[Attribute], name: Ident, input: syn::DataEnum)
let vname = &variant.name;
let vname_str = variant.name.to_string();
let label = &variant.basic_item.label;
let docstring = match &variant.basic_item.description {
let description = match &variant.basic_item.description {
Some(s) => {
let s = s.trim();
quote! { Some(#s) }
@ -157,7 +157,7 @@ fn derive_enum(enum_attributes: &[Attribute], name: Ident, input: syn::DataEnum)
#name::#vname, #crate_name::choice_type::VariantMetadata {
name: #vname_str,
label: #label,
docstring: #docstring,
description: #description,
icon: #icon,
}
),

View file

@ -27,7 +27,7 @@ pub fn node(attr: TokenStream, item: TokenStream) -> TokenStream {
///
/// `#[icon("tag"))]` sets the icon to use when a variant is shown in a menu or radio button.
///
/// Doc comments on a variant become tooltip text.
/// Doc comments on a variant become tooltip description text.
#[proc_macro_derive(ChoiceType, attributes(widget, menu_separator, label, icon))]
pub fn derive_choice_type(input_item: TokenStream) -> TokenStream {
derive_choice_type::derive_choice_type_impl(input_item.into()).unwrap_or_else(|err| err.to_compile_error()).into()