diff --git a/App/Features/Setting/AppSetting.swift b/App/Features/Setting/AppSetting.swift index 264096e..1ed6726 100644 --- a/App/Features/Setting/AppSetting.swift +++ b/App/Features/Setting/AppSetting.swift @@ -4,18 +4,28 @@ import SharedLib final class AppSetting: ObservableObject { @Published var webFontSizePercent: Double + @Published var theme: Theme private var cancellable = Set() init() { webFontSizePercent = WallabagUserDefaults.webFontSizePercent + theme = Theme(rawValue: WallabagUserDefaults.theme) ?? .auto $webFontSizePercent .sink(receiveValue: updateWebFontSizePercent) .store(in: &cancellable) + + $theme + .sink(receiveValue: updateTheme) + .store(in: &cancellable) } private func updateWebFontSizePercent(_ value: Double) { WallabagUserDefaults.webFontSizePercent = value } + + private func updateTheme(_ value: Theme) { + WallabagUserDefaults.theme = value.rawValue + } } diff --git a/App/Features/Setting/SettingView.swift b/App/Features/Setting/SettingView.swift index 4469c29..8acafd7 100644 --- a/App/Features/Setting/SettingView.swift +++ b/App/Features/Setting/SettingView.swift @@ -1,3 +1,4 @@ +import Factory import SharedLib import SwiftUI @@ -7,9 +8,17 @@ struct SettingView: View { @AppStorage("badge") var badge: Bool = true @AppStorage("defaultMode") var defaultMode: String = RetrieveMode.allArticles.rawValue @AppStorage("itemPerPageDuringSync") var itemPerPageDuringSync: Int = 50 + @EnvironmentObject var appSetting: AppSetting var body: some View { Form { + Section("Appearance") { + Picker("Theme", selection: $appSetting.theme) { + ForEach(Theme.allCases) { theme in + Text(theme.name).tag(theme) + } + } + } Section("Entries list") { Toggle("Show image in list", isOn: $showImageInList) Picker("Default mode", selection: $defaultMode) { @@ -35,5 +44,6 @@ struct SettingView: View { struct SettingView_Previews: PreviewProvider { static var previews: some View { SettingView() + .environmentObject(AppSetting()) } } diff --git a/App/Lib/Theme.swift b/App/Lib/Theme.swift new file mode 100644 index 0000000..ed3fc47 --- /dev/null +++ b/App/Lib/Theme.swift @@ -0,0 +1,25 @@ +import SwiftUI + +enum Theme: String, CaseIterable, Identifiable { + case auto + case light + case dark + + var id: String { rawValue } + + var colorScheme: ColorScheme? { + switch self { + case .auto: return nil + case .light: return .light + case .dark: return .dark + } + } + + var name: LocalizedStringKey { + switch self { + case .auto: return "Auto" + case .light: return "Light" + case .dark: return "Dark" + } + } +} diff --git a/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/App/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/Contents.json rename to App/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/App/Assets.xcassets/AppIcon.appiconset/logo-icon-bg-white-lg.jpg b/App/Resources/Assets.xcassets/AppIcon.appiconset/logo-icon-bg-white-lg.jpg similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/logo-icon-bg-white-lg.jpg rename to App/Resources/Assets.xcassets/AppIcon.appiconset/logo-icon-bg-white-lg.jpg diff --git a/App/Assets.xcassets/AppIcon.appiconset/mac1024.png b/App/Resources/Assets.xcassets/AppIcon.appiconset/mac1024.png similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/mac1024.png rename to App/Resources/Assets.xcassets/AppIcon.appiconset/mac1024.png diff --git a/App/Assets.xcassets/AppIcon.appiconset/mac128.png b/App/Resources/Assets.xcassets/AppIcon.appiconset/mac128.png similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/mac128.png rename to App/Resources/Assets.xcassets/AppIcon.appiconset/mac128.png diff --git a/App/Assets.xcassets/AppIcon.appiconset/mac16.png b/App/Resources/Assets.xcassets/AppIcon.appiconset/mac16.png similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/mac16.png rename to App/Resources/Assets.xcassets/AppIcon.appiconset/mac16.png diff --git a/App/Assets.xcassets/AppIcon.appiconset/mac256.png b/App/Resources/Assets.xcassets/AppIcon.appiconset/mac256.png similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/mac256.png rename to App/Resources/Assets.xcassets/AppIcon.appiconset/mac256.png diff --git a/App/Assets.xcassets/AppIcon.appiconset/mac32.png b/App/Resources/Assets.xcassets/AppIcon.appiconset/mac32.png similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/mac32.png rename to App/Resources/Assets.xcassets/AppIcon.appiconset/mac32.png diff --git a/App/Assets.xcassets/AppIcon.appiconset/mac512.png b/App/Resources/Assets.xcassets/AppIcon.appiconset/mac512.png similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/mac512.png rename to App/Resources/Assets.xcassets/AppIcon.appiconset/mac512.png diff --git a/App/Assets.xcassets/AppIcon.appiconset/mac64.png b/App/Resources/Assets.xcassets/AppIcon.appiconset/mac64.png similarity index 100% rename from App/Assets.xcassets/AppIcon.appiconset/mac64.png rename to App/Resources/Assets.xcassets/AppIcon.appiconset/mac64.png diff --git a/App/Assets.xcassets/Contents.json b/App/Resources/Assets.xcassets/Contents.json similarity index 100% rename from App/Assets.xcassets/Contents.json rename to App/Resources/Assets.xcassets/Contents.json diff --git a/App/Assets.xcassets/logo.imageset/Contents.json b/App/Resources/Assets.xcassets/logo.imageset/Contents.json similarity index 100% rename from App/Assets.xcassets/logo.imageset/Contents.json rename to App/Resources/Assets.xcassets/logo.imageset/Contents.json diff --git a/App/Assets.xcassets/logo.imageset/logo-icon-black-no-bg-lg.png b/App/Resources/Assets.xcassets/logo.imageset/logo-icon-black-no-bg-lg.png similarity index 100% rename from App/Assets.xcassets/logo.imageset/logo-icon-black-no-bg-lg.png rename to App/Resources/Assets.xcassets/logo.imageset/logo-icon-black-no-bg-lg.png diff --git a/App/Assets.xcassets/logo.imageset/logo-icon-white-no-bg-lg.png b/App/Resources/Assets.xcassets/logo.imageset/logo-icon-white-no-bg-lg.png similarity index 100% rename from App/Assets.xcassets/logo.imageset/logo-icon-white-no-bg-lg.png rename to App/Resources/Assets.xcassets/logo.imageset/logo-icon-white-no-bg-lg.png diff --git a/App/WallabagStoreKit.storekit b/App/Resources/WallabagStoreKit.storekit similarity index 100% rename from App/WallabagStoreKit.storekit rename to App/Resources/WallabagStoreKit.storekit diff --git a/App/Resources/ar.lproj/Localizable.strings b/App/Resources/ar.lproj/Localizable.strings new file mode 100644 index 0000000..a7e6b9d --- /dev/null +++ b/App/Resources/ar.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "المظهر"; +"Theme" = "السمة"; +"Auto" = "تلقائي"; +"Light" = "فاتح"; +"Dark" = "داكن"; diff --git a/App/cs.lproj/Localizable.strings b/App/Resources/cs.lproj/Localizable.strings similarity index 74% rename from App/cs.lproj/Localizable.strings rename to App/Resources/cs.lproj/Localizable.strings index 61a4f91..8ae83ee 100644 --- a/App/cs.lproj/Localizable.strings +++ b/App/Resources/cs.lproj/Localizable.strings @@ -17,3 +17,10 @@ // Menu "Menu" = "Nabídka"; + +// Theme +"Appearance" = "Vzhled"; +"Theme" = "Motiv"; +"Auto" = "Automaticky"; +"Light" = "Světlý"; +"Dark" = "Tmavý"; diff --git a/App/Resources/da.lproj/Localizable.strings b/App/Resources/da.lproj/Localizable.strings new file mode 100644 index 0000000..f790fd6 --- /dev/null +++ b/App/Resources/da.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Udseende"; +"Theme" = "Tema"; +"Auto" = "Auto"; +"Light" = "Lyst"; +"Dark" = "Mørkt"; diff --git a/App/de.lproj/Localizable.strings b/App/Resources/de.lproj/Localizable.strings similarity index 91% rename from App/de.lproj/Localizable.strings rename to App/Resources/de.lproj/Localizable.strings index 145857d..e96b3c5 100644 --- a/App/de.lproj/Localizable.strings +++ b/App/Resources/de.lproj/Localizable.strings @@ -48,3 +48,10 @@ //Player "Select one entry" = "Eintrag auswählen"; + +// Theme +"Appearance" = "Erscheinungsbild"; +"Theme" = "Design"; +"Auto" = "Automatisch"; +"Light" = "Hell"; +"Dark" = "Dunkel"; diff --git a/App/en.lproj/Localizable.strings b/App/Resources/en.lproj/Localizable.strings similarity index 92% rename from App/en.lproj/Localizable.strings rename to App/Resources/en.lproj/Localizable.strings index c734311..dfc7a36 100644 --- a/App/en.lproj/Localizable.strings +++ b/App/Resources/en.lproj/Localizable.strings @@ -50,3 +50,10 @@ //Player "Select one entry" = "Select one entry"; + +// Theme +"Appearance" = "Appearance"; +"Theme" = "Theme"; +"Auto" = "Auto"; +"Light" = "Light"; +"Dark" = "Dark"; diff --git a/App/es.lproj/Localizable.strings b/App/Resources/es.lproj/Localizable.strings similarity index 53% rename from App/es.lproj/Localizable.strings rename to App/Resources/es.lproj/Localizable.strings index 8f55ba2..84df269 100644 --- a/App/es.lproj/Localizable.strings +++ b/App/Resources/es.lproj/Localizable.strings @@ -1,10 +1,13 @@ - - - - // Tip View "This application is developed on free time" = "Esta aplicación se desarrolla en tiempo libre."; -"Logout" = "Desconectarse"; +"Select one entry" = "Selecciona una entrada"; + +// Theme +"Appearance" = "Apariencia"; +"Theme" = "Tema"; +"Auto" = "Automático"; +"Light" = "Claro"; +"Dark" = "Oscuro"; "Setting" = "Configuración"; "About" = "Acerca de"; diff --git a/App/Resources/fa.lproj/Localizable.strings b/App/Resources/fa.lproj/Localizable.strings new file mode 100644 index 0000000..3e2e63d --- /dev/null +++ b/App/Resources/fa.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "ظاهر"; +"Theme" = "پوسته"; +"Auto" = "خودکار"; +"Light" = "روشن"; +"Dark" = "تیره"; diff --git a/App/fr.lproj/Localizable.strings b/App/Resources/fr.lproj/Localizable.strings similarity index 93% rename from App/fr.lproj/Localizable.strings rename to App/Resources/fr.lproj/Localizable.strings index ace35fa..76be5f7 100644 --- a/App/fr.lproj/Localizable.strings +++ b/App/Resources/fr.lproj/Localizable.strings @@ -54,3 +54,10 @@ "Order by id" = "Trier par id"; "Order by reading time" = "Trier par temps de lecture"; "Sorting" = "Tri"; + +// Theme +"Appearance" = "Apparence"; +"Theme" = "Thème"; +"Auto" = "Auto"; +"Light" = "Clair"; +"Dark" = "Sombre"; diff --git a/App/Resources/gl.lproj/Localizable.strings b/App/Resources/gl.lproj/Localizable.strings new file mode 100644 index 0000000..154ca5d --- /dev/null +++ b/App/Resources/gl.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Aparencia"; +"Theme" = "Tema"; +"Auto" = "Auto"; +"Light" = "Claro"; +"Dark" = "Escuro"; diff --git a/App/Resources/hi.lproj/Localizable.strings b/App/Resources/hi.lproj/Localizable.strings new file mode 100644 index 0000000..1f4d719 --- /dev/null +++ b/App/Resources/hi.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "दिखावट"; +"Theme" = "थीम"; +"Auto" = "ऑटो"; +"Light" = "हल्का"; +"Dark" = "गहरा"; diff --git a/App/hr.lproj/Localizable.strings b/App/Resources/hr.lproj/Localizable.strings similarity index 91% rename from App/hr.lproj/Localizable.strings rename to App/Resources/hr.lproj/Localizable.strings index 836379e..60e0cf3 100644 --- a/App/hr.lproj/Localizable.strings +++ b/App/Resources/hr.lproj/Localizable.strings @@ -48,3 +48,10 @@ //Player "Select one entry" = "Odaberi unos"; + +// Theme +"Appearance" = "Izgled"; +"Theme" = "Tema"; +"Auto" = "Automatski"; +"Light" = "Svijetlo"; +"Dark" = "Tamno"; diff --git a/App/html-ressources/article.html b/App/Resources/html-ressources/article.html similarity index 100% rename from App/html-ressources/article.html rename to App/Resources/html-ressources/article.html diff --git a/App/html-ressources/justify.css b/App/Resources/html-ressources/justify.css similarity index 100% rename from App/html-ressources/justify.css rename to App/Resources/html-ressources/justify.css diff --git a/App/html-ressources/main.css b/App/Resources/html-ressources/main.css similarity index 100% rename from App/html-ressources/main.css rename to App/Resources/html-ressources/main.css diff --git a/App/html-ressources/ratatouille.css b/App/Resources/html-ressources/ratatouille.css similarity index 100% rename from App/html-ressources/ratatouille.css rename to App/Resources/html-ressources/ratatouille.css diff --git a/App/Resources/hu.lproj/Localizable.strings b/App/Resources/hu.lproj/Localizable.strings new file mode 100644 index 0000000..20a56ad --- /dev/null +++ b/App/Resources/hu.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Megjelenés"; +"Theme" = "Téma"; +"Auto" = "Automatikus"; +"Light" = "Világos"; +"Dark" = "Sötét"; diff --git a/App/it.lproj/Localizable.strings b/App/Resources/it.lproj/Localizable.strings similarity index 89% rename from App/it.lproj/Localizable.strings rename to App/Resources/it.lproj/Localizable.strings index 29ea2ef..6e91d6e 100644 --- a/App/it.lproj/Localizable.strings +++ b/App/Resources/it.lproj/Localizable.strings @@ -33,3 +33,10 @@ // Menu "Menu" = "Menù"; + +// Theme +"Appearance" = "Aspetto"; +"Theme" = "Tema"; +"Auto" = "Automatico"; +"Light" = "Chiaro"; +"Dark" = "Scuro"; diff --git a/App/ja.lproj/Localizable.strings b/App/Resources/ja.lproj/Localizable.strings similarity index 92% rename from App/ja.lproj/Localizable.strings rename to App/Resources/ja.lproj/Localizable.strings index 7dc911d..0dc8f6f 100644 --- a/App/ja.lproj/Localizable.strings +++ b/App/Resources/ja.lproj/Localizable.strings @@ -42,3 +42,10 @@ "Loading..." = "読み込み中..."; "Don" = "寄付"; "Starred" = "スター"; + +// Theme +"Appearance" = "外観"; +"Theme" = "テーマ"; +"Auto" = "自動"; +"Light" = "ライト"; +"Dark" = "ダーク"; diff --git a/App/Resources/ko.lproj/Localizable.strings b/App/Resources/ko.lproj/Localizable.strings new file mode 100644 index 0000000..a422ac0 --- /dev/null +++ b/App/Resources/ko.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "모양"; +"Theme" = "테마"; +"Auto" = "자동"; +"Light" = "라이트"; +"Dark" = "다크"; diff --git a/App/Resources/nb-NO.lproj/Localizable.strings b/App/Resources/nb-NO.lproj/Localizable.strings new file mode 100644 index 0000000..bf5b369 --- /dev/null +++ b/App/Resources/nb-NO.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Utseende"; +"Theme" = "Tema"; +"Auto" = "Auto"; +"Light" = "Lyst"; +"Dark" = "Mørkt"; diff --git a/App/nl.lproj/Localizable.strings b/App/Resources/nl.lproj/Localizable.strings similarity index 89% rename from App/nl.lproj/Localizable.strings rename to App/Resources/nl.lproj/Localizable.strings index a0fcec4..0de4d5b 100644 --- a/App/nl.lproj/Localizable.strings +++ b/App/Resources/nl.lproj/Localizable.strings @@ -33,3 +33,10 @@ "Loading..." = "Laden..."; "But you can contribute financially by making a donation whenever you want to support the project." = "Maar u kunt ook financieel bijdragen door een donatie te doen u het project wilt steunen."; "Entries" = "Items"; + +// Theme +"Appearance" = "Weergave"; +"Theme" = "Thema"; +"Auto" = "Automatisch"; +"Light" = "Licht"; +"Dark" = "Donker"; diff --git a/App/Resources/oc.lproj/Localizable.strings b/App/Resources/oc.lproj/Localizable.strings new file mode 100644 index 0000000..4852548 --- /dev/null +++ b/App/Resources/oc.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Aparéncia"; +"Theme" = "Tèma"; +"Auto" = "Auto"; +"Light" = "Clar"; +"Dark" = "Escur"; diff --git a/App/Resources/pl.lproj/Localizable.strings b/App/Resources/pl.lproj/Localizable.strings new file mode 100644 index 0000000..c9c9c50 --- /dev/null +++ b/App/Resources/pl.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Wygląd"; +"Theme" = "Motyw"; +"Auto" = "Automatyczny"; +"Light" = "Jasny"; +"Dark" = "Ciemny"; diff --git a/App/Resources/pt.lproj/Localizable.strings b/App/Resources/pt.lproj/Localizable.strings new file mode 100644 index 0000000..34d7907 --- /dev/null +++ b/App/Resources/pt.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Aparência"; +"Theme" = "Tema"; +"Auto" = "Automático"; +"Light" = "Claro"; +"Dark" = "Escuro"; diff --git a/App/Resources/ro.lproj/Localizable.strings b/App/Resources/ro.lproj/Localizable.strings new file mode 100644 index 0000000..ff45459 --- /dev/null +++ b/App/Resources/ro.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Aspect"; +"Theme" = "Temă"; +"Auto" = "Auto"; +"Light" = "Luminos"; +"Dark" = "Întunecat"; diff --git a/App/ru.lproj/Localizable.strings b/App/Resources/ru.lproj/Localizable.strings similarity index 90% rename from App/ru.lproj/Localizable.strings rename to App/Resources/ru.lproj/Localizable.strings index 8756b7c..e58278c 100644 --- a/App/ru.lproj/Localizable.strings +++ b/App/Resources/ru.lproj/Localizable.strings @@ -40,3 +40,10 @@ // Search "Search" = "Поиск"; + +// Theme +"Appearance" = "Оформление"; +"Theme" = "Тема"; +"Auto" = "Автоматически"; +"Light" = "Светлая"; +"Dark" = "Темная"; diff --git a/App/Resources/sv.lproj/Localizable.strings b/App/Resources/sv.lproj/Localizable.strings new file mode 100644 index 0000000..2388486 --- /dev/null +++ b/App/Resources/sv.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Utseende"; +"Theme" = "Tema"; +"Auto" = "Auto"; +"Light" = "Ljust"; +"Dark" = "Mörkt"; diff --git a/App/Resources/th.lproj/Localizable.strings b/App/Resources/th.lproj/Localizable.strings new file mode 100644 index 0000000..7c3a73c --- /dev/null +++ b/App/Resources/th.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "ลักษณะ"; +"Theme" = "ธีม"; +"Auto" = "อัตโนมัติ"; +"Light" = "สว่าง"; +"Dark" = "มืด"; diff --git a/App/tr.lproj/Localizable.strings b/App/Resources/tr.lproj/Localizable.strings similarity index 91% rename from App/tr.lproj/Localizable.strings rename to App/Resources/tr.lproj/Localizable.strings index a997ae6..75ed142 100644 --- a/App/tr.lproj/Localizable.strings +++ b/App/Resources/tr.lproj/Localizable.strings @@ -46,3 +46,10 @@ //Player "Select one entry" = "Bir makale seçin"; + +// Theme +"Appearance" = "Görünüm"; +"Theme" = "Tema"; +"Auto" = "Otomatik"; +"Light" = "Açık"; +"Dark" = "Koyu"; diff --git a/App/Resources/uk.lproj/Localizable.strings b/App/Resources/uk.lproj/Localizable.strings new file mode 100644 index 0000000..5824c15 --- /dev/null +++ b/App/Resources/uk.lproj/Localizable.strings @@ -0,0 +1,7 @@ + +// Theme +"Appearance" = "Вигляд"; +"Theme" = "Тема"; +"Auto" = "Авто"; +"Light" = "Світла"; +"Dark" = "Темна"; diff --git a/App/wallabag.xcdatamodeld/.xccurrentversion b/App/Resources/wallabag.xcdatamodeld/.xccurrentversion similarity index 100% rename from App/wallabag.xcdatamodeld/.xccurrentversion rename to App/Resources/wallabag.xcdatamodeld/.xccurrentversion diff --git a/App/wallabag.xcdatamodeld/Shared.xcdatamodel/contents b/App/Resources/wallabag.xcdatamodeld/Shared.xcdatamodel/contents similarity index 100% rename from App/wallabag.xcdatamodeld/Shared.xcdatamodel/contents rename to App/Resources/wallabag.xcdatamodeld/Shared.xcdatamodel/contents diff --git a/App/wallabagStore.xcdatamodeld/wallabagStore.xcdatamodel/contents b/App/Resources/wallabagStore.xcdatamodeld/wallabagStore.xcdatamodel/contents similarity index 100% rename from App/wallabagStore.xcdatamodeld/wallabagStore.xcdatamodel/contents rename to App/Resources/wallabagStore.xcdatamodeld/wallabagStore.xcdatamodel/contents diff --git a/App/zh-Hans.lproj/Localizable.strings b/App/Resources/zh-Hans.lproj/Localizable.strings similarity index 91% rename from App/zh-Hans.lproj/Localizable.strings rename to App/Resources/zh-Hans.lproj/Localizable.strings index 3ab3abd..c9fdca5 100644 --- a/App/zh-Hans.lproj/Localizable.strings +++ b/App/Resources/zh-Hans.lproj/Localizable.strings @@ -48,3 +48,10 @@ //Player "Select one entry" = "选择一个条目"; + +// Theme +"Appearance" = "外观"; +"Theme" = "主题"; +"Auto" = "自动"; +"Light" = "浅色"; +"Dark" = "深色"; diff --git a/App/zh-Hant.lproj/Localizable.strings b/App/Resources/zh-Hant.lproj/Localizable.strings similarity index 91% rename from App/zh-Hant.lproj/Localizable.strings rename to App/Resources/zh-Hant.lproj/Localizable.strings index f6497a3..6d005e5 100644 --- a/App/zh-Hant.lproj/Localizable.strings +++ b/App/Resources/zh-Hant.lproj/Localizable.strings @@ -42,3 +42,10 @@ // Menu "Menu" = "菜單"; + +// Theme +"Appearance" = "外觀"; +"Theme" = "主題"; +"Auto" = "自動"; +"Light" = "淺色"; +"Dark" = "深色"; diff --git a/App/WallabagApp.swift b/App/WallabagApp.swift index 97ddb7a..13f4e43 100644 --- a/App/WallabagApp.swift +++ b/App/WallabagApp.swift @@ -39,6 +39,7 @@ struct WallabagApp: App { .environment(errorHandler) .environmentObject(appSetting) .environment(\.managedObjectContext, coreData.viewContext) + .preferredColorScheme(appSetting.theme.colorScheme) } .onChange(of: scenePhase) { _, newScenePhase in if newScenePhase == .active { diff --git a/App/ar.lproj/Localizable.strings b/App/ar.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/ar.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/da.lproj/Localizable.strings b/App/da.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/da.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/fa.lproj/Localizable.strings b/App/fa.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/fa.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/gl.lproj/Localizable.strings b/App/gl.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/gl.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/hi.lproj/Localizable.strings b/App/hi.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/hi.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/hu.lproj/Localizable.strings b/App/hu.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/hu.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/ko.lproj/Localizable.strings b/App/ko.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/ko.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/nb-NO.lproj/Localizable.strings b/App/nb-NO.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/nb-NO.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/oc.lproj/Localizable.strings b/App/oc.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/oc.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/pl.lproj/Localizable.strings b/App/pl.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/pl.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/pt.lproj/Localizable.strings b/App/pt.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/pt.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/ro.lproj/Localizable.strings b/App/ro.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/ro.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/sv.lproj/Localizable.strings b/App/sv.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/sv.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/th.lproj/Localizable.strings b/App/th.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/th.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/App/uk.lproj/Localizable.strings b/App/uk.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/App/uk.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/SharedLib/Sources/SharedLib/Lib/WallabagUserDefaults.swift b/SharedLib/Sources/SharedLib/Lib/WallabagUserDefaults.swift index 5140d6b..32dbd67 100644 --- a/SharedLib/Sources/SharedLib/Lib/WallabagUserDefaults.swift +++ b/SharedLib/Sources/SharedLib/Lib/WallabagUserDefaults.swift @@ -48,4 +48,7 @@ public enum WallabagUserDefaults { @GeneralSetting("itemPerPageDuringSync", defaultValue: 50) public static var itemPerPageDuringSync: Int + + @GeneralSetting("theme", defaultValue: "auto") + public static var theme: String } diff --git a/wallabag.xcodeproj/project.pbxproj b/wallabag.xcodeproj/project.pbxproj index 91a7047..f6a3630 100644 --- a/wallabag.xcodeproj/project.pbxproj +++ b/wallabag.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 09644B5725C9810A000FFDA1 /* WallabagApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09644B5625C9810A000FFDA1 /* WallabagApp.swift */; }; 09644B5E25C98116000FFDA1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09644B5D25C98116000FFDA1 /* AppDelegate.swift */; }; 09644B7E25C98152000FFDA1 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09644B7D25C98152000FFDA1 /* AppState.swift */; }; + 09FA20240000000000000002 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FA20240000000000000001 /* Theme.swift */; }; 09644B8C25C98176000FFDA1 /* Route.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09644B8825C98176000FFDA1 /* Route.swift */; }; 09644B9725C9819F000FFDA1 /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09644B9425C9819F000FFDA1 /* PlayerView.swift */; }; 09644B9825C9819F000FFDA1 /* PlayerPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09644B9525C9819F000FFDA1 /* PlayerPublisher.swift */; }; @@ -171,6 +172,7 @@ 09644B5625C9810A000FFDA1 /* WallabagApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WallabagApp.swift; sourceTree = ""; }; 09644B5D25C98116000FFDA1 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 09644B7D25C98152000FFDA1 /* AppState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppState.swift; sourceTree = ""; }; + 09FA20240000000000000001 /* Theme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = ""; }; 09644B8825C98176000FFDA1 /* Route.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Route.swift; sourceTree = ""; }; 09644B9425C9819F000FFDA1 /* PlayerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = ""; }; 09644B9525C9819F000FFDA1 /* PlayerPublisher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerPublisher.swift; sourceTree = ""; }; @@ -399,6 +401,7 @@ 09644B7D25C98152000FFDA1 /* AppState.swift */, 09644BD125C9833D000FFDA1 /* DependencyInjection.swift */, 09644BD325C9833D000FFDA1 /* WallabagError.swift */, + 09FA20240000000000000001 /* Theme.swift */, ); path = Lib; sourceTree = ""; @@ -744,6 +747,18 @@ name = Products; sourceTree = ""; }; + 09FA20300000000000000001 /* Resources */ = { + isa = PBXGroup; + children = ( + 09AD759C2624F93D00708A1E /* html-ressources */, + 09AD75C02624FEEE00708A1E /* Localizable.strings */, + 09644D1E25C98782000FFDA1 /* wallabagStore.xcdatamodeld */, + 0951C61729CC2EB000D8E8C6 /* Assets.xcassets */, + 099CD12E2B5019F40029E94A /* WallabagStoreKit.storekit */, + ); + path = Resources; + sourceTree = ""; + }; 09BFB28625C8348E00E12B4D /* App */ = { isa = PBXGroup; children = ( @@ -753,13 +768,9 @@ 097F824C25CB1B17006C85F6 /* Entity */, 09644D1625C9874D000FFDA1 /* Extension */, 09644B8425C98161000FFDA1 /* Features */, - 09AD759C2624F93D00708A1E /* html-ressources */, 09644B7C25C9814C000FFDA1 /* Lib */, - 09AD75C02624FEEE00708A1E /* Localizable.strings */, 09644BE425C98343000FFDA1 /* PropertyWrapper */, - 09644D1E25C98782000FFDA1 /* wallabagStore.xcdatamodeld */, - 0951C61729CC2EB000D8E8C6 /* Assets.xcassets */, - 099CD12E2B5019F40029E94A /* WallabagStoreKit.storekit */, + 09FA20300000000000000001 /* Resources */, ); path = App; sourceTree = ""; @@ -1067,6 +1078,7 @@ 09644BAF25C98213000FFDA1 /* RefreshButton.swift in Sources */, 09BE0AF42A9F45E900193FBF /* View+Extension.swift in Sources */, 09644C7025C985A9000FFDA1 /* ArchiveEntryButton.swift in Sources */, + 09FA20240000000000000002 /* Theme.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };