Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Williamson <jonathan@cgcookie.com>2014-01-04 23:54:39 +0400
committerJonathan Williamson <jonathan@cgcookie.com>2014-01-14 06:25:40 +0400
commitb3101aba6a09b5b0ee018a546733af83a566b557 (patch)
tree88007cd08bca0fb887a5baadd79eafcabce05be6 /source/blender/editors/interface
parent5611fb6a32551d36ebf11e71f4b76559044a2e2c (diff)
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
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_panel.c23
1 files changed, 16 insertions, 7 deletions
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) */