Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: use the main window mode headings in the tray picker

Ilya655897edab17
diff --git a/apps/desktop-gpui/src/tray.rs b/apps/desktop-gpui/src/tray.rs
index e9407276a..5ba463636 100644
--- a/apps/desktop-gpui/src/tray.rs
+++ b/apps/desktop-gpui/src/tray.rs
@@ -465,6 +465,14 @@ fn mode_name(mode: Mode) -> &'static str {
}
}
+fn mode_heading(mode: Mode) -> &'static str {
+ match mode {
+ Mode::Studio => tr::main::mode::header::studio(),
+ Mode::Instant => tr::main::mode::header::instant(),
+ Mode::Screenshot => tr::main::mode::header::screenshot(),
+ }
+}
+
/// `create_mode_submenu`: a `✓ ` prefix on the current mode and three spaces on
/// the others, so the labels stay aligned without a real check mark.
fn mode_submenu(mode: Mode) -> Entry {
diff --git a/apps/desktop-gpui/src/tray/mac_mode_picker.rs b/apps/desktop-gpui/src/tray/mac_mode_picker.rs
index 50f64c44f..7a3da72c6 100644
--- a/apps/desktop-gpui/src/tray/mac_mode_picker.rs
+++ b/apps/desktop-gpui/src/tray/mac_mode_picker.rs
@@ -27,7 +27,7 @@ use objc2_foundation::{
use objc2_quartz_core::{CALayer, CATransaction, kCACornerCurveContinuous};
use super::mac::{post, set_status_mode};
-use super::{TrayItem, mode_name, mode_picker_icon};
+use super::{TrayItem, mode_heading, mode_name, mode_picker_icon};
use crate::i18n::tr;
use crate::main_window::Mode;
@@ -438,7 +438,7 @@ impl ModePickerView {
let label = NSColor::labelColor();
let secondary = NSColor::secondaryLabelColor();
let title = NSString::from_str(tr::tray::recording_mode());
- let subtitle = NSString::from_str(mode_name(PICKER_MODES[shown].0));
+ let subtitle = NSString::from_str(mode_heading(PICKER_MODES[shown].0));
let title_attrs = NSDictionary::from_slices(
&[unsafe { NSFontAttributeName }, unsafe {
NSForegroundColorAttributeName