Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

better menu

CJ Paisfff8be3a96a4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 97ba9701..9ccc60b1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -35,6 +35,11 @@ jobs:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
+ - name: Rust cache
+ uses: swatinem/rust-cache@v2
+ with:
+ workspaces: "./src-tauri -> target"
+
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 360d3b02..8b697330 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -43,15 +43,28 @@ pub fn run() {
let version = env!("CARGO_PKG_VERSION");
let version_label = format!("Handy v{}", version);
let version_i = MenuItem::with_id(app, "version", &version_label, false, None::<&str>)?;
- let settings_i = MenuItem::with_id(app, "settings", "Settings", true, None::<&str>)?;
+
+ // Platform-specific accelerators
+ #[cfg(target_os = "macos")]
+ let settings_accelerator = Some("Cmd+,");
+ #[cfg(not(target_os = "macos"))]
+ let settings_accelerator = Some("Ctrl+,");
+
+ #[cfg(target_os = "macos")]
+ let quit_accelerator = Some("Cmd+Q");
+ #[cfg(not(target_os = "macos"))]
+ let quit_accelerator = Some("Ctrl+Q");
+
+ let settings_i =
+ MenuItem::with_id(app, "settings", "Settings...", true, settings_accelerator)?;
let check_updates_i = MenuItem::with_id(
app,
"check_updates",
- "Check for Updates",
+ "Check for Updates...",
true,
None::<&str>,
)?;
- let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
+ let quit_i = MenuItem::with_id(app, "quit", "Quit", true, quit_accelerator)?;
let menu = Menu::with_items(
app,
&[