2.5
authorTon Roosendaal <ton@blender.org>
Mon, 1 Jun 2009 11:31:06 +0000 (11:31 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 1 Jun 2009 11:31:06 +0000 (11:31 +0000)
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 :)

source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_widgets.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index 090c0313dae269ec0b551a904017a949b8a8c7b3..25a1dbe3d6221a73d799521e453fe860cade6610 100644 (file)
@@ -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;
 
index 08502befddf3988c7bd755fc3e1aadac6e30b693..f4e3a7f289985628f20a72d484796c6d372c6279 100644 (file)
@@ -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);
index c7a74fe5358b3a6e994d9ac65e9ddb7d3a452dc9..022e1cef840b39d3d7fc4638d81c8e9c0c55828f 100644 (file)
@@ -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
        
index e90979b83217102388dea442cd157df681d89649..6376a3029ad0a787fdce8030b903fb6e8fa37f4f 100644 (file)
@@ -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");