UI: Add popup layout panels sub brackground color #119803
|
@ -245,6 +245,7 @@ const bTheme U_theme_default = {
|
|||
.icon_shading = RGBA(0xcc6670ff),
|
||||
.icon_folder = RGBA(0xccad63ff),
|
||||
.panel_roundness = 0.4f,
|
||||
.popup_panel_sub_back = RGBA(0x41403D1E),
|
||||
},
|
||||
.space_properties = {
|
||||
.back = RGBA(0x30303000),
|
||||
|
|
|
@ -1010,6 +1010,7 @@ class USERPREF_PT_theme_interface_styles(ThemePanel, CenterAlignMixIn, Panel):
|
|||
col.prop(ui, "editor_outline")
|
||||
col.prop(ui, "widget_emboss")
|
||||
col.prop(ui, "panel_roundness")
|
||||
col.prop(ui, "popup_panel_sub_back")
|
||||
|
||||
|
||||
class USERPREF_PT_theme_interface_transparent_checker(ThemePanel, CenterAlignMixIn, Panel):
|
||||
|
|
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
|
||||
/* Blender file format version. */
|
||||
#define BLENDER_FILE_VERSION BLENDER_VERSION
|
||||
#define BLENDER_FILE_SUBVERSION 12
|
||||
#define BLENDER_FILE_SUBVERSION 13
|
||||
|
||||
/* 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
|
||||
|
|
|
@ -140,6 +140,10 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
|
|||
FROM_DEFAULT_V4_UCHAR(space_view3d.face_mode_select);
|
||||
}
|
||||
|
||||
if (!USER_VERSION_ATLEAST(402, 13)) {
|
||||
FROM_DEFAULT_V4_UCHAR(tui.popup_panel_sub_back);
|
||||
}
|
||||
|
||||
/**
|
||||
* Always bump subversion in BKE_blender_version.h when adding versioning
|
||||
* code here, and wrap it inside a USER_VERSION_ATLEAST check.
|
||||
|
|
|
@ -354,6 +354,8 @@ enum ThemeColorID {
|
|||
|
||||
TH_EDGE_BEVEL,
|
||||
TH_VERTEX_BEVEL,
|
||||
|
||||
TH_POPUP_PANEL_SUB_BACK,
|
||||
};
|
||||
|
||||
/* Specific defines per space should have higher define values. */
|
||||
|
|
|
@ -2098,8 +2098,9 @@ void UI_block_draw(const bContext *C, uiBlock *block)
|
|||
}
|
||||
/* Shared layout panel backdrop style between redo region and popups. */
|
||||
if (block->panel && ELEM(region->regiontype, RGN_TYPE_HUD, RGN_TYPE_TEMPORARY)) {
|
||||
/* TODO: Add as theme color. */
|
||||
float subpanel_backcolor[4]{0.2f, 0.3f, 0.33f, 0.05f};
|
||||
float subpanel_backcolor[4];
|
||||
UI_GetThemeColor4fv(TH_POPUP_PANEL_SUB_BACK, subpanel_backcolor);
|
||||
|
||||
const bTheme *btheme = UI_GetTheme();
|
||||
const float aspect = block->panel->runtime->block->aspect;
|
||||
const float radius = btheme->tui.panel_roundness * U.widget_unit * 0.5f / aspect;
|
||||
|
|
|
@ -1057,6 +1057,8 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
|
|||
case TH_V3D_CLIPPING_BORDER:
|
||||
cp = ts->clipping_border_3d;
|
||||
break;
|
||||
case TH_POPUP_PANEL_SUB_BACK:
|
||||
cp = btheme->tui.popup_panel_sub_back;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ typedef struct ThemeUI {
|
|||
* icons. */
|
||||
float icon_border_intensity;
|
||||
float panel_roundness;
|
||||
char _pad2[4];
|
||||
unsigned char popup_panel_sub_back[4];
|
||||
|
||||
} ThemeUI;
|
||||
|
||||
|
|
|
@ -1940,6 +1940,14 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
|
|||
prop, "Icon Border", "Control the intensity of the border around themes icons");
|
||||
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 2);
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_theme_update_icons");
|
||||
|
||||
prop = RNA_def_property(srna, "popup_panel_sub_back", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "popup_panel_sub_back");
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Popup layout panel sub background",
|
||||
"Color of layout panels sub background in popups");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
|
||||
}
|
||||
|
||||
static void rna_def_userdef_theme_space_common(StructRNA *srna)
|
||||
|
|
Loading…
Reference in New Issue