mirror of
https://github.com/project-gauntlet/gauntlet.git
synced 2025-12-23 10:35:53 +00:00
Add cmd/ctrl+comma to open settings ui
This commit is contained in:
parent
c8b3cfe09c
commit
fcbeb20699
3 changed files with 23 additions and 1 deletions
|
|
@ -2574,6 +2574,17 @@ impl AppModel {
|
|||
match sub_state {
|
||||
MainViewState::None => {
|
||||
match physical_key_model(physical_key, modifiers) {
|
||||
Some(PhysicalShortcut {
|
||||
physical_key: PhysicalKey::Comma,
|
||||
modifier_shift: false,
|
||||
modifier_control: cfg!(any(target_os = "linux", target_os = "windows")),
|
||||
modifier_alt: false,
|
||||
modifier_meta: cfg!(target_os = "macos"),
|
||||
}) => {
|
||||
crate::open_settings_window();
|
||||
|
||||
Task::none()
|
||||
}
|
||||
Some(PhysicalShortcut {
|
||||
physical_key: PhysicalKey::KeyK,
|
||||
modifier_shift: false,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
use image::ImageFormat;
|
||||
|
||||
pub fn create_tray() -> tray_icon::TrayIcon {
|
||||
use global_hotkey::hotkey::Code;
|
||||
use global_hotkey::hotkey::CMD_OR_CTRL;
|
||||
use tray_icon::menu::accelerator::Accelerator;
|
||||
use tray_icon::menu::AboutMetadataBuilder;
|
||||
use tray_icon::menu::Menu;
|
||||
use tray_icon::menu::MenuEvent;
|
||||
|
|
@ -49,7 +52,12 @@ pub fn create_tray() -> tray_icon::TrayIcon {
|
|||
let menu = Menu::with_items(&[
|
||||
&MenuItem::new("Gauntlet", false, None),
|
||||
&MenuItem::with_id("GAUNTLET_OPEN_MAIN_WINDOW", "Open", true, None),
|
||||
&MenuItem::with_id("GAUNTLET_OPEN_SETTING_WINDOW", "Open Settings", true, None),
|
||||
&MenuItem::with_id(
|
||||
"GAUNTLET_OPEN_SETTING_WINDOW",
|
||||
"Open Settings",
|
||||
true,
|
||||
Some(Accelerator::new(Some(CMD_OR_CTRL), Code::Comma)),
|
||||
),
|
||||
&PredefinedMenuItem::separator(),
|
||||
&PredefinedMenuItem::about(Some("About..."), Some(about_metadata)),
|
||||
&PredefinedMenuItem::quit(Some("Quit Gauntlet")),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue