diff --git a/CHANGELOG.md b/CHANGELOG.md index 992421a4..374afeca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ For next releases info look here: ## Unreleased +* Location display settings for status bar * Fix typo in language list (#839) ## Version 4.11.0 diff --git a/MeetingBar.xcodeproj/project.pbxproj b/MeetingBar.xcodeproj/project.pbxproj index 120b5678..c20c97f8 100644 --- a/MeetingBar.xcodeproj/project.pbxproj +++ b/MeetingBar.xcodeproj/project.pbxproj @@ -209,7 +209,7 @@ hu, ko, ta, - enm, + pt, ); mainGroup = 144C01702462D0C3000C9FFC; packageReferences = ( diff --git a/MeetingBar/Extensions/DefaultsKeys.swift b/MeetingBar/Extensions/DefaultsKeys.swift index f8bb88b9..905187e4 100644 --- a/MeetingBar/Extensions/DefaultsKeys.swift +++ b/MeetingBar/Extensions/DefaultsKeys.swift @@ -37,6 +37,7 @@ extension Defaults.Keys { // Status Bar Appearance static let eventTitleFormat = Key("eventTitleFormat", default: .show) static let eventTimeFormat = Key("eventTimeFormat", default: .show) + static let eventLocationFormat = Key("eventLocationFormat", default: .hide) static let eventTitleIconFormat = Key("eventTitleIconFormat", default: .none) static let statusbarEventTitleLength = Key("statusbarEventTitleLength", default: statusbarEventTitleLengthLimits.max) diff --git a/MeetingBar/Extensions/KeyboardShortcutsNames.swift b/MeetingBar/Extensions/KeyboardShortcutsNames.swift index ad166298..5da13c58 100644 --- a/MeetingBar/Extensions/KeyboardShortcutsNames.swift +++ b/MeetingBar/Extensions/KeyboardShortcutsNames.swift @@ -8,8 +8,6 @@ import KeyboardShortcuts -extension KeyboardShortcuts.Name: @unchecked @retroactive Sendable {} - extension KeyboardShortcuts.Name { static let createMeetingShortcut = Self("createMeetingShortcut") static let openMenuShortcut = Self("openMenuShortcut") diff --git a/MeetingBar/Resources /Localization /cs.lproj/Localizable.strings b/MeetingBar/Resources /Localization /cs.lproj/Localizable.strings index e75d2c94..452e6df8 100644 --- a/MeetingBar/Resources /Localization /cs.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /cs.lproj/Localizable.strings @@ -241,6 +241,10 @@ "preferences_appearance_status_bar_time_show_under_title_value" = "zobrazit pod názvem"; "preferences_appearance_status_bar_time_show_value" = "zobrazit"; "preferences_appearance_status_bar_time_title" = "Čas"; +"preferences_appearance_status_bar_location_title" = "Umístění"; +"preferences_appearance_status_bar_location_show_value" = "zobrazit"; +"preferences_appearance_status_bar_location_show_under_title_value" = "zobrazit pod názvem"; +"preferences_appearance_status_bar_location_hide_value" = "skrýt"; "preferences_appearance_status_bar_title_shorten_stepper" = "zkrátit na %d znaků"; "preferences_appearance_status_bar_title_hide_value" = "skrýt"; "preferences_appearance_status_bar_title_dot_value" = "tečka (•)"; diff --git a/MeetingBar/Resources /Localization /de.lproj/Localizable.strings b/MeetingBar/Resources /Localization /de.lproj/Localizable.strings index 634a0af5..5e6af079 100644 --- a/MeetingBar/Resources /Localization /de.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /de.lproj/Localizable.strings @@ -61,6 +61,10 @@ "preferences_appearance_status_bar_time_show_under_title_value" = "unter Titel anzeigen"; "preferences_appearance_status_bar_time_show_value" = "anzeigen"; "preferences_appearance_status_bar_time_title" = "Uhrzeit"; +"preferences_appearance_status_bar_location_title" = "Ort"; +"preferences_appearance_status_bar_location_show_value" = "anzeigen"; +"preferences_appearance_status_bar_location_show_under_title_value" = "unter Titel anzeigen"; +"preferences_appearance_status_bar_location_hide_value" = "ausblenden"; "preferences_appearance_status_bar_title_shorten_stepper" = "auf %d Zeichen kürzen"; "preferences_appearance_status_bar_title_hide_value" = "ausblenden"; "preferences_appearance_status_bar_title_dot_value" = "Punkt (•)"; diff --git a/MeetingBar/Resources /Localization /en.lproj/Localizable.strings b/MeetingBar/Resources /Localization /en.lproj/Localizable.strings index 5c95734f..00356a7c 100644 --- a/MeetingBar/Resources /Localization /en.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /en.lproj/Localizable.strings @@ -97,6 +97,10 @@ "preferences_appearance_status_bar_time_show_value" = "show"; "preferences_appearance_status_bar_time_show_under_title_value" = "show under title"; "preferences_appearance_status_bar_time_hide_value" = "hide"; +"preferences_appearance_status_bar_location_title" = "Location"; +"preferences_appearance_status_bar_location_show_value" = "show"; +"preferences_appearance_status_bar_location_show_under_title_value" = "show under title"; +"preferences_appearance_status_bar_location_hide_value" = "hide"; "preferences_appearance_status_bar_ongoing_title" = "Ongoing event visibility:"; "preferences_appearance_status_bar_ongoing_time_immediate_value" = "hide after start"; "preferences_appearance_status_bar_ongoing_time_ten_after_value" = "hide 10 min after start"; diff --git a/MeetingBar/Resources /Localization /enm.lproj/Localizable.strings b/MeetingBar/Resources /Localization /enm.lproj/Localizable.strings deleted file mode 100644 index 8b137891..00000000 --- a/MeetingBar/Resources /Localization /enm.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/MeetingBar/Resources /Localization /es.lproj/Localizable.strings b/MeetingBar/Resources /Localization /es.lproj/Localizable.strings index f6aed4f2..12eb800f 100644 --- a/MeetingBar/Resources /Localization /es.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /es.lproj/Localizable.strings @@ -96,6 +96,10 @@ "preferences_appearance_status_bar_time_show_value" = "mostrar"; "preferences_appearance_status_bar_time_show_under_title_value" = "mostrar bajo título"; "preferences_appearance_status_bar_time_hide_value" = "ocultar"; +"preferences_appearance_status_bar_location_title" = "Ubicación"; +"preferences_appearance_status_bar_location_show_value" = "mostrar"; +"preferences_appearance_status_bar_location_show_under_title_value" = "mostrar bajo título"; +"preferences_appearance_status_bar_location_hide_value" = "ocultar"; "preferences_appearance_status_bar_next_event_toggle" = "Mostrar solo eventos que comiencen dentro de"; "preferences_appearance_status_bar_next_event_stepper" = "%d minutos"; "preferences_appearance_menu_title" = "Menú"; diff --git a/MeetingBar/Resources /Localization /fr.lproj/Localizable.strings b/MeetingBar/Resources /Localization /fr.lproj/Localizable.strings index 9fa99e05..1bf73a8b 100644 --- a/MeetingBar/Resources /Localization /fr.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /fr.lproj/Localizable.strings @@ -230,6 +230,10 @@ "preferences_appearance_status_bar_time_show_under_title_value" = "afficher sous le titre"; "preferences_appearance_status_bar_time_show_value" = "afficher"; "preferences_appearance_status_bar_time_title" = "Heure"; +"preferences_appearance_status_bar_location_title" = "Lieu"; +"preferences_appearance_status_bar_location_show_value" = "afficher"; +"preferences_appearance_status_bar_location_show_under_title_value" = "afficher sous le titre"; +"preferences_appearance_status_bar_location_hide_value" = "masquer"; "preferences_appearance_status_bar_title_shorten_stepper" = "raccourcir à %d caractères"; "preferences_appearance_status_bar_title_hide_value" = "masquer"; "preferences_appearance_status_bar_title_dot_value" = "point (•)"; diff --git a/MeetingBar/Resources /Localization /he.lproj/Localizable.strings b/MeetingBar/Resources /Localization /he.lproj/Localizable.strings index ad81ee42..8ac1c69d 100644 --- a/MeetingBar/Resources /Localization /he.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /he.lproj/Localizable.strings @@ -61,7 +61,13 @@ "preferences_appearance_status_bar_title_title" = "כותרת"; "preferences_appearance_status_bar_title_event_title_value" = "כותרת אירוע"; "preferences_appearance_status_bar_time_title" = "שעה"; +"preferences_appearance_status_bar_time_show_value" = "הצגה"; +"preferences_appearance_status_bar_time_show_under_title_value" = "הצגה תחת הכותרת"; "preferences_appearance_status_bar_time_hide_value" = "הסתרה"; +"preferences_appearance_status_bar_location_title" = "מיקום"; +"preferences_appearance_status_bar_location_show_value" = "הצגה"; +"preferences_appearance_status_bar_location_show_under_title_value" = "הצגה תחת הכותרת"; +"preferences_appearance_status_bar_location_hide_value" = "הסתרה"; "preferences_appearance_menu_title" = "תפריט"; "preferences_appearance_menu_shorten_event_title_toggle" = "קיצור כותרות אירועים לאורך"; "preferences_appearance_menu_shorten_event_title_stepper" = "%d תווים"; diff --git a/MeetingBar/Resources /Localization /hr.lproj/Localizable.strings b/MeetingBar/Resources /Localization /hr.lproj/Localizable.strings index 23a3d066..e74c4a57 100644 --- a/MeetingBar/Resources /Localization /hr.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /hr.lproj/Localizable.strings @@ -92,6 +92,10 @@ "preferences_appearance_status_bar_time_show_value" = "prikaži"; "preferences_appearance_status_bar_time_show_under_title_value" = "prikaži ispod naslova"; "preferences_appearance_status_bar_time_hide_value" = "sakrij"; +"preferences_appearance_status_bar_location_title" = "Mjesto"; +"preferences_appearance_status_bar_location_show_value" = "prikaži"; +"preferences_appearance_status_bar_location_show_under_title_value" = "prikaži ispod naslova"; +"preferences_appearance_status_bar_location_hide_value" = "sakrij"; "preferences_appearance_status_bar_next_event_toggle" = "Prikaži samo događaje koji počinju u idućih"; "preferences_appearance_status_bar_next_event_stepper" = "%d min"; "preferences_appearance_menu_title" = "Izbornik"; diff --git a/MeetingBar/Resources /Localization /hu.lproj/Localizable.strings b/MeetingBar/Resources /Localization /hu.lproj/Localizable.strings index a6a2fe26..816a727a 100644 --- a/MeetingBar/Resources /Localization /hu.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /hu.lproj/Localizable.strings @@ -126,6 +126,10 @@ "preferences_advanced_setting_warning" = "⚠️ Csak akkor használd ezeket a beállításokat, ha érted amit csinálnak"; "preferences_general_meeting_bar_description" = "A MeetingBar egy nyílt forráskódú alkalmazás\nAndrii Leitsius🇺🇦 által létrehozott\nA simább és könnyebb online találkozókért"; "preferences_appearance_status_bar_time_title" = "Idő"; +"preferences_appearance_status_bar_location_title" = "Helyszín"; +"preferences_appearance_status_bar_location_show_value" = "mutat"; +"preferences_appearance_status_bar_location_show_under_title_value" = "cím alatt mutatni"; +"preferences_appearance_status_bar_location_hide_value" = "elrejtés"; "preferences_configure_browsers_modal_add_browser_title" = "Webböngésző hozzáadása"; "preferences_appearance_status_bar_title_event_title_value" = "esemény címe"; "preferences_configure_browsers_choose_browser_panel_message" = "Válaszd ki, honnan futtassa a webböngészőt."; diff --git a/MeetingBar/Resources /Localization /it.lproj/Localizable.strings b/MeetingBar/Resources /Localization /it.lproj/Localizable.strings index b4689e20..6bd81be3 100644 --- a/MeetingBar/Resources /Localization /it.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /it.lproj/Localizable.strings @@ -92,6 +92,10 @@ "preferences_appearance_status_bar_time_show_value" = "mostra"; "preferences_appearance_status_bar_time_show_under_title_value" = "mostra sotto al titolo"; "preferences_appearance_status_bar_time_hide_value" = "nascondi"; +"preferences_appearance_status_bar_location_title" = "Posizione"; +"preferences_appearance_status_bar_location_show_value" = "mostra"; +"preferences_appearance_status_bar_location_show_under_title_value" = "mostra sotto al titolo"; +"preferences_appearance_status_bar_location_hide_value" = "nascondi"; "preferences_appearance_status_bar_next_event_toggle" = "Mostra solo gli eventi che iniziano entro"; "preferences_appearance_status_bar_next_event_stepper" = "%d minuti"; "preferences_appearance_menu_title" = "Menu"; diff --git a/MeetingBar/Resources /Localization /ja.lproj/Localizable.strings b/MeetingBar/Resources /Localization /ja.lproj/Localizable.strings index 796cbc66..d3c937c6 100644 --- a/MeetingBar/Resources /Localization /ja.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /ja.lproj/Localizable.strings @@ -97,6 +97,10 @@ "preferences_appearance_status_bar_time_show_value" = "表示"; "preferences_appearance_status_bar_time_show_under_title_value" = "タイトルの下に表示"; "preferences_appearance_status_bar_time_hide_value" = "非表示"; +"preferences_appearance_status_bar_location_title" = "場所"; +"preferences_appearance_status_bar_location_show_value" = "表示"; +"preferences_appearance_status_bar_location_show_under_title_value" = "タイトルの下に表示"; +"preferences_appearance_status_bar_location_hide_value" = "非表示"; "preferences_appearance_status_bar_next_event_toggle" = "開始中のイベントのみ表示"; "preferences_appearance_status_bar_next_event_stepper" = "%d分"; "preferences_appearance_menu_title" = "メニュー"; diff --git a/MeetingBar/Resources /Localization /ko.lproj/Localizable.strings b/MeetingBar/Resources /Localization /ko.lproj/Localizable.strings index a96a21c1..a6d4716c 100644 --- a/MeetingBar/Resources /Localization /ko.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /ko.lproj/Localizable.strings @@ -77,6 +77,10 @@ "preferences_appearance_status_bar_time_show_value" = "보기"; "preferences_appearance_status_bar_time_show_under_title_value" = "제목 아래 표시"; "preferences_appearance_status_bar_time_hide_value" = "숨기기"; +"preferences_appearance_status_bar_location_title" = "위치"; +"preferences_appearance_status_bar_location_show_value" = "보기"; +"preferences_appearance_status_bar_location_show_under_title_value" = "제목 아래 표시"; +"preferences_appearance_status_bar_location_hide_value" = "숨기기"; "preferences_appearance_status_bar_ongoing_title" = "진행 중인 이벤트 표시:"; "preferences_appearance_status_bar_ongoing_time_immediate_value" = "시작 시 숨기기"; "preferences_appearance_status_bar_ongoing_time_ten_after_value" = "시작 10분 후 숨기기"; diff --git a/MeetingBar/Resources /Localization /nb-NO.lproj/Localizable.strings b/MeetingBar/Resources /Localization /nb-NO.lproj/Localizable.strings index 306b3580..b1769d26 100644 --- a/MeetingBar/Resources /Localization /nb-NO.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /nb-NO.lproj/Localizable.strings @@ -254,6 +254,10 @@ "preferences_appearance_status_bar_time_show_under_title_value" = "vis under tittel"; "preferences_appearance_status_bar_time_show_value" = "vis"; "preferences_appearance_status_bar_time_title" = "Tid"; +"preferences_appearance_status_bar_location_title" = "Sted"; +"preferences_appearance_status_bar_location_show_value" = "vis"; +"preferences_appearance_status_bar_location_show_under_title_value" = "vis under tittel"; +"preferences_appearance_status_bar_location_hide_value" = "skjul"; "preferences_appearance_status_bar_title_shorten_stepper" = "forkort til %d tegn"; "preferences_appearance_status_bar_title_hide_value" = "skjul"; "preferences_appearance_status_bar_icon_calendar_icon_value" = " Kalender"; diff --git a/MeetingBar/Resources /Localization /nl.lproj/Localizable.strings b/MeetingBar/Resources /Localization /nl.lproj/Localizable.strings index 1b4fa24e..ce0b1f08 100644 --- a/MeetingBar/Resources /Localization /nl.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /nl.lproj/Localizable.strings @@ -95,6 +95,10 @@ "preferences_appearance_status_bar_title_hide_value" = "verberg"; "preferences_appearance_status_bar_title_shorten_stepper" = "verkorten tot %d tekens"; "preferences_appearance_status_bar_time_title" = "Tijd"; +"preferences_appearance_status_bar_location_title" = "Locatie"; +"preferences_appearance_status_bar_location_show_value" = "toon"; +"preferences_appearance_status_bar_location_show_under_title_value" = "toon onder titel"; +"preferences_appearance_status_bar_location_hide_value" = "verberg"; "preferences_appearance_status_bar_time_show_value" = "toon"; "preferences_appearance_status_bar_time_show_under_title_value" = "toon oder titel"; "preferences_appearance_status_bar_time_hide_value" = "verberg"; diff --git a/MeetingBar/Resources /Localization /pl.lproj/Localizable.strings b/MeetingBar/Resources /Localization /pl.lproj/Localizable.strings index 272f70e0..0e90a615 100644 --- a/MeetingBar/Resources /Localization /pl.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /pl.lproj/Localizable.strings @@ -93,6 +93,10 @@ "preferences_appearance_status_bar_time_show_value" = "pokaż"; "preferences_appearance_status_bar_time_show_under_title_value" = "pokaż pod tytułem"; "preferences_appearance_status_bar_time_hide_value" = "ukryj"; +"preferences_appearance_status_bar_location_title" = "Lokalizacja"; +"preferences_appearance_status_bar_location_show_value" = "pokaż"; +"preferences_appearance_status_bar_location_show_under_title_value" = "pokaż pod tytułem"; +"preferences_appearance_status_bar_location_hide_value" = "ukryj"; "preferences_appearance_status_bar_next_event_toggle" = "Pokaż tylko wydarzenia rozpoczynające się w ciągu"; "preferences_appearance_status_bar_next_event_stepper" = "%d minut"; "preferences_appearance_menu_title" = "Menu"; diff --git a/MeetingBar/Resources /Localization /pt-BR.lproj/Localizable.strings b/MeetingBar/Resources /Localization /pt-BR.lproj/Localizable.strings index 0c17b796..78b41982 100644 --- a/MeetingBar/Resources /Localization /pt-BR.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /pt-BR.lproj/Localizable.strings @@ -97,6 +97,10 @@ "preferences_appearance_status_bar_time_show_value" = "mostrar"; "preferences_appearance_status_bar_time_show_under_title_value" = "mostrar abaixo do título"; "preferences_appearance_status_bar_time_hide_value" = "ocultar"; +"preferences_appearance_status_bar_location_title" = "Localização"; +"preferences_appearance_status_bar_location_show_value" = "mostrar"; +"preferences_appearance_status_bar_location_show_under_title_value" = "mostrar abaixo do título"; +"preferences_appearance_status_bar_location_hide_value" = "ocultar"; "preferences_appearance_status_bar_next_event_toggle" = "Mostrar apenas eventos que começam dentro de"; "preferences_appearance_status_bar_next_event_stepper" = "%d minutos"; "preferences_appearance_menu_title" = "Menu"; diff --git a/MeetingBar/Resources /Localization /pt.lproj/Localizable.strings b/MeetingBar/Resources /Localization /pt.lproj/Localizable.strings index e33efea0..60c65ad9 100644 --- a/MeetingBar/Resources /Localization /pt.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /pt.lproj/Localizable.strings @@ -74,6 +74,10 @@ "preferences_appearance_status_bar_time_show_value" = "mostrar"; "preferences_appearance_status_bar_time_show_under_title_value" = "mostrar abaixo do título"; "preferences_appearance_status_bar_time_hide_value" = "ocultar"; +"preferences_appearance_status_bar_location_title" = "Localização"; +"preferences_appearance_status_bar_location_show_value" = "mostrar"; +"preferences_appearance_status_bar_location_show_under_title_value" = "mostrar abaixo do título"; +"preferences_appearance_status_bar_location_hide_value" = "ocultar"; "preferences_appearance_status_bar_next_event_toggle" = "Mostrar apenas eventos que começam dentro de"; "preferences_appearance_status_bar_next_event_stepper" = "%d minutos"; "preferences_appearance_menu_title" = "Menu"; diff --git a/MeetingBar/Resources /Localization /sk.lproj/Localizable.strings b/MeetingBar/Resources /Localization /sk.lproj/Localizable.strings index e1e80d41..32f34091 100644 --- a/MeetingBar/Resources /Localization /sk.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /sk.lproj/Localizable.strings @@ -161,6 +161,10 @@ "preferences_appearance_status_bar_time_show_value" = "zobraziť"; "preferences_appearance_status_bar_time_show_under_title_value" = "zobraziť pod názvom"; "preferences_appearance_status_bar_time_hide_value" = "skryť"; +"preferences_appearance_status_bar_location_title" = "Poloha"; +"preferences_appearance_status_bar_location_show_value" = "zobraziť"; +"preferences_appearance_status_bar_location_show_under_title_value" = "zobraziť pod názvom"; +"preferences_appearance_status_bar_location_hide_value" = "skryť"; "preferences_appearance_status_bar_next_event_toggle" = "Zobraziť iba udalosti začínajúce počas"; "preferences_appearance_menu_title" = "Menu"; "preferences_appearance_status_bar_next_event_stepper" = "%d minút"; diff --git a/MeetingBar/Resources /Localization /ta.lproj/Localizable.strings b/MeetingBar/Resources /Localization /ta.lproj/Localizable.strings index 86758848..97b4c7c4 100644 --- a/MeetingBar/Resources /Localization /ta.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /ta.lproj/Localizable.strings @@ -89,6 +89,10 @@ "preferences_appearance_status_bar_time_show_value" = "காட்டு"; "preferences_appearance_status_bar_time_show_under_title_value" = "தலைப்பின் கீழ் காட்டு"; "preferences_appearance_status_bar_time_hide_value" = "மறை"; +"preferences_appearance_status_bar_location_title" = "இடம்"; +"preferences_appearance_status_bar_location_show_value" = "காட்டு"; +"preferences_appearance_status_bar_location_show_under_title_value" = "தலைப்பின் கீழ் காட்டு"; +"preferences_appearance_status_bar_location_hide_value" = "மறை"; "preferences_appearance_status_bar_next_event_toggle" = "தொடங்கும் நிகழ்வுகளை மட்டுமே காட்டு"; "preferences_appearance_status_bar_next_event_stepper" = "%d நிமிடங்கள்"; "preferences_appearance_menu_title" = "பட்டியல்"; diff --git a/MeetingBar/Resources /Localization /tr.lproj/Localizable.strings b/MeetingBar/Resources /Localization /tr.lproj/Localizable.strings index cc4f799a..b84b735d 100644 --- a/MeetingBar/Resources /Localization /tr.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /tr.lproj/Localizable.strings @@ -78,6 +78,12 @@ "preferences_appearance_status_bar_title_shorten_stepper" = "%d karakterle kısıtla"; "preferences_appearance_status_bar_time_title" = "Zaman"; "preferences_appearance_status_bar_time_show_value" = "göster"; +"preferences_appearance_status_bar_time_show_under_title_value" = "başlık altında göster"; +"preferences_appearance_status_bar_time_hide_value" = "gizle"; +"preferences_appearance_status_bar_location_title" = "Konum"; +"preferences_appearance_status_bar_location_show_value" = "göster"; +"preferences_appearance_status_bar_location_show_under_title_value" = "başlık altında göster"; +"preferences_appearance_status_bar_location_hide_value" = "gizle"; "preferences_appearance_status_bar_next_event_stepper" = "%d dakika"; "preferences_appearance_menu_title" = "Menü"; "preferences_appearance_menu_shorten_event_title_toggle" = "Etkinlik başlığını kısalt"; diff --git a/MeetingBar/Resources /Localization /uk.lproj/Localizable.strings b/MeetingBar/Resources /Localization /uk.lproj/Localizable.strings index b94a59fe..5282c250 100644 --- a/MeetingBar/Resources /Localization /uk.lproj/Localizable.strings +++ b/MeetingBar/Resources /Localization /uk.lproj/Localizable.strings @@ -93,6 +93,10 @@ "preferences_appearance_status_bar_time_show_value" = "показати"; "preferences_appearance_status_bar_time_show_under_title_value" = "показати під заголовком"; "preferences_appearance_status_bar_time_hide_value" = "приховати"; +"preferences_appearance_status_bar_location_title" = "Місце"; +"preferences_appearance_status_bar_location_show_value" = "показати"; +"preferences_appearance_status_bar_location_show_under_title_value" = "показати під заголовком"; +"preferences_appearance_status_bar_location_hide_value" = "приховати"; "preferences_appearance_status_bar_next_event_toggle" = "Показувати лише наступну подію, яка починається через"; "preferences_appearance_status_bar_next_event_stepper" = "%d хвилин"; "preferences_appearance_menu_title" = "Меню"; diff --git a/MeetingBar/UI/StatusBar/StatusBarItemController.swift b/MeetingBar/UI/StatusBar/StatusBarItemController.swift index f663446a..0910aae4 100644 --- a/MeetingBar/UI/StatusBar/StatusBarItemController.swift +++ b/MeetingBar/UI/StatusBar/StatusBarItemController.swift @@ -63,7 +63,7 @@ final class StatusBarItemController { private func setupDefaultsObservers() { // For all these keys, just redraw: Defaults.publisher( - keys: .statusbarEventTitleLength, .eventTimeFormat, + keys: .statusbarEventTitleLength, .eventTimeFormat, .eventLocationFormat, .eventTitleIconFormat, .showEventMaxTimeUntilEventThreshold, .showEventMaxTimeUntilEventEnabled, .showEventDetails, .shortenEventTitle, .menuEventTitleLength, @@ -257,52 +257,78 @@ final class StatusBarItemController { // create an NSMutableAttributedString that we'll append everything to let menuTitle = NSMutableAttributedString() - if Defaults[.eventTimeFormat] != .show_under_title || Defaults[.eventTitleFormat] == .none { - var eventTitle = title - if Defaults[.eventTimeFormat] == .show { - eventTitle += " " + time + let processedLocation = processLocationForDisplay( + location: nextEvent.location, + offset: Defaults[.statusbarEventTitleLength]) + + var eventTitle = title + if Defaults[.eventTimeFormat] == .show { + eventTitle += " " + time + } + if Defaults[.eventLocationFormat] == .show && !processedLocation.isEmpty { + if !eventTitle.isEmpty { + eventTitle += " • " + processedLocation + } else { + eventTitle = processedLocation } + } - var styles = [NSAttributedString.Key: Any]() - styles[NSAttributedString.Key.font] = NSFont.systemFont(ofSize: MenuStyleConstants.defaultFontSize) + let hasTimeUnderTitle = Defaults[.eventTimeFormat] == .show_under_title + let hasLocationUnderTitle = Defaults[.eventLocationFormat] == .show_under_title && !processedLocation.isEmpty - if nextEvent.participationStatus == .pending, Defaults[.showPendingEvents] == .show_underlined { - styles[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.single.rawValue | NSUnderlineStyle.patternDot.rawValue | NSUnderlineStyle.byWord.rawValue - } + var styles = [NSAttributedString.Key: Any]() + styles[NSAttributedString.Key.font] = NSFont.systemFont(ofSize: MenuStyleConstants.defaultFontSize) - if nextEvent.participationStatus == .tentative, Defaults[.showTentativeEvents] == .show_underlined { - styles[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.single.rawValue | NSUnderlineStyle.patternDot.rawValue | NSUnderlineStyle.byWord.rawValue - } + if nextEvent.participationStatus == .pending, Defaults[.showPendingEvents] == .show_inactive { + styles[NSAttributedString.Key.foregroundColor] = NSColor.disabledControlTextColor + } else if nextEvent.participationStatus == .pending, Defaults[.showPendingEvents] == .show_underlined { + styles[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.single.rawValue | NSUnderlineStyle.patternDot.rawValue | NSUnderlineStyle.byWord.rawValue + } - menuTitle.append(NSAttributedString(string: eventTitle, attributes: styles)) - } else { - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineHeightMultiple = 0.7 - paragraphStyle.alignment = .center + if nextEvent.participationStatus == .tentative, Defaults[.showTentativeEvents] == .show_inactive { + styles[NSAttributedString.Key.foregroundColor] = NSColor.disabledControlTextColor + } else if nextEvent.participationStatus == .tentative, Defaults[.showTentativeEvents] == .show_underlined { + styles[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.single.rawValue | NSUnderlineStyle.patternDot.rawValue | NSUnderlineStyle.byWord.rawValue + } + + // Compute second line content first + var secondLineContent = "" - var styles = [NSAttributedString.Key: Any]() - styles[NSAttributedString.Key.font] = NSFont.systemFont(ofSize: 12) - styles[NSAttributedString.Key.baselineOffset] = -3 + if hasTimeUnderTitle { + secondLineContent = time + } - if nextEvent.participationStatus == .pending, Defaults[.showPendingEvents] == .show_inactive { - styles[NSAttributedString.Key.foregroundColor] = NSColor.disabledControlTextColor - } else if nextEvent.participationStatus == .pending, Defaults[.showPendingEvents] == .show_underlined { - styles[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.single.rawValue | NSUnderlineStyle.patternDot.rawValue | NSUnderlineStyle.byWord.rawValue + if hasLocationUnderTitle { + if !secondLineContent.isEmpty { + secondLineContent += " • " + processedLocation + } else { + secondLineContent = processedLocation } + } - if nextEvent.participationStatus == .tentative, Defaults[.showTentativeEvents] == .show_inactive { - styles[NSAttributedString.Key.foregroundColor] = NSColor.disabledControlTextColor - } else if nextEvent.participationStatus == .tentative, Defaults[.showTentativeEvents] == .show_underlined { - styles[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.single.rawValue | NSUnderlineStyle.patternDot.rawValue | NSUnderlineStyle.byWord.rawValue + let shouldRenderSingleLine = !hasTimeUnderTitle && !hasLocationUnderTitle + if shouldRenderSingleLine { + menuTitle.append(NSAttributedString(string: eventTitle, attributes: styles)) + } else { + let hasFirstLineContent = !eventTitle.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty + if hasFirstLineContent { + styles[NSAttributedString.Key.baselineOffset] = -3 + menuTitle.append(NSAttributedString(string: eventTitle, attributes: styles)) } - menuTitle.append(NSAttributedString(string: title, attributes: styles)) + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineHeightMultiple = 0.7 + paragraphStyle.alignment = .center - let timeAttributes = [ + let secondLineAttributes = [ NSAttributedString.Key.font: NSFont.systemFont(ofSize: 9), NSAttributedString.Key.foregroundColor: NSColor.lightGray ] - menuTitle.append(NSAttributedString(string: "\n" + time, attributes: timeAttributes)) + + let separator = hasFirstLineContent ? "\n" : "" + menuTitle.append( + NSAttributedString( + string: separator + secondLineContent, attributes: secondLineAttributes)) menuTitle.addAttributes([NSAttributedString.Key.paragraphStyle: paragraphStyle], range: NSRange(location: 0, length: menuTitle.length)) } @@ -536,6 +562,22 @@ func shortenTitle(title: String?, offset: Int) -> String { return eventTitle } +func processLocationForDisplay(location: String?, offset: Int) -> String { + guard let location = location, !location.isEmpty else { return "" } + + let firstLine = location.components(separatedBy: .newlines).first ?? "" + + var processedLocation = firstLine.trimmingCharacters(in: TitleTruncationRules.excludeAtEnds) + if processedLocation.count > offset { + let index = processedLocation.index(processedLocation.startIndex, offsetBy: offset - 1) + processedLocation = String(processedLocation[...index]).trimmingCharacters( + in: TitleTruncationRules.excludeAtEnds) + processedLocation += "..." + } + + return processedLocation +} + func createEventStatusString(title: String, startDate: Date, endDate: Date) -> (String, String) { var eventTime: String diff --git a/MeetingBar/UI/Views/Changelog/Changelog.swift b/MeetingBar/UI/Views/Changelog/Changelog.swift index 008ddf75..cdd170e8 100644 --- a/MeetingBar/UI/Views/Changelog/Changelog.swift +++ b/MeetingBar/UI/Views/Changelog/Changelog.swift @@ -189,6 +189,11 @@ struct ChangelogView: View { Text("and a lot of bug fixes and translations updates") } } + if compareVersions("4.12.0", lastRevisedVersionInChangelog) { + Section(header: Text("Version 4.12")) { + Text("• Location display settings for status bar") + } + } } }.listStyle(SidebarListStyle()) Button("general_close".loco(), action: close) diff --git a/MeetingBar/UI/Views/Preferences/AppearanceTab.swift b/MeetingBar/UI/Views/Preferences/AppearanceTab.swift index 38c25073..b4a4d1a5 100644 --- a/MeetingBar/UI/Views/Preferences/AppearanceTab.swift +++ b/MeetingBar/UI/Views/Preferences/AppearanceTab.swift @@ -145,6 +145,7 @@ struct StatusBarSection: View { @Default(.eventTitleIconFormat) var eventTitleIconFormat @Default(.eventTitleFormat) var eventTitleFormat @Default(.eventTimeFormat) var eventTimeFormat + @Default(.eventLocationFormat) var eventLocationFormat @Default(.statusbarEventTitleLength) var statusbarEventTitleLength @Default(.showEventMaxTimeUntilEventThreshold) var showEventMaxTimeUntilEventThreshold @Default(.showEventMaxTimeUntilEventEnabled) var showEventMaxTimeUntilEventEnabled @@ -221,6 +222,25 @@ struct StatusBarSection: View { EventTimeFormat.show) Text("preferences_appearance_status_bar_time_show_under_title_value".loco()) .tag(EventTimeFormat.show_under_title) + Text("preferences_appearance_status_bar_time_hide_value".loco()).tag( + EventTimeFormat.hide) + } + }.frame(width: 325) + + HStack { + Picker( + "preferences_appearance_status_bar_location_title".loco(), + selection: $eventLocationFormat + ) { + Text("preferences_appearance_status_bar_location_show_value".loco()).tag( + EventLocationFormat.show) + Text( + "preferences_appearance_status_bar_location_show_under_title_value" + .loco() + ) + .tag(EventLocationFormat.show_under_title) + Text("preferences_appearance_status_bar_location_hide_value".loco()).tag( + EventLocationFormat.hide) } }.frame(width: 325) diff --git a/MeetingBar/Utilities/Constants.swift b/MeetingBar/Utilities/Constants.swift index e79d6775..1f9ef66b 100644 --- a/MeetingBar/Utilities/Constants.swift +++ b/MeetingBar/Utilities/Constants.swift @@ -62,6 +62,13 @@ enum EventTimeFormat: String, Defaults.Serializable, Codable, CaseIterable { case hide } +/// format for location in statusbar - can be shown, be under title or be hidden +enum EventLocationFormat: String, Defaults.Serializable, Codable, CaseIterable { + case show + case show_under_title + case hide +} + enum DeclinedEventsAppereance: String, Defaults.Serializable, Codable, CaseIterable { case strikethrough case show_inactive