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
This commit is contained in:
William Reynish 2009-11-18 10:57:30 +00:00
parent 849ee94cf9
commit b1a5ba6804
6 changed files with 59 additions and 23 deletions

@ -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:")

@ -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:")

@ -63,6 +63,7 @@ typedef enum {
UI_WTYPE_NUMBER,
UI_WTYPE_SLIDER,
UI_WTYPE_EXEC,
UI_WTYPE_TOOL,
/* strings */
UI_WTYPE_NAME,

@ -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:

@ -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;

@ -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");