diff options
author | Julian Eisel <julian@blender.org> | 2021-06-15 19:53:32 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-06-15 20:13:09 +0300 |
commit | a4f840e15bf0a3692741876e27766d606e6d942c (patch) | |
tree | ef025d8b95053f9d57c1098ae70bbc741e7edcd6 /source/blender/editors/interface/interface_context_menu.c | |
parent | fcc844f8fbd0d10aeb5012c0b25babe76c278e9e (diff) |
UI: Support right aligned non-shortcut hints in widgets
Widget drawing code already supported drawing right-aligned, grayed out
shortcut strings. This patch generalizes things a bit so this can also
be used to draw other hints in the same way. There have been a few
instances in the past where this would've been useful, D11046 being the
latest one.
Note that besides some manual regression testing, I didn't check if this
works yet, as there is no code actually using it (other than the
shortcuts). Can be checked as part of further development for D11046.
A possible further improvement would be providing a way to define how
clipping should be done. E.g. sometimes the right-aligned text should be
clipped first (because it's just a hint), in other cases it should be
left untouched (like current code explicitly does it for shortcuts).
Removes the `UI_BUT_HAS_SHORTCUT` flag, which isn't needed anymore.
Diffstat (limited to 'source/blender/editors/interface/interface_context_menu.c')
-rw-r--r-- | source/blender/editors/interface/interface_context_menu.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index b142e383df0..775e3923edc 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -1280,7 +1280,6 @@ void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *panel) uiBlock *block = uiLayoutGetBlock(layout); uiBut *but = block->buttons.last; but->flag |= UI_BUT_HAS_SEP_CHAR; - but->drawflag |= UI_BUT_HAS_SHORTCUT; } } UI_popup_menu_end(C, pup); |