From 8d2a0d9b4cc3d08e0b58bf5acd27388fc34ae639 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 5 Nov 2021 18:46:00 +0100 Subject: UI: Apply recent theme fixes for Preferences saved in 3.1 builds Followup to e65230f0c03c. Pablo and I decided it's fine to reset themes again when saved with the recent 3.1 builds. This needed to be done a bit careful, since a normal version patch resetting the theme would've reset the theme for anybody opening preferences of a 3.0 build (even the final release build) in a 3.1 build. So make sure the theme is at least from a 3.1 build (but not newer then this commit of course). --- source/blender/blenloader/intern/versioning_userdef.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/versioning_userdef.c') diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index 473a7e413ce..2d5d6479234 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -321,11 +321,16 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme) btheme->space_node.grid_levels = 7; } - if (!USER_VERSION_ATLEAST(300, 40)) { + if (!USER_VERSION_ATLEAST(300, 41)) { memcpy(btheme, &U_theme_default, sizeof(*btheme)); } - if (!USER_VERSION_ATLEAST(300, 41)) { + /* Again reset the theme, but only if stored with an early 3.1 alpha version. Some changes were + * done in the release branch and then merged into the 3.1 branch (master). So the previous reset + * wouldn't work for people who saved their preferences with a 3.1 build meanwhile. But we still + * don't want to reset theme changes stored in the eventual 3.0 release once opened in a 3.1 + * build. */ + if (userdef->versionfile > 300 && !USER_VERSION_ATLEAST(301, 1)) { memcpy(btheme, &U_theme_default, sizeof(*btheme)); } -- cgit v1.2.3