From e6cf350906672632be301c18e677a6805ef6aa31 Mon Sep 17 00:00:00 2001 From: LEO Yoon-Tsaw Date: Fri, 17 May 2024 22:08:52 -0400 Subject: [PATCH] Fix a bug that when loading new style, old one will have leftover --- Squirrel.xcodeproj/project.pbxproj | 4 ++-- sources/SquirrelPanel.swift | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Squirrel.xcodeproj/project.pbxproj b/Squirrel.xcodeproj/project.pbxproj index 9b9449293..0d6591db9 100644 --- a/Squirrel.xcodeproj/project.pbxproj +++ b/Squirrel.xcodeproj/project.pbxproj @@ -592,7 +592,7 @@ CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.99.4; + CURRENT_PROJECT_VERSION = 0.99.5; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -648,7 +648,7 @@ CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 0.99.4; + CURRENT_PROJECT_VERSION = 0.99.5; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/sources/SquirrelPanel.swift b/sources/SquirrelPanel.swift index 422cb3c1d..6f02e7a1a 100644 --- a/sources/SquirrelPanel.swift +++ b/sources/SquirrelPanel.swift @@ -285,8 +285,13 @@ final class SquirrelPanel: NSPanel { } func load(config: SquirrelConfig, forDarkMode isDark: Bool) { - let theme = isDark ? view.darkTheme : view.lightTheme - theme.load(config: config, dark: isDark) + if isDark { + view.darkTheme = SquirrelTheme() + view.darkTheme.load(config: config, dark: true) + } else { + view.lightTheme = SquirrelTheme() + view.lightTheme.load(config: config, dark: isDark) + } } }