mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
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:
parent
94e5c8fc05
commit
e8ebcc2c21
94 changed files with 1323 additions and 580 deletions
|
|
@ -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,
|
||||
}
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue