diff --git a/CodeEdit.xcodeproj/project.pbxproj b/CodeEdit.xcodeproj/project.pbxproj index 84e65b4a5b..df34db92ca 100644 --- a/CodeEdit.xcodeproj/project.pbxproj +++ b/CodeEdit.xcodeproj/project.pbxproj @@ -449,24 +449,6 @@ B6C6A42A297716A500A3D28F /* EditorTabCloseButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6C6A429297716A500A3D28F /* EditorTabCloseButton.swift */; }; B6C6A42E29771A8D00A3D28F /* EditorTabButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6C6A42D29771A8D00A3D28F /* EditorTabButtonStyle.swift */; }; B6C6A43029771F7100A3D28F /* EditorTabBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6C6A42F29771F7100A3D28F /* EditorTabBackground.swift */; }; - B6D26E6C2B686DE300B4C14F /* High Contrast (Light).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E5A2B686DE200B4C14F /* High Contrast (Light).cetheme */; }; - B6D26E6D2B686DE300B4C14F /* Presentation (Light).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E5B2B686DE200B4C14F /* Presentation (Light).cetheme */; }; - B6D26E6E2B686DE300B4C14F /* Solarized (Light).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E5C2B686DE200B4C14F /* Solarized (Light).cetheme */; }; - B6D26E6F2B686DE300B4C14F /* Classic (Dark).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E5D2B686DE200B4C14F /* Classic (Dark).cetheme */; }; - B6D26E702B686DE300B4C14F /* Midnight.cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E5E2B686DE200B4C14F /* Midnight.cetheme */; }; - B6D26E712B686DE300B4C14F /* GitHub (Dark).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E5F2B686DE200B4C14F /* GitHub (Dark).cetheme */; }; - B6D26E722B686DE300B4C14F /* Dusk.cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E602B686DE200B4C14F /* Dusk.cetheme */; }; - B6D26E732B686DE300B4C14F /* Classic (Light).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E612B686DE200B4C14F /* Classic (Light).cetheme */; }; - B6D26E742B686DE300B4C14F /* Presentation (Dark).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E622B686DE200B4C14F /* Presentation (Dark).cetheme */; }; - B6D26E752B686DE300B4C14F /* Default (Dark).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E632B686DE300B4C14F /* Default (Dark).cetheme */; }; - B6D26E762B686DE300B4C14F /* Low Key.cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E642B686DE300B4C14F /* Low Key.cetheme */; }; - B6D26E772B686DE300B4C14F /* High Contrast (Dark).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E652B686DE300B4C14F /* High Contrast (Dark).cetheme */; }; - B6D26E782B686DE300B4C14F /* GitHub (Light).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E662B686DE300B4C14F /* GitHub (Light).cetheme */; }; - B6D26E792B686DE300B4C14F /* Basic.cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E672B686DE300B4C14F /* Basic.cetheme */; }; - B6D26E7A2B686DE300B4C14F /* Sunset.cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E682B686DE300B4C14F /* Sunset.cetheme */; }; - B6D26E7B2B686DE300B4C14F /* Default (Light).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E692B686DE300B4C14F /* Default (Light).cetheme */; }; - B6D26E7C2B686DE300B4C14F /* Civic.cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E6A2B686DE300B4C14F /* Civic.cetheme */; }; - B6D26E7D2B686DE300B4C14F /* Solarized (Dark).cetheme in Resources */ = {isa = PBXBuildFile; fileRef = B6D26E6B2B686DE300B4C14F /* Solarized (Dark).cetheme */; }; B6D7EA592971078500301FAC /* InspectorSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6D7EA582971078500301FAC /* InspectorSection.swift */; }; B6D7EA5C297107DD00301FAC /* InspectorField.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6D7EA5B297107DD00301FAC /* InspectorField.swift */; }; B6E41C7029DD157F0088F9F4 /* AccountsSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6E41C6F29DD157F0088F9F4 /* AccountsSettingsView.swift */; }; @@ -491,6 +473,7 @@ B6F0517929D9E3C900D72287 /* SourceControlGitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6F0517829D9E3C900D72287 /* SourceControlGitView.swift */; }; B6F0517B29D9E46400D72287 /* SourceControlSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6F0517A29D9E46400D72287 /* SourceControlSettingsView.swift */; }; B6F0517D29D9E4B100D72287 /* TerminalSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6F0517C29D9E4B100D72287 /* TerminalSettingsView.swift */; }; + B6FF04782B6C08AC002C2C78 /* DefaultThemes in Resources */ = {isa = PBXBuildFile; fileRef = B6FF04772B6C08AC002C2C78 /* DefaultThemes */; }; D7012EE827E757850001E1EF /* FindNavigatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7012EE727E757850001E1EF /* FindNavigatorView.swift */; }; D7211D4327E066CE008F2ED7 /* Localized+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7211D4227E066CE008F2ED7 /* Localized+Ex.swift */; }; D7211D4727E06BFE008F2ED7 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D7211D4927E06BFE008F2ED7 /* Localizable.strings */; }; @@ -997,24 +980,6 @@ B6C6A429297716A500A3D28F /* EditorTabCloseButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorTabCloseButton.swift; sourceTree = ""; }; B6C6A42D29771A8D00A3D28F /* EditorTabButtonStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorTabButtonStyle.swift; sourceTree = ""; }; B6C6A42F29771F7100A3D28F /* EditorTabBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorTabBackground.swift; sourceTree = ""; }; - B6D26E5A2B686DE200B4C14F /* High Contrast (Light).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "High Contrast (Light).cetheme"; sourceTree = ""; }; - B6D26E5B2B686DE200B4C14F /* Presentation (Light).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Presentation (Light).cetheme"; sourceTree = ""; }; - B6D26E5C2B686DE200B4C14F /* Solarized (Light).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Solarized (Light).cetheme"; sourceTree = ""; }; - B6D26E5D2B686DE200B4C14F /* Classic (Dark).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Classic (Dark).cetheme"; sourceTree = ""; }; - B6D26E5E2B686DE200B4C14F /* Midnight.cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Midnight.cetheme; sourceTree = ""; }; - B6D26E5F2B686DE200B4C14F /* GitHub (Dark).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "GitHub (Dark).cetheme"; sourceTree = ""; }; - B6D26E602B686DE200B4C14F /* Dusk.cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Dusk.cetheme; sourceTree = ""; }; - B6D26E612B686DE200B4C14F /* Classic (Light).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Classic (Light).cetheme"; sourceTree = ""; }; - B6D26E622B686DE200B4C14F /* Presentation (Dark).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Presentation (Dark).cetheme"; sourceTree = ""; }; - B6D26E632B686DE300B4C14F /* Default (Dark).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Default (Dark).cetheme"; sourceTree = ""; }; - B6D26E642B686DE300B4C14F /* Low Key.cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Low Key.cetheme"; sourceTree = ""; }; - B6D26E652B686DE300B4C14F /* High Contrast (Dark).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "High Contrast (Dark).cetheme"; sourceTree = ""; }; - B6D26E662B686DE300B4C14F /* GitHub (Light).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "GitHub (Light).cetheme"; sourceTree = ""; }; - B6D26E672B686DE300B4C14F /* Basic.cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Basic.cetheme; sourceTree = ""; }; - B6D26E682B686DE300B4C14F /* Sunset.cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Sunset.cetheme; sourceTree = ""; }; - B6D26E692B686DE300B4C14F /* Default (Light).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Default (Light).cetheme"; sourceTree = ""; }; - B6D26E6A2B686DE300B4C14F /* Civic.cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Civic.cetheme; sourceTree = ""; }; - B6D26E6B2B686DE300B4C14F /* Solarized (Dark).cetheme */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Solarized (Dark).cetheme"; sourceTree = ""; }; B6D7EA582971078500301FAC /* InspectorSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectorSection.swift; sourceTree = ""; }; B6D7EA5B297107DD00301FAC /* InspectorField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectorField.swift; sourceTree = ""; }; B6E41C6F29DD157F0088F9F4 /* AccountsSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountsSettingsView.swift; sourceTree = ""; }; @@ -1039,6 +1004,7 @@ B6F0517829D9E3C900D72287 /* SourceControlGitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceControlGitView.swift; sourceTree = ""; }; B6F0517A29D9E46400D72287 /* SourceControlSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceControlSettingsView.swift; sourceTree = ""; }; B6F0517C29D9E4B100D72287 /* TerminalSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalSettingsView.swift; sourceTree = ""; }; + B6FF04772B6C08AC002C2C78 /* DefaultThemes */ = {isa = PBXFileReference; lastKnownFileType = folder; path = DefaultThemes; sourceTree = ""; }; D7012EE727E757850001E1EF /* FindNavigatorView.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = FindNavigatorView.swift; sourceTree = ""; tabWidth = 4; }; D7211D4227E066CE008F2ED7 /* Localized+Ex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Localized+Ex.swift"; sourceTree = ""; }; D7211D4827E06BFE008F2ED7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; @@ -1200,31 +1166,6 @@ path = Configs; sourceTree = ""; }; - 28069DA527F5BD320016BC47 /* DefaultThemes */ = { - isa = PBXGroup; - children = ( - B6D26E672B686DE300B4C14F /* Basic.cetheme */, - B6D26E6A2B686DE300B4C14F /* Civic.cetheme */, - B6D26E5D2B686DE200B4C14F /* Classic (Dark).cetheme */, - B6D26E612B686DE200B4C14F /* Classic (Light).cetheme */, - B6D26E632B686DE300B4C14F /* Default (Dark).cetheme */, - B6D26E692B686DE300B4C14F /* Default (Light).cetheme */, - B6D26E602B686DE200B4C14F /* Dusk.cetheme */, - B6D26E5F2B686DE200B4C14F /* GitHub (Dark).cetheme */, - B6D26E662B686DE300B4C14F /* GitHub (Light).cetheme */, - B6D26E652B686DE300B4C14F /* High Contrast (Dark).cetheme */, - B6D26E5A2B686DE200B4C14F /* High Contrast (Light).cetheme */, - B6D26E642B686DE300B4C14F /* Low Key.cetheme */, - B6D26E5E2B686DE200B4C14F /* Midnight.cetheme */, - B6D26E622B686DE200B4C14F /* Presentation (Dark).cetheme */, - B6D26E5B2B686DE200B4C14F /* Presentation (Light).cetheme */, - B6D26E6B2B686DE300B4C14F /* Solarized (Dark).cetheme */, - B6D26E5C2B686DE200B4C14F /* Solarized (Light).cetheme */, - B6D26E682B686DE300B4C14F /* Sunset.cetheme */, - ); - path = DefaultThemes; - sourceTree = ""; - }; 2806E8FE2979587A000040F4 /* Model */ = { isa = PBXGroup; children = ( @@ -2610,6 +2551,7 @@ B658FB2E27DA9E0F00EA4DBD /* CodeEdit */, 587B60F329340A8000D5CD8F /* CodeEditTests */, 28052E0129730F2F00F4F90A /* Configs */, + B6FF04772B6C08AC002C2C78 /* DefaultThemes */, 58F2EACE292FB2B0004A9BDE /* Documentation.docc */, 2BE487ED28245162003F3F64 /* OpenWithCodeEdit */, 284DC8502978BA2600BF2770 /* .all-contributorsrc */, @@ -2635,7 +2577,6 @@ B658FB2E27DA9E0F00EA4DBD /* CodeEdit */ = { isa = PBXGroup; children = ( - 28069DA527F5BD320016BC47 /* DefaultThemes */, 5831E3C52933E6CB00D5A6D2 /* Features */, D7211D4427E066D4008F2ED7 /* Localization */, B658FB3527DA9E1000EA4DBD /* Preview Content */, @@ -3155,32 +3096,15 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - B6D26E732B686DE300B4C14F /* Classic (Light).cetheme in Resources */, - B6D26E6F2B686DE300B4C14F /* Classic (Dark).cetheme in Resources */, - B6D26E712B686DE300B4C14F /* GitHub (Dark).cetheme in Resources */, - B6D26E752B686DE300B4C14F /* Default (Dark).cetheme in Resources */, - B6D26E792B686DE300B4C14F /* Basic.cetheme in Resources */, - B6D26E7B2B686DE300B4C14F /* Default (Light).cetheme in Resources */, - B6D26E7D2B686DE300B4C14F /* Solarized (Dark).cetheme in Resources */, - B6D26E6E2B686DE300B4C14F /* Solarized (Light).cetheme in Resources */, + B6FF04782B6C08AC002C2C78 /* DefaultThemes in Resources */, 283BDCBD2972EEBD002AFF81 /* Package.resolved in Resources */, - B6D26E6C2B686DE300B4C14F /* High Contrast (Light).cetheme in Resources */, B658FB3727DA9E1000EA4DBD /* Preview Assets.xcassets in Resources */, 3E0196732A3921AC002648D8 /* codeedit_shell_integration.zsh in Resources */, - B6D26E6D2B686DE300B4C14F /* Presentation (Light).cetheme in Resources */, - B6D26E742B686DE300B4C14F /* Presentation (Dark).cetheme in Resources */, - B6D26E702B686DE300B4C14F /* Midnight.cetheme in Resources */, 58A5DFA529339F6400D1BD5D /* default_keybindings.json in Resources */, - B6D26E782B686DE300B4C14F /* GitHub (Light).cetheme in Resources */, 3E01967A2A392B45002648D8 /* codeedit_shell_integration.bash in Resources */, D7211D4727E06BFE008F2ED7 /* Localizable.strings in Resources */, - B6D26E7A2B686DE300B4C14F /* Sunset.cetheme in Resources */, - B6D26E762B686DE300B4C14F /* Low Key.cetheme in Resources */, - B6D26E7C2B686DE300B4C14F /* Civic.cetheme in Resources */, - B6D26E722B686DE300B4C14F /* Dusk.cetheme in Resources */, 284DC8512978BA2600BF2770 /* .all-contributorsrc in Resources */, B658FB3427DA9E1000EA4DBD /* Assets.xcassets in Resources */, - B6D26E772B686DE300B4C14F /* High Contrast (Dark).cetheme in Resources */, 6C6BD6FC29CD152400235D17 /* codeedit.extension.appextensionpoint in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/CodeEdit/Features/Settings/Pages/ThemeSettings/Models/ThemeModel.swift b/CodeEdit/Features/Settings/Pages/ThemeSettings/Models/ThemeModel.swift index 36dab79b85..2c0586a540 100644 --- a/CodeEdit/Features/Settings/Pages/ThemeSettings/Models/ThemeModel.swift +++ b/CodeEdit/Features/Settings/Pages/ThemeSettings/Models/ThemeModel.swift @@ -25,9 +25,13 @@ final class ThemeModel: ObservableObject { filemanager.homeDirectoryForCurrentUser.appendingPathComponent("Library/Application Support/CodeEdit") } - /// The URL of the `themes` folder + var bundledThemesURL: URL? { + Bundle.main.resourceURL?.appendingPathComponent("DefaultThemes", isDirectory: true) ?? nil + } + + /// The URL of the `Themes` folder internal var themesURL: URL { - baseURL.appendingPathComponent("themes", isDirectory: true) + baseURL.appendingPathComponent("Themes", isDirectory: true) } /// The URL of the `Extensions` folder @@ -120,91 +124,106 @@ final class ThemeModel: ObservableObject { return theme } catch { print(error) - try filemanager.removeItem(at: url) return nil } } - /// Loads all available themes from `~/Library/Application Support/CodeEdit/themes/` + /// Loads all available themes from `~/Library/Application Support/CodeEdit/Themes/` /// /// If no themes are available, it will create a default theme and save /// it to the location mentioned above. /// - /// When overrides are found in `~/Library/Application Support/CodeEdit/.settings.json` + /// When overrides are found in `~/Library/Application Support/CodeEdit/settings.json` /// they are applied to the loaded themes without altering the original - /// the files in `~/Library/Application Support/CodeEdit/themes/`. + /// the files in `~/Library/Application Support/CodeEdit/Themes/`. func loadThemes() throws { // swiftlint:disable:this function_body_length - // remove all themes from memory - themes.removeAll() + if let bundledThemesURL = bundledThemesURL { + // remove all themes from memory + themes.removeAll() - let url = themesURL + var isDir: ObjCBool = false - var isDir: ObjCBool = false + // check if a themes directory exists, otherwise create one + if !filemanager.fileExists(atPath: themesURL.path, isDirectory: &isDir) { + try filemanager.createDirectory(at: themesURL, withIntermediateDirectories: true) + } - // check if a themes directory exists, otherwise create one - if !filemanager.fileExists(atPath: url.path, isDirectory: &isDir) { - try filemanager.createDirectory(at: url, withIntermediateDirectories: true) - } + // get all URLs in users themes folder that end with `.cetheme` + let userDefinedThemeFilenames = try filemanager.contentsOfDirectory(atPath: themesURL.path).filter { + $0.contains(".cetheme") + } + let userDefinedThemeURLs = userDefinedThemeFilenames.map { + themesURL.appendingPathComponent($0) + } - try loadBundledThemes() + // get all bundled theme URLs + let bundledThemeFilenames = try filemanager.contentsOfDirectory(atPath: bundledThemesURL.path).filter { + $0.contains(".cetheme") + } + let bundledThemeURLs = bundledThemeFilenames.map { + bundledThemesURL.appendingPathComponent($0) + } - // get all filenames in themes folder that end with `.cetheme` - let content = try filemanager.contentsOfDirectory(atPath: url.path).filter { $0.contains(".cetheme") } + // combine user theme URLs with bundled theme URLs + let themeURLs = userDefinedThemeURLs + bundledThemeURLs - let prefs = Settings.shared.preferences - // load each theme from disk - try content.forEach { file in - let fileURL = url.appendingPathComponent(file) - if var theme = try load(from: fileURL) { + let prefs = Settings.shared.preferences - // get all properties of terminal and editor colors - guard let terminalColors = try theme.terminal.allProperties() as? [String: Theme.Attributes], - let editorColors = try theme.editor.allProperties() as? [String: Theme.Attributes] - else { - print("error") - // TODO: Throw a proper error - throw NSError() // swiftlint:disable:this discouraged_direct_init - } + // load each theme from disk and store in memory + try themeURLs.forEach { fileURL in + if var theme = try load(from: fileURL) { - // check if there are any overrides in `settings.json` - if let overrides = prefs.theme.overrides[theme.name]?["terminal"] { - terminalColors.forEach { (key, _) in - if let attributes = overrides[key] { - theme.terminal[key] = attributes + // get all properties of terminal and editor colors + guard let terminalColors = try theme.terminal.allProperties() as? [String: Theme.Attributes], + let editorColors = try theme.editor.allProperties() as? [String: Theme.Attributes] + else { + print("error") + // TODO: Throw a proper error + throw NSError() // swiftlint:disable:this discouraged_direct_init + } + + // check if there are any overrides in `settings.json` + if let overrides = prefs.theme.overrides[theme.name]?["terminal"] { + terminalColors.forEach { (key, _) in + if let attributes = overrides[key] { + theme.terminal[key] = attributes + } } } - } - if let overrides = prefs.theme.overrides[theme.name]?["editor"] { - editorColors.forEach { (key, _) in - if let attributes = overrides[key] { - theme.editor[key] = attributes + + if let overrides = prefs.theme.overrides[theme.name]?["editor"] { + editorColors.forEach { (key, _) in + if let attributes = overrides[key] { + theme.editor[key] = attributes + } } } - } - // add the theme to themes array - self.themes.append(theme) - - // if there already is a selected theme in `settings.json` select this theme - // otherwise take the first in the list - self.selectedDarkTheme = self.darkThemes.first { - $0.name == prefs.theme.selectedDarkTheme - } ?? self.darkThemes.first - - self.selectedLightTheme = self.lightThemes.first { - $0.name == prefs.theme.selectedLightTheme - } ?? self.lightThemes.first - - // For selecting the default theme, doing it correctly on startup requires some more logic - let userSelectedTheme = self.themes.first { $0.name == prefs.theme.selectedTheme } - let systemAppearance = NSAppearance.currentDrawing().name - if userSelectedTheme != nil { - self.selectedTheme = userSelectedTheme - } else { - if systemAppearance == .darkAqua { - self.selectedTheme = self.selectedDarkTheme + // add the theme to themes array + self.themes.append(theme) + + // if there already is a selected theme in `settings.json` select this theme + // otherwise take the first in the list + self.selectedDarkTheme = self.darkThemes.first { + $0.name == prefs.theme.selectedDarkTheme + } ?? self.darkThemes.first + + self.selectedLightTheme = self.lightThemes.first { + $0.name == prefs.theme.selectedLightTheme + } ?? self.lightThemes.first + + // For selecting the default theme, doing it correctly on startup requires some more logic + let userSelectedTheme = self.themes.first { $0.name == prefs.theme.selectedTheme } + let systemAppearance = NSAppearance.currentDrawing().name + + if userSelectedTheme != nil { + self.selectedTheme = userSelectedTheme } else { - self.selectedTheme = self.selectedLightTheme + if systemAppearance == .darkAqua { + self.selectedTheme = self.selectedDarkTheme + } else { + self.selectedTheme = self.selectedLightTheme + } } } } @@ -220,47 +239,11 @@ final class ThemeModel: ObservableObject { } } - private func loadBundledThemes() throws { - let bundledThemeNames: [String] = [ - "Basic", - "Civic", - "Classic (Dark)", - "Classic (Light)", - "Default (Dark)", - "Default (Light)", - "Dusk", - "GitHub (Dark)", - "GitHub (Light)", - "High Contrast (Dark)", - "High Contrast (Light)", - "Low Key", - "Midnight", - "Presentation (Dark)", - "Presentation (Light)", - "Solarized (Dark)", - "Solarized (Light)", - "Sunset" - ] - for themeName in bundledThemeNames { - guard let defaultUrl = Bundle.main.url(forResource: themeName, withExtension: "cetheme") else { - return - } - let json = try Data(contentsOf: defaultUrl) - let jsonObject = try JSONSerialization.jsonObject(with: json) - let prettyJSON = try JSONSerialization.data( - withJSONObject: jsonObject, - options: .prettyPrinted - ) - - try prettyJSON.write(to: themesURL.appendingPathComponent("\(themeName).cetheme"), options: .atomic) - } - } - /// Removes all overrides of the given theme in /// `~/Library/Application Support/CodeEdit/settings.json` /// /// After removing overrides, themes are reloaded - /// from `~/Library/Application Support/CodeEdit/themes`. See ``loadThemes()`` + /// from `~/Library/Application Support/CodeEdit/Themes`. See ``loadThemes()`` /// for more information. /// /// - Parameter theme: The theme to reset @@ -276,7 +259,7 @@ final class ThemeModel: ObservableObject { /// Removes the given theme from `–/Library/Application Support/CodeEdit/themes` /// /// After removing the theme, themes are reloaded - /// from `~/Library/Application Support/CodeEdit/themes`. See ``loadThemes()`` + /// from `~/Library/Application Support/CodeEdit/Themes`. See ``loadThemes()`` /// for more information. /// /// - Parameter theme: The theme to delete @@ -304,7 +287,7 @@ final class ThemeModel: ObservableObject { let url = themesURL themes.forEach { theme in do { - // load the original theme from `~/Library/Application Support/CodeEdit/themes/` + // load the original theme from `~/Library/Application Support/CodeEdit/Themes/` let originalUrl = url.appendingPathComponent(theme.name).appendingPathExtension("cetheme") let originalData = try Data(contentsOf: originalUrl) let originalTheme = try JSONDecoder().decode(Theme.self, from: originalData) diff --git a/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingThemeRow.swift b/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingThemeRow.swift index 34bc988edb..2e1522f3a5 100644 --- a/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingThemeRow.swift +++ b/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingThemeRow.swift @@ -23,7 +23,7 @@ struct ThemeSettingsThemeRow: View { .font(.system(size: 10.5, weight: .bold)) VStack(alignment: .leading) { Text(theme.displayName) - Text("CodeEdit") + Text(theme.author) .foregroundColor(.secondary) .font(.footnote) } diff --git a/CodeEdit/DefaultThemes/Basic.cetheme b/DefaultThemes/Basic.cetheme similarity index 92% rename from CodeEdit/DefaultThemes/Basic.cetheme rename to DefaultThemes/Basic.cetheme index a9b7273923..7d93dcc8e6 100644 --- a/CodeEdit/DefaultThemes/Basic.cetheme +++ b/DefaultThemes/Basic.cetheme @@ -1,7 +1,7 @@ { + "id": "basic", "name": "Basic", - "displayName": "Basic", - "description": "Xcode Basic theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -30,7 +30,7 @@ "color": "#008F00" }, "strings": { - "color": "#A31515" + "color": "#B4261A" }, "characters": { "color": "#000000" @@ -48,13 +48,13 @@ "color": "#02638C" }, "variables": { - "color": "#0F68A0" + "color": "#057CB0" }, "commands": { - "color": "#0F68A0" + "color": "#3495AF" }, "values": { - "color": "#2B839F" + "color": "#3495AF" } }, "terminal": { diff --git a/CodeEdit/DefaultThemes/Civic.cetheme b/DefaultThemes/Civic.cetheme similarity index 97% rename from CodeEdit/DefaultThemes/Civic.cetheme rename to DefaultThemes/Civic.cetheme index 97edf0c017..d2d9fecf6f 100644 --- a/CodeEdit/DefaultThemes/Civic.cetheme +++ b/DefaultThemes/Civic.cetheme @@ -1,7 +1,7 @@ { - "name": "Civic", + "name": "civic", "displayName": "Civic", - "description": "Xcode dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", diff --git a/CodeEdit/DefaultThemes/Classic (Dark).cetheme b/DefaultThemes/Classic (Dark).cetheme similarity index 96% rename from CodeEdit/DefaultThemes/Classic (Dark).cetheme rename to DefaultThemes/Classic (Dark).cetheme index ccaa411294..88bc680600 100644 --- a/CodeEdit/DefaultThemes/Classic (Dark).cetheme +++ b/DefaultThemes/Classic (Dark).cetheme @@ -1,7 +1,7 @@ { - "name": "Classic (Dark)", + "name": "classic.dark", "displayName": "Classic (Dark)", - "description": "Xcode dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", diff --git a/CodeEdit/DefaultThemes/Classic (Light).cetheme b/DefaultThemes/Classic (Light).cetheme similarity index 85% rename from CodeEdit/DefaultThemes/Classic (Light).cetheme rename to DefaultThemes/Classic (Light).cetheme index 05eac34523..d07bb02c3d 100644 --- a/CodeEdit/DefaultThemes/Classic (Light).cetheme +++ b/DefaultThemes/Classic (Light).cetheme @@ -1,7 +1,7 @@ { - "name": "Classic (Light)", + "name": "classic.light", "displayName": "Classic (Light)", - "description": "Xcode light theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#000000" }, "comments": { - "color": "#267507" + "color": "#2D8504" }, "strings": { - "color": "#C41A16" + "color": "#D12F1B" }, "characters": { - "color": "#1C00CF" + "color": "#272AD8" }, "numbers": { - "color": "#1C00CF" + "color": "#272AD8" }, "keywords": { - "color": "#9B2393" + "color": "#AD3DA4" }, "attributes": { - "color": "#815F03" + "color": "#947100" }, "types": { - "color": "#0B4F79" + "color": "#03638C" }, "variables": { - "color": "#0F68A0" + "color": "#057CB0" }, "commands": { - "color": "#326D74" + "color": "#3F8087" }, "values": { - "color": "#6C36A9" + "color": "#804FB8" } }, "terminal": { diff --git a/CodeEdit/DefaultThemes/Default (Dark).cetheme b/DefaultThemes/Default (Dark).cetheme similarity index 71% rename from CodeEdit/DefaultThemes/Default (Dark).cetheme rename to DefaultThemes/Default (Dark).cetheme index 8f23fcdb58..a765d581d2 100644 --- a/CodeEdit/DefaultThemes/Default (Dark).cetheme +++ b/DefaultThemes/Default (Dark).cetheme @@ -1,7 +1,7 @@ { - "name": "Default (Dark)", + "name": "default.dark", "displayName": "Default (Dark)", - "description": "Xcode dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#FFFFFF" }, "comments": { - "color": "#6C7986" + "color": "#7F8C98" }, "strings": { - "color": "#FC6A5D" + "color": "#FF8170" }, "characters": { - "color": "#D0BF69" + "color": "#D9C97C" }, "numbers": { - "color": "#D0BF69" + "color": "#D9C97C" }, "keywords": { - "color": "#FC5FA3" + "color": "#FF7AB2" }, "attributes": { - "color": "#BF8555" + "color": "#CC9768" }, "types": { - "color": "#5DD8FF" + "color": "#6BDFFF" }, "variables": { - "color": "#41A1C0" + "color": "#4EB0CC" }, "commands": { - "color": "#67B7A4" + "color": "#78C2B3" }, "values": { - "color": "#A167E6" + "color": "#B281EB" } }, "terminal": { @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#FF8170" }, "green": { - "color": "#28CD41" + "color": "#78C2B3" }, "yellow": { - "color": "#FFCC00" + "color": "#D9C97C" }, "blue": { - "color": "#007AFF" + "color": "#B281EB" }, "magenta": { - "color": "#AF52DE" + "color": "#FF7AB2" }, "cyan": { - "color": "#59ADC4" + "color": "#4EB0CC" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#FF8170" }, "brightGreen": { - "color": "#28CD41" + "color": "#78C2B3" }, "brightYellow": { - "color": "#FFFF00" + "color": "#D9C97C" }, "brightBlue": { - "color": "#007AFF" + "color": "#B281EB" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#FF7AB2" }, "brightCyan": { - "color": "#55BEF0" + "color": "#4EB0CC" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/Default (Light).cetheme b/DefaultThemes/Default (Light).cetheme similarity index 71% rename from CodeEdit/DefaultThemes/Default (Light).cetheme rename to DefaultThemes/Default (Light).cetheme index 9d96b035a5..9151ec3728 100644 --- a/CodeEdit/DefaultThemes/Default (Light).cetheme +++ b/DefaultThemes/Default (Light).cetheme @@ -1,7 +1,7 @@ { - "name": "Default (Light)", + "name": "default.light", "displayName": "Default (Light)", - "description": "Xcode light theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#000000" }, "comments": { - "color": "#5D6C79" + "color": "#707F8C" }, "strings": { - "color": "#C41A16" + "color": "#D12F1B" }, "characters": { - "color": "#1C00CF" + "color": "#272AD8" }, "numbers": { - "color": "#1C00CF" + "color": "#272AD8" }, "keywords": { - "color": "#9B2393" + "color": "#AD3DA4" }, "attributes": { - "color": "#815F03" + "color": "#947100" }, "types": { - "color": "#0B4F79" + "color": "#02638C" }, "variables": { - "color": "#326D74" + "color": "#057CB0" }, "commands": { - "color": "#6C36A9" + "color": "#3F8087" }, "values": { - "color": "#6C36A9" + "color": "#804FB8" } }, "terminal": { @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#D12F1B" }, "green": { - "color": "#28CD41" + "color": "#3F8087" }, "yellow": { - "color": "#FFCC00" + "color": "#947100" }, "blue": { - "color": "#007AFF" + "color": "#272AD8" }, "magenta": { - "color": "#AF52DE" + "color": "#804FB8" }, "cyan": { - "color": "#59ADC4" + "color": "#02638C" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#D12F1B" }, "brightGreen": { - "color": "#28CD41" + "color": "#3F8087" }, "brightYellow": { - "color": "#FFCC00" + "color": "#947100" }, "brightBlue": { - "color": "#007AFF" + "color": "#272AD8" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#804FB8" }, "brightCyan": { - "color": "#55BEF0" + "color": "#02638C" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/Dusk.cetheme b/DefaultThemes/Dusk.cetheme similarity index 72% rename from CodeEdit/DefaultThemes/Dusk.cetheme rename to DefaultThemes/Dusk.cetheme index 26b11d91a3..3f5a00372e 100644 --- a/CodeEdit/DefaultThemes/Dusk.cetheme +++ b/DefaultThemes/Dusk.cetheme @@ -1,7 +1,7 @@ { - "name": "Dusk", + "name": "dusk", "displayName": "Dusk", - "description": "Xcode dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#FFFFFF" }, "comments": { - "color": "#41B645" + "color": "#4DBF56" }, "strings": { - "color": "#DB2C38" + "color": "#E44448" }, "characters": { - "color": "#786DC4" + "color": "#8B84CF" }, "numbers": { - "color": "#786DC4" + "color": "#8B84CF" }, "keywords": { - "color": "#B21889" + "color": "#C2349B" }, "attributes": { - "color": "#55747C" + "color": "#67878F" }, "types": { - "color": "#5DD8FF" + "color": "#6BDFFF" }, "variables": { - "color": "#41A1C0" + "color": "#4EB0CC" }, "commands": { - "color": "#83C057" + "color": "#93C86A" }, "values": { - "color": "#00A0BE" + "color": "#00AFCA" } }, "terminal": { @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#E44448" }, "green": { - "color": "#28CD41" + "color": "#93C86A" }, "yellow": { "color": "#FFCC00" }, "blue": { - "color": "#007AFF" + "color": "#8B84CF" }, "magenta": { - "color": "#AF52DE" + "color": "#C2349B" }, "cyan": { - "color": "#59ADC4" + "color": "#4EB0CC" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#E44448" }, "brightGreen": { - "color": "#28CD41" + "color": "#93C86A" }, "brightYellow": { - "color": "#FFFF00" + "color": "#FFCC00" }, "brightBlue": { - "color": "#007AFF" + "color": "#8B84CF" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#C2349B" }, "brightCyan": { - "color": "#55BEF0" + "color": "#4EB0CC" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/GitHub (Dark).cetheme b/DefaultThemes/GitHub (Dark).cetheme similarity index 96% rename from CodeEdit/DefaultThemes/GitHub (Dark).cetheme rename to DefaultThemes/GitHub (Dark).cetheme index 9c35d300e1..c44cbd066c 100644 --- a/CodeEdit/DefaultThemes/GitHub (Dark).cetheme +++ b/DefaultThemes/GitHub (Dark).cetheme @@ -1,7 +1,7 @@ { - "name": "GitHub (Dark)", + "name": "github.dark", "displayName": "GitHub (Dark)", - "description": "GitHub dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", diff --git a/CodeEdit/DefaultThemes/GitHub (Light).cetheme b/DefaultThemes/GitHub (Light).cetheme similarity index 96% rename from CodeEdit/DefaultThemes/GitHub (Light).cetheme rename to DefaultThemes/GitHub (Light).cetheme index 189440e17e..284af31207 100644 --- a/CodeEdit/DefaultThemes/GitHub (Light).cetheme +++ b/DefaultThemes/GitHub (Light).cetheme @@ -1,7 +1,7 @@ { - "name": "GitHub (Light)", + "name": "github.light", "displayName": "GitHub (Light)", - "description": "GitHub light theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", diff --git a/CodeEdit/DefaultThemes/High Contrast (Dark).cetheme b/DefaultThemes/High Contrast (Dark).cetheme similarity index 83% rename from CodeEdit/DefaultThemes/High Contrast (Dark).cetheme rename to DefaultThemes/High Contrast (Dark).cetheme index 424f95af72..19900df14e 100644 --- a/CodeEdit/DefaultThemes/High Contrast (Dark).cetheme +++ b/DefaultThemes/High Contrast (Dark).cetheme @@ -1,7 +1,7 @@ { - "name": "High Contrast (Dark)", + "name": "high.contrast.dark", "displayName": "High Contrast (Dark)", - "description": "Xcode dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#FF8A7A" }, "green": { - "color": "#28CD41" + "color": "#8DBF67" }, "yellow": { "color": "#FFCC00" }, "blue": { - "color": "#007AFF" + "color": "#4EC4E6" }, "magenta": { - "color": "#AF52DE" + "color": "#FF85B8" }, "cyan": { - "color": "#59ADC4" + "color": "#6BDFFF" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#FF8A7A" }, "brightGreen": { - "color": "#28CD41" + "color": "#8DBF67" }, "brightYellow": { - "color": "#FFFF00" + "color": "#FFCC00" }, "brightBlue": { - "color": "#007AFF" + "color": "#CDA1FF" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#FF85B8" }, "brightCyan": { - "color": "#55BEF0" + "color": "#4EC4E6" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/High Contrast (Light).cetheme b/DefaultThemes/High Contrast (Light).cetheme similarity index 82% rename from CodeEdit/DefaultThemes/High Contrast (Light).cetheme rename to DefaultThemes/High Contrast (Light).cetheme index 537f98804d..0aa1ab96ba 100644 --- a/CodeEdit/DefaultThemes/High Contrast (Light).cetheme +++ b/DefaultThemes/High Contrast (Light).cetheme @@ -1,7 +1,7 @@ { - "name": "High Contrast (Light)", + "name": "high.contrast.light", "displayName": "High Contrast (Light)", - "description": "Xcode light theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#AD1805" }, "green": { - "color": "#28CD41" + "color": "#1F6300" }, "yellow": { - "color": "#FFCC00" + "color": "#6E5400" }, "blue": { - "color": "#007AFF" + "color": "#272AD8" }, "magenta": { - "color": "#AF52DE" + "color": "#9C2191" }, "cyan": { - "color": "#59ADC4" + "color": "#0058A1" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#AD1805" }, "brightGreen": { - "color": "#28CD41" + "color": "#1F6300" }, "brightYellow": { - "color": "#FFCC00" + "color": "#6E5400" }, "brightBlue": { - "color": "#007AFF" + "color": "#272AD8" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#9C2191" }, "brightCyan": { - "color": "#55BEF0" + "color": "#0058A1" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/Low Key.cetheme b/DefaultThemes/Low Key.cetheme similarity index 72% rename from CodeEdit/DefaultThemes/Low Key.cetheme rename to DefaultThemes/Low Key.cetheme index 131e63fbed..8e2b239af0 100644 --- a/CodeEdit/DefaultThemes/Low Key.cetheme +++ b/DefaultThemes/Low Key.cetheme @@ -1,7 +1,7 @@ { - "name": "Low Key", + "name": "low.key", "displayName": "Low Key", - "description": "Xcode dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#000000" }, "comments": { - "color": "#435138" + "color": "#546348" }, "strings": { - "color": "#702C51" + "color": "#843E64" }, "characters": { - "color": "#262C6A" + "color": "#323E7D" }, "numbers": { - "color": "#262C6A" + "color": "#323E7D" }, "keywords": { - "color": "#262C6A" + "color": "#323E7D" }, "attributes": { - "color": "#1E4D1A" + "color": "#255E22" }, "types": { - "color": "#0B4F79" + "color": "#02638C" }, "variables": { "color": "#0F68A0" }, "commands": { - "color": "#476A97" + "color": "#587EA8" }, "values": { - "color": "#476A97" + "color": "#587EA8" } }, "terminal": { @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#843E64" }, "green": { - "color": "#28CD41" + "color": "#255E22" }, "yellow": { - "color": "#FFCC00" + "color": "#546348" }, "blue": { - "color": "#007AFF" + "color": "#587EA8" }, "magenta": { - "color": "#AF52DE" + "color": "#323E7D" }, "cyan": { - "color": "#59ADC4" + "color": "#02638C" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#843E64" }, "brightGreen": { - "color": "#28CD41" + "color": "#255E22" }, "brightYellow": { - "color": "#FFFF00" + "color": "#546348" }, "brightBlue": { - "color": "#007AFF" + "color": "#587EA8" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#323E7D" }, "brightCyan": { - "color": "#55BEF0" + "color": "#02638C" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/Midnight.cetheme b/DefaultThemes/Midnight.cetheme similarity index 71% rename from CodeEdit/DefaultThemes/Midnight.cetheme rename to DefaultThemes/Midnight.cetheme index 254a910b1f..52547fe47a 100644 --- a/CodeEdit/DefaultThemes/Midnight.cetheme +++ b/DefaultThemes/Midnight.cetheme @@ -1,7 +1,7 @@ { - "name": "Midnight", + "name": "midnight", "displayName": "Midnight", - "description": "Midnight theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#FFFFFF" }, "comments": { - "color": "#41CC45" + "color": "#4BD157" }, "strings": { - "color": "#FF2C38" + "color": "#FF4647" }, "characters": { - "color": "#786DFF" + "color": "#8B87FF" }, "numbers": { - "color": "#786DFF" + "color": "#8B87FF" }, "keywords": { - "color": "#D31895" + "color": "#DE38A6" }, "attributes": { - "color": "#2D449B" + "color": "#3B5AAB" }, "types": { - "color": "#5DD8FF" + "color": "#6BDFFF" }, "variables": { - "color": "#41A1C0" + "color": "#4EB0CC" }, "commands": { - "color": "#23FF83" + "color": "#09FA95" }, "values": { - "color": "#00A0FF" + "color": "#00B1FF" } }, "terminal": { @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#FF4647" }, "green": { - "color": "#28CD41" + "color": "#4BD157" }, "yellow": { - "color": "#FFCC00" + "color": "#EB905A" }, "blue": { - "color": "#007AFF" + "color": "#00B1FF" }, "magenta": { - "color": "#AF52DE" + "color": "#DE38A6" }, "cyan": { - "color": "#59ADC4" + "color": "#6BDFFF" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#FF4647" }, "brightGreen": { - "color": "#28CD41" + "color": "#4BD157" }, "brightYellow": { - "color": "#FFFF00" + "color": "#EB905A" }, "brightBlue": { - "color": "#007AFF" + "color": "#00B1FF" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#DE38A6" }, "brightCyan": { - "color": "#55BEF0" + "color": "#6BDFFF" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/Presentation (Dark).cetheme b/DefaultThemes/Presentation (Dark).cetheme similarity index 71% rename from CodeEdit/DefaultThemes/Presentation (Dark).cetheme rename to DefaultThemes/Presentation (Dark).cetheme index 34a3c716fc..6bb8ef2222 100644 --- a/CodeEdit/DefaultThemes/Presentation (Dark).cetheme +++ b/DefaultThemes/Presentation (Dark).cetheme @@ -1,7 +1,7 @@ { - "name": "Presentation (Dark)", + "name": "presentation.dark", "displayName": "Presentation (Dark)", - "description": "Xcode dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#FFFFFF" }, "comments": { - "color": "#6C7987" + "color": "#7F8C99" }, "strings": { - "color": "#FC4651" + "color": "#FF5F63" }, "characters": { - "color": "#FFE76D" + "color": "#FFEA80" }, "numbers": { - "color": "#FFE76D" + "color": "#FFEA80" }, "keywords": { - "color": "#F2248C" + "color": "#F7439D" }, "attributes": { - "color": "#E09D65" + "color": "#E7AD78" }, "types": { - "color": "#66DAFF" + "color": "#75E1FF" }, "variables": { - "color": "#35B0D8" + "color": "#3EBDE0" }, "commands": { - "color": "#56D0B3" + "color": "#64D7C0" }, "values": { - "color": "#AB64FF" + "color": "#BB81FF" } }, "terminal": { @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#FF5F63" }, "green": { - "color": "#28CD41" + "color": "#64D7C0" }, "yellow": { - "color": "#FFCC00" + "color": "#FFEA80" }, "blue": { - "color": "#007AFF" + "color": "#3EBDE0" }, "magenta": { - "color": "#AF52DE" + "color": "#F7439D" }, "cyan": { - "color": "#59ADC4" + "color": "#75E1FF" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#FF5F63" }, "brightGreen": { - "color": "#28CD41" + "color": "#64D7C0" }, "brightYellow": { - "color": "#FFFF00" + "color": "#FFEA80" }, "brightBlue": { - "color": "#007AFF" + "color": "#3EBDE0" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#F7439D" }, "brightCyan": { - "color": "#55BEF0" + "color": "#75E1FF" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/Presentation (Light).cetheme b/DefaultThemes/Presentation (Light).cetheme similarity index 71% rename from CodeEdit/DefaultThemes/Presentation (Light).cetheme rename to DefaultThemes/Presentation (Light).cetheme index 70723086eb..7cf3a4f06c 100644 --- a/CodeEdit/DefaultThemes/Presentation (Light).cetheme +++ b/DefaultThemes/Presentation (Light).cetheme @@ -1,7 +1,7 @@ { - "name": "Presentation (Light)", + "name": "presentation.light", "displayName": "Presentation (Light)", - "description": "Xcode light theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#000000" }, "comments": { - "color": "#56606B" + "color": "#69737E" }, "strings": { - "color": "#BA0011" + "color": "#C91B13" }, "characters": { - "color": "#000BFF" + "color": "#0435FF" }, "numbers": { - "color": "#000BFF" + "color": "#0435FF" }, "keywords": { - "color": "#B40062" + "color": "#C32275" }, "attributes": { - "color": "#836C28" + "color": "#967E34" }, "types": { - "color": "#004975" + "color": "#005C88" }, "variables": { - "color": "#0F68A0" + "color": "#057CB0" }, "commands": { - "color": "#3B7F89" + "color": "#49919B" }, "values": { - "color": "#5C2699" + "color": "#703DAA" } }, "terminal": { @@ -77,22 +77,22 @@ "color": "#1F2024" }, "red": { - "color": "#FF3B30" + "color": "#C91B13" }, "green": { - "color": "#28CD41" + "color": "#005C88" }, "yellow": { - "color": "#FFCC00" + "color": "#967E34" }, "blue": { - "color": "#007AFF" + "color": "#0435FF" }, "magenta": { - "color": "#AF52DE" + "color": "#C32275" }, "cyan": { - "color": "#59ADC4" + "color": "#49919B" }, "white": { "color": "#D9D9D9" @@ -101,22 +101,22 @@ "color": "#8E8E93" }, "brightRed": { - "color": "#FF3B30" + "color": "#C91B13" }, "brightGreen": { - "color": "#28CD41" + "color": "#005C88" }, "brightYellow": { - "color": "#FFCC00" + "color": "#967E34" }, "brightBlue": { - "color": "#007AFF" + "color": "#0435FF" }, "brightMagenta": { - "color": "#AF52DE" + "color": "#C32275" }, "brightCyan": { - "color": "#55BEF0" + "color": "#49919B" }, "brightWhite": { "color": "#FFFFFF" diff --git a/CodeEdit/DefaultThemes/Solarized (Dark).cetheme b/DefaultThemes/Solarized (Dark).cetheme similarity index 96% rename from CodeEdit/DefaultThemes/Solarized (Dark).cetheme rename to DefaultThemes/Solarized (Dark).cetheme index 99d3220df3..ac3d7afd40 100644 --- a/CodeEdit/DefaultThemes/Solarized (Dark).cetheme +++ b/DefaultThemes/Solarized (Dark).cetheme @@ -1,7 +1,7 @@ { - "name": "Solarized (Dark)", + "name": "solarized.dark", "displayName": "Solarized (Dark)", - "description": "Solarized dark theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", diff --git a/CodeEdit/DefaultThemes/Solarized (Light).cetheme b/DefaultThemes/Solarized (Light).cetheme similarity index 96% rename from CodeEdit/DefaultThemes/Solarized (Light).cetheme rename to DefaultThemes/Solarized (Light).cetheme index 621cc13af1..0ef0d19126 100644 --- a/CodeEdit/DefaultThemes/Solarized (Light).cetheme +++ b/DefaultThemes/Solarized (Light).cetheme @@ -1,7 +1,7 @@ { - "name": "Solarized (Light)", + "name": "solarized.light", "displayName": "Solarized (Light)", - "description": "Solarized light theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", diff --git a/CodeEdit/DefaultThemes/Sunset.cetheme b/DefaultThemes/Sunset.cetheme similarity index 63% rename from CodeEdit/DefaultThemes/Sunset.cetheme rename to DefaultThemes/Sunset.cetheme index 0de40a2fbb..8ef9b74028 100644 --- a/CodeEdit/DefaultThemes/Sunset.cetheme +++ b/DefaultThemes/Sunset.cetheme @@ -1,7 +1,7 @@ { - "name": "Sunset", + "name": "sunset", "displayName": "Sunset", - "description": "Solarized light theme.", + "description": "CodeEdit bundled theme.", "author": "CodeEdit", "version": "0.0.1", "license": "MIT", @@ -27,34 +27,34 @@ "color": "#000000" }, "comments": { - "color": "#C3741C" + "color": "#CF8724" }, "strings": { - "color": "#DF0700" + "color": "#E82300" }, "characters": { - "color": "#294277" + "color": "#35568A" }, "numbers": { - "color": "#294277" + "color": "#35568A" }, "keywords": { - "color": "#294277" + "color": "#35568A" }, "attributes": { - "color": "#2C329D" + "color": "#3A48AD" }, "types": { - "color": "#0B4F79" + "color": "#02638C" }, "variables": { - "color": "#0F68A0" + "color": "#057CB0" }, "commands": { - "color": "#476A97" + "color": "#587EA8" }, "values": { - "color": "#476A97" + "color": "#587EA8" } }, "terminal": { @@ -64,62 +64,62 @@ "selection": { "color": "#FBE4AC" }, - "insertionPoint": { + "cursor": { "color": "#000000" }, "text": { - "color": "#657B83" + "color": "#000000" }, "boldText": { - "color": "#586E75" + "color": "#000000" }, "black": { - "color": "#073642" + "color": "#000000" }, "red": { - "color": "#DC322F" + "color": "#E82300" }, "green": { - "color": "#859900" + "color": "#02638C" }, "yellow": { - "color": "#B58900" + "color": "#CF8724" }, "blue": { - "color": "#268BD2" + "color": "#35568A" }, "magenta": { - "color": "#D33682" + "color": "#3A48AD" }, "cyan": { - "color": "#2AA198" + "color": "#587EA8" }, "white": { - "color": "#EEE8D5" + "color": "#FFFFFF" }, "brightBlack": { - "color": "#002B36" + "color": "#000000" }, "brightRed": { - "color": "#CB4B16" + "color": "#E82300" }, "brightGreen": { - "color": "#586E75" + "color": "#02638C" }, "brightYellow": { - "color": "#657B83" + "color": "#CF8724" }, "brightBlue": { - "color": "#839496" + "color": "#35568A" }, "brightMagenta": { - "color": "#6C71C4" + "color": "#3A48AD" }, "brightCyan": { - "color": "#93A1A1" + "color": "#587EA8" }, "brightWhite": { - "color": "#FDF6E3" + "color": "#FFFFFF" } } }