Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Sources/CodexBar/PreferencesMenuBarPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ struct MenuBarPane: View {
L("overview_choose_providers", String(limit))
}

static func inactiveDisplayContrastAvailable(for style: MenuBarIconStyle) -> Bool {
style == .iconAndPercent
}

var body: some View {
Form {
Section {
Expand Down Expand Up @@ -49,6 +53,14 @@ struct MenuBarPane: View {
.disabled(
self.settings.menuBarIconStyle != .iconAndPercent
|| self.settings.menuBarDisplayMode == .resetTime)

Toggle(isOn: self.$settings.menuBarHighContrastOnInactiveDisplays) {
SettingsRowLabel(
L("menu_bar_inactive_display_contrast_title"),
subtitle: "\(MenuBarIconStyle.iconAndPercent.label): "
+ L("menu_bar_inactive_display_contrast_subtitle"))
}
.disabled(!Self.inactiveDisplayContrastAvailable(for: self.settings.menuBarIconStyle))
} header: {
Text(L("section_icon"))
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@
/* Display Pane */
"menu_bar_style_title" = "نمط شريط القوائم";
"menu_bar_style_subtitle" = "كيفية رسم عنصر شريط القوائم.";
"menu_bar_inactive_display_contrast_title" = "تحسين الوضوح على الشاشات غير النشطة";
"menu_bar_inactive_display_contrast_subtitle" = "استخدم عرضًا عالي التباين لإبقاء الأيقونة والمقياس قابلين للقراءة على الشاشات الأخرى.";
"menu_bar_style_critters" = "الكائنات الصغيرة";
"menu_bar_style_bars" = "أشرطة القياس";
"menu_bar_style_icon_percent" = "الأيقونة والنسبة المئوية";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/ca.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@
/* Display Pane */
"menu_bar_style_title" = "Estil de la barra de menús";
"menu_bar_style_subtitle" = "Com es dibuixa l'element de la barra de menús.";
"menu_bar_inactive_display_contrast_title" = "Millora la visibilitat a les pantalles inactives";
"menu_bar_inactive_display_contrast_subtitle" = "Utilitza una representació d'alt contrast perquè la icona i la mètrica siguin llegibles a les altres pantalles.";
"menu_bar_style_critters" = "Bestioles";
"menu_bar_style_bars" = "Barres de mesura";
"menu_bar_style_icon_percent" = "Icona i percentatge";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@
/* Display Pane */
"menu_bar_style_title" = "Menüleistenstil";
"menu_bar_style_subtitle" = "Legt fest, wie das Menüleistenelement dargestellt wird.";
"menu_bar_inactive_display_contrast_title" = "Sichtbarkeit auf inaktiven Displays verbessern";
"menu_bar_inactive_display_contrast_subtitle" = "Verwendet eine kontrastreiche Darstellung, damit Symbol und Messwert auf anderen Displays lesbar bleiben.";
"menu_bar_style_critters" = "Kreaturen";
"menu_bar_style_bars" = "Messleisten";
"menu_bar_style_icon_percent" = "Symbol und Prozent";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@
/* Display Pane */
"menu_bar_style_title" = "Menu bar style";
"menu_bar_style_subtitle" = "How the menu bar item is drawn.";
"menu_bar_inactive_display_contrast_title" = "Improve visibility on inactive displays";
"menu_bar_inactive_display_contrast_subtitle" = "Use high-contrast rendering to keep the icon and metric readable on other displays.";
"menu_bar_style_critters" = "Critters";
"menu_bar_style_bars" = "Meter bars";
"menu_bar_style_icon_percent" = "Icon & percent";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@
/* Display Pane */
"menu_bar_style_title" = "Estilo de la barra de menús";
"menu_bar_style_subtitle" = "Cómo se dibuja el elemento de la barra de menús.";
"menu_bar_inactive_display_contrast_title" = "Mejorar la visibilidad en pantallas inactivas";
"menu_bar_inactive_display_contrast_subtitle" = "Usa un renderizado de alto contraste para mantener legibles el icono y la métrica en otras pantallas.";
"menu_bar_style_critters" = "Bichitos";
"menu_bar_style_bars" = "Barras de medición";
"menu_bar_style_icon_percent" = "Icono y porcentaje";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/fa.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@
/* Display Pane */
"menu_bar_style_title" = "سبک نوار منو";
"menu_bar_style_subtitle" = "نحوه نمایش آیتم نوار منو.";
"menu_bar_inactive_display_contrast_title" = "بهبود خوانایی در نمایشگرهای غیرفعال";
"menu_bar_inactive_display_contrast_subtitle" = "از نمایش با کنتراست بالا استفاده می‌کند تا نماد و معیار در نمایشگرهای دیگر خوانا بمانند.";
"menu_bar_style_critters" = "موجودات";
"menu_bar_style_bars" = "نوارهای اندازه‌گیری";
"menu_bar_style_icon_percent" = "آیکون و درصد";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@
/* Display Pane */
"menu_bar_style_title" = "Style de la barre de menus";
"menu_bar_style_subtitle" = "Définit l’apparence de l’élément dans la barre de menus.";
"menu_bar_inactive_display_contrast_title" = "Améliorer la visibilité sur les écrans inactifs";
"menu_bar_inactive_display_contrast_subtitle" = "Utilise un rendu à contraste élevé pour que l’icône et la mesure restent lisibles sur les autres écrans.";
"menu_bar_style_critters" = "Créatures";
"menu_bar_style_bars" = "Barres de mesure";
"menu_bar_style_icon_percent" = "Icône et pourcentage";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/gl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@
/* Display Pane */
"menu_bar_style_title" = "Estilo da barra de menús";
"menu_bar_style_subtitle" = "Como se debuxa o elemento da barra de menús.";
"menu_bar_inactive_display_contrast_title" = "Mellorar a visibilidade nas pantallas inactivas";
"menu_bar_inactive_display_contrast_subtitle" = "Usa unha representación de alto contraste para manter lexibles a icona e a métrica nas outras pantallas.";
"menu_bar_style_critters" = "Animaliños";
"menu_bar_style_bars" = "Barras de medición";
"menu_bar_style_icon_percent" = "Icona e porcentaxe";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/id.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,8 @@
/* Display Pane */
"menu_bar_style_title" = "Gaya menu bar";
"menu_bar_style_subtitle" = "Cara item menu bar digambar.";
"menu_bar_inactive_display_contrast_title" = "Tingkatkan visibilitas di layar tidak aktif";
"menu_bar_inactive_display_contrast_subtitle" = "Gunakan rendering kontras tinggi agar ikon dan metrik tetap terbaca di layar lain.";
"menu_bar_style_critters" = "Critter";
"menu_bar_style_bars" = "Bilah meter";
"menu_bar_style_icon_percent" = "Ikon & persentase";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,8 @@
/* Display Pane */
"menu_bar_style_title" = "Stile barra menu";
"menu_bar_style_subtitle" = "Come viene rappresentato l'elemento della barra menu.";
"menu_bar_inactive_display_contrast_title" = "Migliora la visibilità sugli schermi inattivi";
"menu_bar_inactive_display_contrast_subtitle" = "Usa un rendering ad alto contrasto per mantenere leggibili icona e metrica sugli altri schermi.";
"menu_bar_style_critters" = "Creature";
"menu_bar_style_bars" = "Barre di livello";
"menu_bar_style_icon_percent" = "Icona + percentuale";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@
/* Display Pane */
"menu_bar_style_title" = "メニューバーのスタイル";
"menu_bar_style_subtitle" = "メニューバー項目の表示方法です。";
"menu_bar_inactive_display_contrast_title" = "非アクティブなディスプレイでの視認性を向上";
"menu_bar_inactive_display_contrast_subtitle" = "高コントラスト表示を使用し、ほかのディスプレイでもアイコンと指標を読みやすくします。";
"menu_bar_style_critters" = "クリッター";
"menu_bar_style_bars" = "メーターバー";
"menu_bar_style_icon_percent" = "アイコンとパーセント";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,8 @@
"primary_api_key_limit" = "기본 (API 키 한도)";
"menu_bar_style_title" = "메뉴 막대 스타일";
"menu_bar_style_subtitle" = "메뉴 막대 항목의 표시 방식을 선택합니다.";
"menu_bar_inactive_display_contrast_title" = "비활성 디스플레이에서 가시성 향상";
"menu_bar_inactive_display_contrast_subtitle" = "고대비 렌더링을 사용하여 다른 디스플레이에서도 아이콘과 지표를 읽기 쉽게 유지합니다.";
"menu_bar_style_critters" = "크리터";
"menu_bar_style_bars" = "미터 막대";
"menu_bar_style_icon_percent" = "아이콘 및 백분율";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/nl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@
/* Display Pane */
"menu_bar_style_title" = "Menubalkstijl";
"menu_bar_style_subtitle" = "Hoe het menubalkitem wordt weergegeven.";
"menu_bar_inactive_display_contrast_title" = "Zichtbaarheid op inactieve beeldschermen verbeteren";
"menu_bar_inactive_display_contrast_subtitle" = "Gebruikt weergave met hoog contrast zodat het pictogram en de metriek leesbaar blijven op andere beeldschermen.";
"menu_bar_style_critters" = "Critters";
"menu_bar_style_bars" = "Meterbalken";
"menu_bar_style_icon_percent" = "Pictogram en percentage";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/pl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,8 @@
/* Display Pane */
"menu_bar_style_title" = "Styl paska menu";
"menu_bar_style_subtitle" = "Sposób rysowania elementu paska menu.";
"menu_bar_inactive_display_contrast_title" = "Popraw widoczność na nieaktywnych ekranach";
"menu_bar_inactive_display_contrast_subtitle" = "Używa renderowania o wysokim kontraście, aby ikona i wskaźnik pozostały czytelne na innych ekranach.";
"menu_bar_style_critters" = "Stworki";
"menu_bar_style_bars" = "Paski miernika";
"menu_bar_style_icon_percent" = "Ikona i procent";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/pt-BR.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@
/* Display Pane */
"menu_bar_style_title" = "Estilo da barra de menus";
"menu_bar_style_subtitle" = "Como o item da barra de menus é desenhado.";
"menu_bar_inactive_display_contrast_title" = "Melhorar a visibilidade em telas inativas";
"menu_bar_inactive_display_contrast_subtitle" = "Usa renderização de alto contraste para manter o ícone e a métrica legíveis em outras telas.";
"menu_bar_style_critters" = "Bichinhos";
"menu_bar_style_bars" = "Barras de medição";
"menu_bar_style_icon_percent" = "Ícone e porcentagem";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@
/* Display Pane */
"menu_bar_style_title" = "Стиль строки меню";
"menu_bar_style_subtitle" = "Как выглядит элемент строки меню.";
"menu_bar_inactive_display_contrast_title" = "Повысить видимость на неактивных дисплеях";
"menu_bar_inactive_display_contrast_subtitle" = "Использует высококонтрастную отрисовку, чтобы значок и показатель оставались читаемыми на других дисплеях.";
"menu_bar_style_critters" = "Декоративные индикаторы";
"menu_bar_style_bars" = "Полосы-индикаторы";
"menu_bar_style_icon_percent" = "Значок и процент";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@
/* Display Pane */
"menu_bar_style_title" = "Menyradsstil";
"menu_bar_style_subtitle" = "Hur menyradsobjektet visas.";
"menu_bar_inactive_display_contrast_title" = "Förbättra synligheten på inaktiva skärmar";
"menu_bar_inactive_display_contrast_subtitle" = "Använder kontrastrik rendering så att ikonen och mätvärdet förblir läsbara på andra skärmar.";
"menu_bar_style_critters" = "Figurer";
"menu_bar_style_bars" = "Mätarstaplar";
"menu_bar_style_icon_percent" = "Ikon och procent";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/th.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@
/* Display Pane */
"menu_bar_style_title" = "รูปแบบแถบเมนู";
"menu_bar_style_subtitle" = "รูปแบบการแสดงรายการในแถบเมนู";
"menu_bar_inactive_display_contrast_title" = "เพิ่มการมองเห็นบนจอแสดงผลที่ไม่ได้ใช้งาน";
"menu_bar_inactive_display_contrast_subtitle" = "ใช้การแสดงผลแบบคอนทราสต์สูงเพื่อให้ไอคอนและค่าชี้วัดอ่านได้บนจออื่น";
"menu_bar_style_critters" = "ตัวการ์ตูน";
"menu_bar_style_bars" = "แถบวัด";
"menu_bar_style_icon_percent" = "ไอคอนและเปอร์เซ็นต์";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/tr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@
/* Display Pane */
"menu_bar_style_title" = "Menü çubuğu stili";
"menu_bar_style_subtitle" = "Menü çubuğu öğesinin nasıl çizileceğini belirler.";
"menu_bar_inactive_display_contrast_title" = "Etkin olmayan ekranlarda görünürlüğü artır";
"menu_bar_inactive_display_contrast_subtitle" = "Simge ve ölçümün diğer ekranlarda okunabilir kalması için yüksek kontrastlı işleme kullanır.";
"menu_bar_style_critters" = "Canavarlar";
"menu_bar_style_bars" = "Ölçüm çubukları";
"menu_bar_style_icon_percent" = "Simge ve yüzde";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/uk.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@
/* Display Pane */
"menu_bar_style_title" = "Стиль рядка меню";
"menu_bar_style_subtitle" = "Визначає вигляд елемента рядка меню.";
"menu_bar_inactive_display_contrast_title" = "Покращити видимість на неактивних дисплеях";
"menu_bar_inactive_display_contrast_subtitle" = "Використовує висококонтрастне відтворення, щоб піктограма й показник залишалися читабельними на інших дисплеях.";
"menu_bar_style_critters" = "Тварини";
"menu_bar_style_bars" = "Смуги-індикатори";
"menu_bar_style_icon_percent" = "Значок і відсоток";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/vi.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@
/* Display Pane */
"menu_bar_style_title" = "Kiểu thanh menu";
"menu_bar_style_subtitle" = "Cách hiển thị mục trên thanh menu.";
"menu_bar_inactive_display_contrast_title" = "Cải thiện khả năng hiển thị trên màn hình không hoạt động";
"menu_bar_inactive_display_contrast_subtitle" = "Sử dụng hiển thị tương phản cao để biểu tượng và chỉ số vẫn dễ đọc trên các màn hình khác.";
"menu_bar_style_critters" = "Sinh vật";
"menu_bar_style_bars" = "Thanh đo";
"menu_bar_style_icon_percent" = "Biểu tượng & phần trăm";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@
"primary_api_key_limit" = "主要(API 密钥限制)";
"menu_bar_style_title" = "菜单栏样式";
"menu_bar_style_subtitle" = "菜单栏项目的绘制方式。";
"menu_bar_inactive_display_contrast_title" = "提高非活跃显示器上的可见性";
"menu_bar_inactive_display_contrast_subtitle" = "使用高对比度绘制,让其他显示器上的图标和指标仍清晰可读。";
"menu_bar_style_critters" = "小动物";
"menu_bar_style_bars" = "进度条";
"menu_bar_style_icon_percent" = "图标和百分比";
Expand Down
2 changes: 2 additions & 0 deletions Sources/CodexBar/Resources/zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@
"primary_api_key_limit" = "主要(API 金鑰限制)";
"menu_bar_style_title" = "選單列樣式";
"menu_bar_style_subtitle" = "選單列項目的繪製方式。";
"menu_bar_inactive_display_contrast_title" = "改善非使用中顯示器上的可見度";
"menu_bar_inactive_display_contrast_subtitle" = "使用高對比顯示,讓其他顯示器上的圖示與指標保持清晰可讀。";
"menu_bar_style_critters" = "小動物";
"menu_bar_style_bars" = "進度條";
"menu_bar_style_icon_percent" = "圖示和百分比";
Expand Down
8 changes: 8 additions & 0 deletions Sources/CodexBar/SettingsStore+Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ extension SettingsStore {
}
}

var menuBarHighContrastOnInactiveDisplays: Bool {
get { self.defaultsState.menuBarHighContrastOnInactiveDisplays }
set {
self.defaultsState.menuBarHighContrastOnInactiveDisplays = newValue
self.userDefaults.set(newValue, forKey: "menuBarHighContrastOnInactiveDisplays")
}
}

private var menuBarDisplayModeRaw: String? {
get { self.defaultsState.menuBarDisplayModeRaw }
set {
Expand Down
1 change: 1 addition & 0 deletions Sources/CodexBar/SettingsStore+MenuObservation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extension SettingsStore {
_ = self.providerChangelogLinksEnabled
_ = self.menuBarShowsBrandIconWithPercent
_ = self.menuBarHidesCritters
_ = self.menuBarHighContrastOnInactiveDisplays
_ = self.menuBarShowsHighestUsage
_ = self.menuBarDisplayMode
_ = self.menuBarShowsResetTimeWhenExhausted
Expand Down
3 changes: 3 additions & 0 deletions Sources/CodexBar/SettingsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ extension SettingsStore {
let menuBarShowsBrandIconWithPercent = userDefaults.object(
forKey: "menuBarShowsBrandIconWithPercent") as? Bool ?? false
let menuBarHidesCritters = userDefaults.object(forKey: "menuBarHidesCritters") as? Bool ?? false
let menuBarHighContrastOnInactiveDisplays = userDefaults.object(
forKey: "menuBarHighContrastOnInactiveDisplays") as? Bool ?? false
let menuBarDisplayModeRaw = userDefaults.string(forKey: "menuBarDisplayMode")
?? MenuBarDisplayMode.percent.rawValue
let menuBarShowsResetTimeWhenExhausted = userDefaults.object(
Expand Down Expand Up @@ -523,6 +525,7 @@ extension SettingsStore {
providerChangelogLinksEnabled: providerChangelogLinksEnabled,
menuBarShowsBrandIconWithPercent: menuBarShowsBrandIconWithPercent,
menuBarHidesCritters: menuBarHidesCritters,
menuBarHighContrastOnInactiveDisplays: menuBarHighContrastOnInactiveDisplays,
menuBarDisplayModeRaw: menuBarDisplayModeRaw,
menuBarShowsResetTimeWhenExhausted: menuBarShowsResetTimeWhenExhausted,
kiroMenuBarDisplayModeRaw: kiroMenuBarDisplayModeRaw,
Expand Down
1 change: 1 addition & 0 deletions Sources/CodexBar/SettingsStoreState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct SettingsDefaultsState {
var providerChangelogLinksEnabled: Bool
var menuBarShowsBrandIconWithPercent: Bool
var menuBarHidesCritters: Bool
var menuBarHighContrastOnInactiveDisplays: Bool
var menuBarDisplayModeRaw: String?
var menuBarShowsResetTimeWhenExhausted: Bool
var kiroMenuBarDisplayModeRaw: String?
Expand Down
Loading