From b3101aba6a09b5b0ee018a546733af83a566b557 Mon Sep 17 00:00:00 2001 From: Jonathan Williamson Date: Sat, 4 Jan 2014 13:54:39 -0600 Subject: Make Toolbar Tabs more readable This makes the tabs slightly larger, increases the text size slightly, and adjusts the colors a bit to improve overall contrast. It also makes inactive tabs draw with a full tab shape, improving the readability at a glance, particularly when tabs are very small. The users most affected will be those on smaller displays, where previously tabs were very difficult to read. Reviewers: @billrey, @campbellbarton Differential Revision: https://developer.blender.org/D170 --- source/blender/editors/include/UI_interface.h | 2 +- source/blender/editors/interface/interface_panel.c | 23 +++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 10a4b383694..d3b822950b5 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -177,7 +177,7 @@ enum { #define UI_PANEL_WIDTH 340 #define UI_COMPACT_PANEL_WIDTH 160 -#define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 0.9f) +#define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f) /* but->drawflag - these flags should only affect how the button is drawn. */ /* Note: currently, these flags _are not passed_ to the widget's state() or draw() functions diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 22191d023f7..1213598c045 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1384,7 +1384,7 @@ static void ui_panel_category_draw_tab(int mode, float minx, float miny, float m void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) { /* no tab outlines for */ -#define USE_FLAT_INACTIVE +// #define USE_FLAT_INACTIVE View2D *v2d = &ar->v2d; uiStyle *style = UI_GetStyle(); const uiFontStyle *fstyle = &style->widget; @@ -1407,7 +1407,7 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) #endif float scaletabs = 1.0f; /* same for all tabs */ - const int rct_xmin = v2d->mask.xmin + (3 * px); + const int rct_xmin = v2d->mask.xmin + 3; const int rct_xmax = v2d->mask.xmin + category_tabs_width; const int text_v_ofs = (rct_xmax - rct_xmin) * 0.3f; @@ -1431,9 +1431,8 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) UI_GetThemeColor4ubv(TH_TEXT, theme_col_text); UI_GetThemeColor4ubv(TH_TEXT_HI, theme_col_text_hi); - - blend_color_interpolate_byte(theme_col_tab_bg, theme_col_back, theme_col_text, 0.12f); - blend_color_interpolate_byte(theme_col_tab_inactive, theme_col_back, theme_col_text, 0.1f); + blend_color_interpolate_byte(theme_col_tab_bg, theme_col_back, theme_col_text, 0.2f); + blend_color_interpolate_byte(theme_col_tab_inactive, theme_col_back, theme_col_text, 0.10f); blend_color_interpolate_byte(theme_col_tab_outline, theme_col_back, theme_col_text, 0.3f); blend_color_interpolate_byte(theme_col_tab_divider, theme_col_back, theme_col_text, 0.3f); @@ -1448,7 +1447,7 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) BLF_rotation(fontid, M_PI / 2); //uiStyleFontSet(&style->widget); ui_fontscale(&fstyle_points, aspect); - BLF_size(fontid, (fstyle_points * U.pixelsize), U.dpi); + BLF_size(fontid, (fstyle_points * U.pixelsize * 1.1), U.dpi); BLI_assert(UI_panel_category_is_visible(ar)); @@ -1541,9 +1540,19 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) BLF_position(fontid, rct->xmax - text_v_ofs, rct->ymin + tab_v_pad_text, 0.0f); - glColor3ubv(theme_col_text); + /* tab titles */ + { + glColor3ubv(theme_col_text); + /* draw white shadow to give text more depth */ + BLF_enable(fontid, BLF_SHADOW); + BLF_shadow(fontid, 3, 1.0f, 1.0f, 1.0f, 0.25f); + BLF_shadow_offset(fontid, -1, -1); + } + + BLF_draw(fontid, category_id_draw, category_draw_len); + glDisable(GL_BLEND); /* tab blackline remaining (last tab) */ -- cgit v1.2.3