Changed the appearance of the toolbar buttons.
authorWilliam Reynish <william@reynish.com>
Wed, 18 Nov 2009 10:57:30 +0000 (10:57 +0000)
committerWilliam Reynish <william@reynish.com>
Wed, 18 Nov 2009 10:57:30 +0000 (10:57 +0000)
When stacked on top of each other, it looks cleaner and simpler without the gradient.
This makes it easier to scan through long lists of tools.

http://www.reynish.com/files/blender25/toolbar_buttons.png

release/scripts/ui/space_userpref.py
release/scripts/ui/space_view3d_toolbar.py
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 d6982db4fd0fe85dc52b843c4781c9cc2f32902f..040a89251c10113fa6d4e49b42a832e2cdb9a946 100644 (file)
@@ -34,7 +34,7 @@ class USERPREF_HT_header(bpy.types.Header):
 
         if userpref.active_section == 'INPUT':
             layout.operator_context = 'INVOKE_DEFAULT'
-            layout.item_stringO("wm.keyconfig_export", "path", "keymap.py", "Export Key Configuration...")
+            layout.itemO("wm.keyconfig_export", "Export Key Configuration...")
 
 
 class USERPREF_MT_view(bpy.types.Menu):
@@ -441,7 +441,27 @@ class USERPREF_PT_theme(bpy.types.Panel):
             sub2.active = ui.shaded
             sub2.itemR(ui, "shadetop")
             sub2.itemR(ui, "shadedown")
+            
+            ui = theme.user_interface.wcol_toolbar
+            layout.itemL(text="Toolbar:")
 
+            sub = layout.row()
+            sub1 = sub.column()
+            sub1.itemR(ui, "outline")
+            sub1.itemR(ui, "item", slider=True)
+            sub1 = sub.column()
+            sub1.itemR(ui, "inner", slider=True)
+            sub1.itemR(ui, "inner_sel", slider=True)
+            sub1 = sub.column()
+            sub1.itemR(ui, "text")
+            sub1.itemR(ui, "text_sel")
+            sub1 = sub.column()
+            sub1.itemR(ui, "shaded")
+            sub2 = sub1.column(align=True)
+            sub2.active = ui.shaded
+            sub2.itemR(ui, "shadetop")
+            sub2.itemR(ui, "shadedown")
+            
             ui = theme.user_interface.wcol_radio
             layout.itemL(text="Radio Buttons:")
 
index 444525db355fc78e72603bbc79f501a330ba2c22..5f44f253f2f4b2b64b28a0f7dce2413e05ca8ecb 100644 (file)
@@ -52,15 +52,13 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
 
             col = layout.column(align=True)
             col.itemL(text="Shading:")
-            row = col.row()
-            row.itemO("object.shade_smooth", text="Smooth")
-            row.itemO("object.shade_flat", text="Flat")
+            col.itemO("object.shade_smooth", text="Smooth")
+            col.itemO("object.shade_flat", text="Flat")
 
         col = layout.column(align=True)
         col.itemL(text="Keyframes:")
-        row = col.row()
-        row.itemO("anim.insert_keyframe_menu", text="Insert")
-        row.itemO("anim.delete_keyframe_v3d", text="Remove")
+        col.itemO("anim.insert_keyframe_menu", text="Insert")
+        col.itemO("anim.delete_keyframe_v3d", text="Remove")
 
         col = layout.column(align=True)
         col.itemL(text="Repeat:")
@@ -131,9 +129,8 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
         
         col = layout.column(align=True)
         col.itemL(text="Shading:")
-        row = col.row()
-        row.itemO("mesh.faces_shade_smooth", text="Smooth")
-        row.itemO("mesh.faces_shade_flat", text="Flat")
+        col.itemO("mesh.faces_shade_smooth", text="Smooth")
+        col.itemO("mesh.faces_shade_flat", text="Flat")
         
         col = layout.column(align=True)
         col.itemL(text="Repeat:")
@@ -272,11 +269,6 @@ class VIEW3D_PT_tools_textedit(View3DPanel):
         col.itemO("font.text_cut", text="Cut")
         col.itemO("font.text_paste", text="Paste")
         
-        col = layout.column(align=True)
-        col.itemL(text="Repeat:")
-        col.itemO("screen.repeat_last")
-        col.itemO("screen.repeat_history", text="History...")
-        
         col = layout.column(align=True)
         col.itemL(text="Set Case:")
         col.item_enumO("font.case_set", "case", 'UPPER', text="To Upper")
@@ -287,6 +279,11 @@ class VIEW3D_PT_tools_textedit(View3DPanel):
         col.item_enumO("font.style_toggle", "style", 'BOLD')
         col.item_enumO("font.style_toggle", "style", 'ITALIC')
         col.item_enumO("font.style_toggle", "style", 'UNDERLINE')
