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:
authorJulian Eisel <julian@blender.org>2021-01-26 00:54:00 +0300
committerJulian Eisel <julian@blender.org>2021-01-26 01:10:16 +0300
commit77f73a92843965906189dd56dcc4d18eae2371cc (patch)
tree8ff43da506a34768f01380c5e5d8624dc37b3696 /source/blender/editors/interface/interface_intern.h
parent14f61c619b0bd28386673672881a234e7e1ded11 (diff)
Fix library name clipping most of the data-block name in data-block menus
Issue is visible here https://developer.blender.org/F8626313. If there is enough space for both the item name and the library hint, display both. Otherwise, clip either the item name, the library hint, or both so that not more than 60% and 40% of the available width are used repectively. There are further improvements we could do, as noted in T84188, this just fixes the regression for the release. Part of T84188. There were multiple reports about this, see merged in and mentioned reports in T84188 and T78012.
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r--source/blender/editors/interface/interface_intern.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 991e8aaf89a..f4e68ca3909 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -991,12 +991,26 @@ extern void ui_draw_but(const struct bContext *C,
uiBut *but,
rcti *rect);
+/**
+ * Info about what the separator character separates, used to decide between different drawing
+ * styles. E.g. we never want a shortcut string to be clipped, but other hint strings can be
+ * clipped.
+ */
+typedef enum {
+ UI_MENU_ITEM_SEPARATOR_NONE,
+ /** Separator is used to indicate shortcut string of this item. Shortcut string will not get
+ * clipped. */
+ UI_MENU_ITEM_SEPARATOR_SHORTCUT,
+ /** Separator is used to indicate some additional hint to display for this item. Hint string will
+ * get clipped before the normal text. */
+ UI_MENU_ITEM_SEPARATOR_HINT,
+} uiMenuItemSeparatorType;
void ui_draw_menu_item(const struct uiFontStyle *fstyle,
rcti *rect,
const char *name,
int iconid,
int state,
- bool use_sep,
+ uiMenuItemSeparatorType separator_type,
int *r_xmax);
void ui_draw_preview_item(
const struct uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state);