From b1a5ba6804865ef0ae0790e87d9c68b6b6557e4a Mon Sep 17 00:00:00 2001 From: William Reynish Date: Wed, 18 Nov 2009 10:57:30 +0000 Subject: [PATCH] Changed the appearance of the toolbar buttons. 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 | 22 ++++++++++++- release/scripts/ui/space_view3d_toolbar.py | 31 +++++++++---------- .../editors/interface/interface_intern.h | 1 + .../editors/interface/interface_widgets.c | 19 +++++++++--- source/blender/makesdna/DNA_userdef_types.h | 2 +- source/blender/makesrna/intern/rna_userdef.c | 7 +++++ 6 files changed, 59 insertions(+), 23 deletions(-) diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index d6982db4fd0..040a89251c1 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -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:") diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index 444525db355..5f44f253f2f 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -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:") diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 3c3b289a945..bf2f7fac3ee 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -63,6 +63,7 @@ typedef enum { UI_WTYPE_NUMBER, UI_WTYPE_SLIDER, UI_WTYPE_EXEC, + UI_WTYPE_TOOL, /* strings */ UI_WTYPE_NAME, diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 649b19e2089..ec253c691cc 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -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: diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b70d3786eae..1ab3753e4d8 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -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; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index c9056e386ac..79974753e9b 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -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");