+        
+        col = layout.column(align=True)
+        col.itemL(text="Repeat:")
+        col.itemO("screen.repeat_last")
+        col.itemO("screen.repeat_history", text="History...")
 
 
 # ********** default tools for editmode_armature ****************
@@ -441,9 +438,9 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
 
         col = layout.column(align=True)
         col.itemL(text="Keyframes:")
-        row = col.row()
-        row.itemO("anim.insert_keyframe_menu", text="Insert")
-        row.itemO("anim.delete_keyframe_v3d", text="Remove")
+        
+        col.itemO("anim.insert_keyframe_menu", text="Insert")
+        col.itemO("anim.delete_keyframe_v3d", text="Remove")
 
         col = layout.column(align=True)
         col.itemL(text="Repeat:")
index 3c3b289a945822759108b26ed6a0ca5987c4aece..bf2f7fac3ee29600929cdebab37c0e09449d1ee2 100644 (file)
@@ -63,6 +63,7 @@ typedef enum {
        UI_WTYPE_NUMBER,
        UI_WTYPE_SLIDER,
        UI_WTYPE_EXEC,
+       UI_WTYPE_TOOL,
        
        /* strings */
        UI_WTYPE_NAME,
index 649b19e20899ac392eeac3a58bdf70c64360181c..ec253c691cc0fc5cd7e8547e06e18b2e833c4934 100644 (file)
@@ -1153,9 +1153,10 @@ static struct uiWidgetColors wcol_radio= {
        15, -15
 };
 
-static struct uiWidgetColors wcol_regular= {
+// buttons in the toolbar
+static struct uiWidgetColors wcol_toolbar= {
        {25, 25, 25, 255},
-       {153, 153, 153, 255},
+       {140, 140, 140, 255},
        {100, 100, 100, 255},
        {25, 25, 25, 255},
        
@@ -1166,6 +1167,7 @@ static struct uiWidgetColors wcol_regular= {
        0, 0
 };
 
+// other action buttons
 static struct uiWidgetColors wcol_tool= {
        {25, 25, 25, 255},
        {153, 153, 153, 255},
@@ -1249,8 +1251,9 @@ static struct uiWidgetColors wcol_tmp= {
 /* called for theme init (new theme) and versions */
 void ui_widget_color_init(ThemeUI *tui)
 {
-       tui->wcol_regular= wcol_regular;
+       tui->wcol_regular= wcol_toggle;
        tui->wcol_tool= wcol_tool;
+       tui->wcol_toolbar= wcol_toolbar;
        tui->wcol_text= wcol_text;
        tui->wcol_radio= wcol_radio;
        tui->wcol_option= wcol_option;
@@ -2277,6 +2280,11 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
                        wt.wcol_theme= &btheme->tui.wcol_tool;
                        wt.draw= widget_roundbut;
                        break;
+          
+          case UI_WTYPE_TOOL:
+                       wt.wcol_theme= &btheme->tui.wcol_toolbar;
+                       wt.draw= widget_roundbut;
+                       break;
                        
                        
                        /* strings */
@@ -2450,10 +2458,13 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
                                break;
                                
                        case BUT:
-                               wt= widget_type(UI_WTYPE_EXEC);
                                if (!(but->flag & UI_HAS_ICON)) {
+                                   wt= widget_type(UI_WTYPE_TOOL);
                                        but->flag |= UI_TEXT_LEFT;
                                }
+                               else {
+                               wt= widget_type(UI_WTYPE_EXEC);
+                               }
                                break;
 
                        case NUM:
index b70d3786eae7746015ae73804f5deaa3fb7f66ab..1ab3753e4d851a6d47608e6fa4ec089746147420 100644 (file)
@@ -135,7 +135,7 @@ typedef struct uiWidgetStateColors {
 typedef struct ThemeUI {
        
        /* Interface Elements (buttons, menus, icons) */
-       uiWidgetColors wcol_regular, wcol_tool, wcol_text;
+       uiWidgetColors wcol_regular, wcol_tool, wcol_text, wcol_toolbar;
        uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
        uiWidgetColors wcol_num, wcol_numslider;
        uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item;
index c9056e386ac6fedf7f6978d4a826dc903c0e61fa..79974753e9b4d058030b79be3f87e4f5e42c7895 100644 (file)
@@ -380,6 +380,13 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
        
+       prop= RNA_def_property(srna, "wcol_toolbar", PROP_POINTER, PROP_NONE);
+       RNA_def_property_flag(prop, PROP_NEVER_NULL);
+       RNA_def_property_pointer_sdna(prop, NULL, "wcol_toolbar");
+       RNA_def_property_struct_type(prop, "ThemeWidgetColors");
+       RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
+       
        prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");