2.5
Added new widget type in drawing and themes: "Box Backdrop", which is in use by modifiers. Allows alpha blend, shade, etc. It was using the general button theme for standard buttons still, to indicate this change I made it a bit darker. Matt/Bill are invited to tweak this default color :)
This commit is contained in:
@@ -77,7 +77,8 @@ typedef enum {
|
||||
UI_WTYPE_ICON,
|
||||
UI_WTYPE_SWATCH,
|
||||
UI_WTYPE_RGB_PICKER,
|
||||
UI_WTYPE_NORMAL
|
||||
UI_WTYPE_NORMAL,
|
||||
UI_WTYPE_BOX
|
||||
|
||||
} uiWidgetTypeEnum;
|
||||
|
||||
|
||||
@@ -1054,6 +1054,20 @@ static struct uiWidgetColors wcol_tool= {
|
||||
25, -25
|
||||
};
|
||||
|
||||
static struct uiWidgetColors wcol_box= {
|
||||
{25, 25, 25, 255},
|
||||
{128, 128, 128, 255},
|
||||
{100, 100, 100, 255},
|
||||
{25, 25, 25, 255},
|
||||
|
||||
{0, 0, 0, 255},
|
||||
{255, 255, 255, 255},
|
||||
|
||||
0,
|
||||
0, 0
|
||||
};
|
||||
|
||||
|
||||
/* called for theme init (new theme) and versions */
|
||||
void ui_widget_color_init(ThemeUI *tui)
|
||||
{
|
||||
@@ -1069,6 +1083,7 @@ void ui_widget_color_init(ThemeUI *tui)
|
||||
tui->wcol_pulldown= wcol_pulldown;
|
||||
tui->wcol_menu_back= wcol_menu_back;
|
||||
tui->wcol_menu_item= wcol_menu_item;
|
||||
tui->wcol_box= wcol_box;
|
||||
|
||||
tui->iconfile[0]= 0;
|
||||
}
|
||||
@@ -1700,6 +1715,10 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
|
||||
wt.custom= widget_swatch;
|
||||
break;
|
||||
|
||||
case UI_WTYPE_BOX:
|
||||
wt.wcol_theme= &btheme->tui.wcol_box;
|
||||
break;
|
||||
|
||||
case UI_WTYPE_RGB_PICKER:
|
||||
break;
|
||||
|
||||
@@ -1842,7 +1861,11 @@ void ui_draw_but(ARegion *ar, uiStyle *style, uiBut *but, rcti *rect)
|
||||
case COL:
|
||||
wt= widget_type(UI_WTYPE_SWATCH);
|
||||
break;
|
||||
|
||||
|
||||
case ROUNDBOX:
|
||||
wt= widget_type(UI_WTYPE_BOX);
|
||||
break;
|
||||
|
||||
// XXX four old button types
|
||||
case HSVCUBE:
|
||||
ui_draw_but_HSVCUBE(but, rect);
|
||||
|
||||
@@ -124,6 +124,7 @@ typedef struct ThemeUI {
|
||||
uiWidgetColors wcol_regular, wcol_tool, wcol_radio, wcol_text, wcol_option;
|
||||
uiWidgetColors wcol_num, wcol_numslider;
|
||||
uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item;
|
||||
uiWidgetColors wcol_box;
|
||||
|
||||
char iconfile[80]; // FILE_MAXFILE length
|
||||
|
||||
|
||||
@@ -291,6 +291,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
|
||||
RNA_def_property_update(prop, NC_WINDOW, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
|
||||
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
|
||||
RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
|
||||
RNA_def_property_update(prop, NC_WINDOW, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
|
||||
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
|
||||
|
||||
Reference in New Issue
Block a user