[Bf-blender-cvs] [be5482ba2fa] blender2.8: UI: Dim color of shortcut label in menus and toolbar

Julian Eisel noreply at git.blender.org
Tue Jul 3 00:56:23 CEST 2018


Commit: be5482ba2fa788279434f46eacf504821d1c6223
Author: Julian Eisel
Date:   Tue Jul 3 00:46:02 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBbe5482ba2fa788279434f46eacf504821d1c6223

UI: Dim color of shortcut label in menus and toolbar

The shortcut labels now use the "Item" theme color. Its contrast for hovered
items is a bit low, but not too bad.

Note that this also changes the color of the little toolbar triangle to be grey
(the same color we use for the keymap label). IMHO that looks better though.
This doesn't update any themes other than the default one.

Part of T54711.

===================================================================

M	release/datafiles/userdef/userdef_default_theme.c
M	source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index 6e2678fe9f2..aea7e40573a 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -43,7 +43,7 @@ const bTheme U_theme_default = {
 			.outline = RGBA(0x191919ff),
 			.inner = RGBA(0x585858ff),
 			.inner_sel = RGBA(0x333333ff),
-			.item = RGBA(0x191919ff),
+			.item = RGBA(0xffffff8f),
 			.text = RGBA(0xffffffff),
 			.text_sel = RGBA(0xffffffff),
 			.roundness = 0.25f,
@@ -154,7 +154,7 @@ const bTheme U_theme_default = {
 		},
 		.wcol_menu_item = {
 			.inner_sel = RGBA(0x5680c2ff),
-			.item = RGBA(0xacacac80),
+			.item = RGBA(0xffffff8f),
 			.text = RGBA(0xeeeeeeff),
 			.text_sel = RGBA(0xffffffff),
 			.shadetop = 38,
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index dbd65ade307..4bf2ac4271b 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1961,9 +1961,12 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
 
 	/* part text right aligned */
 	if (drawstr_right) {
+		const char *col = but->block->flag & (UI_BLOCK_LOOP | UI_BLOCK_SHOW_SHORTCUT_ALWAYS) ?
+		                      wcol->item : wcol->text;
+
 		fstyle->align = UI_STYLE_TEXT_RIGHT;
 		rect->xmax -= UI_TEXT_CLIP_MARGIN;
-		UI_fontstyle_draw(fstyle, rect, drawstr_right, (unsigned char *)wcol->text);
+		UI_fontstyle_draw(fstyle, rect, drawstr_right, (const uchar *)col);
 	}
 }



More information about the Bf-blender-cvs mailing list