Blender UI problems with certain theme files
Closed, ResolvedPublic

Description

In 2.8 if you use certain theme options (e.g.,

) the panel headers is really wrong:

Expected results:

The white text is probably only needing to replace some glColor calls with BLF_color (e.g., see rB19b3b11c64). The icon not showing, and the other changes may be more involving.

For a related triangle commit, see: rB6906a884ee and rb6906a884ee

Details

Type
Bug

@Germano Cavalcante (mano-wii) in case you are having trouble finding which files to tackle, those bugs are extremely important.

Just adding some information:
The problem is that the theme setting for TITLE (RGB) is being considered RGBA and setting the alpha to 0 instead of 255;

The real question is how to get a theme like that. If the property alpha of the title needs to be changed, I suggest change the array_length to 4:

@@ -1088,11 +1088,11 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
 static void rna_def_userdef_theme_space_common(StructRNA *srna)
 {
 	PropertyRNA *prop;
 
 	prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
-	RNA_def_property_array(prop, 3);
+	RNA_def_property_array(prop, 4);
 	RNA_def_property_ui_text(prop, "Title", "");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
 
 	prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
 	RNA_def_property_array(prop, 3);

The reason for the breakage is that, before 2.8, the functions that searched for the ThemeColor of TH_TITLE were 3ubv:

void UI_ThemeColor(int colorid)
{
	const unsigned char *cp;
	
	cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
	glColor3ubv(cp);

}

Now in 2.8 the functions that are looking for the ThemeColor of TH_TITLE are 4ubv:

UI_GetThemeColor4ubv(TH_TITLE, col_title);