Add full support for Mac-specific keyboard layouts (#736)

* IPP for Mac, flawed initial experiments

* Cleanup and progress, but not compiling yet

* Fix error and rename nonmac -> standard

* Extentd ipp macros to accomodate mac input

* Add Mac versions of shortcuts; refactor and document the input mapper macros

* Change frontend styling for user input labels in floating menus

* Additional macro documentation

* A little more documentation

* Improve entry macro syntax

* Move input mapper macros to a separate file

* Adapt the keyboard shortcuts to the user's OS

* Display keyboard shortcuts in the menu bar based on OS

* Change Input Mapper macro syntax from {} to ()

* Fix esc key bug in Vue

* Tweaks

* Interim solution for Mac-specific hints

* Feed tooltip input hotkeys from their actions

* Fix hotkeys for tools because of missing actions

* Make Vue respect Ctrl/Cmd differences per platform

* Remove commented lines

* Code review pass by me

* Code review suggestions with TrueDoctor

* Turn FutureKeyMapping struct into ActionKeys enum which is a bit cleaner

* Add serde derive attributes for message discriminants

* Re-add serde deserialize

* Fix not mutating ActionKeys conversion; remove custom serializer

* Add serde to dev dependencies

Co-authored-by: Dennis <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers 2022-08-03 14:12:28 -07:00
parent fa461f3157
commit f39d6bf00c
73 changed files with 1686 additions and 727 deletions

View file

@ -2,7 +2,7 @@
name = "graphite-proc-macros"
publish = false
version = "0.0.0"
rust-version = "1.56.0"
rust-version = "1.62.0"
authors = ["Graphite Authors <contact@graphite.rs>"]
edition = "2021"
readme = "../README.md"
@ -14,6 +14,10 @@ license = "Apache-2.0"
path = "src/lib.rs"
proc-macro = true
[features]
default = ["serde-discriminant"]
serde-discriminant = []
[dependencies]
proc-macro2 = "1.0.26"
syn = { version = "1.0.68", features = ["full"] }
@ -22,3 +26,6 @@ quote = "1.0.9"
[dev-dependencies.editor]
path = "../editor"
package = "graphite-editor"
[dev-dependencies]
serde = "1"

View file

@ -112,8 +112,16 @@ pub fn derive_discriminant_impl(input_item: TokenStream) -> syn::Result<TokenStr
)
})
.unzip::<_, _, Vec<_>, Vec<_>>();
#[cfg(feature = "serde-discriminant")]
let serde = quote::quote! {
#[derive(serde::Serialize, serde::Deserialize)]
};
#[cfg(not(feature = "serde-discriminant"))]
let serde = quote::quote! {};
let res = quote::quote! {
#serde
#discriminant
impl ToDiscriminant for #input_type {