Fix #141889: Broken themes in 5.0

Blender 5.0 got a theme overhaul, removing hundreds of options and
adding some more. While versioning was attempted to keep themes
looking as close as possible, some settings are impossible to guess
so they require manual editing.

Reset the theme to the default. Similarly to how it was done in other
major overhauls (2.80, 3.0).

Documentation and tools to migrate themes will be available at:
https://developer.blender.org/docs/release_notes/5.0/user_interface/

Pull Request: https://projects.blender.org/blender/blender/pulls/147637
This commit is contained in:
Pablo Vazquez
2025-10-17 18:50:29 +02:00
committed by Pablo Vazquez
parent 316fe67295
commit 829c6a7b98
3 changed files with 30 additions and 10 deletions

View File

@@ -27,7 +27,7 @@
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 110
#define BLENDER_FILE_SUBVERSION 111
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and cancel loading the file, showing a warning to

View File

@@ -390,6 +390,26 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
FROM_DEFAULT_V4_UCHAR(common.anim.scene_strip_range);
}
/* Reset the theme due to compatibility breaking changes in 5.0. */
if (!USER_VERSION_ATLEAST(500, 111)) {
MEMCPY_STRUCT_AFTER(btheme, &U_theme_default, name);
/* Update text styles to match. */
LISTBASE_FOREACH (uiStyle *, style, &userdef->uistyles) {
style->paneltitle.points = 11.0f;
style->paneltitle.shadow = 3;
style->paneltitle.shadowalpha = 0.5f;
style->paneltitle.shadowcolor = 0.0f;
style->widget.points = 11.0f;
style->widget.shadow = 1;
style->widget.shadowalpha = 0.5f;
style->widget.shadowcolor = 0.0f;
style->tooltip.shadow = 1;
style->tooltip.points = 11.0f;
style->tooltip.shadowalpha = 0.5f;
style->tooltip.shadowcolor = 0.0f;
}
}
/**
* Always bump subversion in BKE_blender_version.h when adding versioning
* code here, and wrap it inside a USER_VERSION_ATLEAST check.