Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2009-06-01 15:31:06 +0400
committerTon Roosendaal <ton@blender.org>2009-06-01 15:31:06 +0400
commit41963d9e4e04e481aad99a9b24ddebd9a198b30d (patch)
tree8ae8bee1925645cd892bc3e118ea0fe306ddffe7 /source
parent934e3ddf0db87a489b66a4066cf2223e8fd3cbde (diff)
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 :)
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_intern.h3
-rw-r--r--source/blender/editors/interface/interface_widgets.c25
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c6
4 files changed, 33 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 090c0313dae..25a1dbe3d62 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -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;
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 08502befddf..f4e3a7f2899 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -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);
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index c7a74fe5358..022e1cef840 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -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
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index e90979b8321..6376a3029ad 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -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");