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:
authorCampbell Barton <ideasman42@gmail.com>2014-02-20 06:30:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-20 06:30:52 +0400
commit1df068c39a8a4d58272795aff135867f76b2b937 (patch)
tree06eb39b65591fe78f59990bed129b99975bb83dd
parente7f3424dca094f6615fe1eb7d57ce2084762c462 (diff)
UI: Fix for rna-enum submenus not showing a right arrow
-rw-r--r--source/blender/editors/interface/interface.c4
-rw-r--r--source/blender/editors/interface/interface_widgets.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 2e7bfb162ae..d2a4dab21d7 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3255,6 +3255,10 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
but->drawflag |= UI_BUT_ICON_LEFT;
}
+ if ((type == MENU) && (but->dt == UI_EMBOSSP)) {
+ but->flag |= UI_ICON_SUBMENU;
+ }
+
if (!RNA_property_editable(&but->rnapoin, prop)) {
ui_def_but_rna__disable(but);
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index d19b16250cd..8ce7503e50f 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1357,12 +1357,10 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
/* draws text and icons for buttons */
static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *but, rcti *rect)
{
+ const bool show_menu_icon = ui_but_draw_menu_icon(but);
float alpha = (float)wcol->text[3] / 255.0f;
char password_str[UI_MAX_DRAW_STR];
- if (but == NULL)
- return;
-
ui_button_text_password_hide(password_str, but, false);
/* check for button text label */
@@ -1375,8 +1373,8 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
/* If there's an icon too (made with uiDefIconTextBut) then draw the icon
* and offset the text label to accommodate it */
- if (but->flag & UI_HAS_ICON) {
- const bool show_menu_icon = ui_but_draw_menu_icon(but);
+ if (but->flag & UI_HAS_ICON || show_menu_icon) {
+ const BIFIconID icon = (but->flag & UI_HAS_ICON) ? but->icon + but->iconadd : ICON_NONE;
const float icon_size = ICON_SIZE_FROM_BUTRECT(rect);
/* menu item - add some more padding so menus don't feel cramped. it must
@@ -1384,7 +1382,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
if (ui_block_is_menu(but->block))
rect->xmin += 0.3f * U.widget_unit;
- widget_draw_icon(but, but->icon + but->iconadd, alpha, rect, show_menu_icon);
+ widget_draw_icon(but, icon, alpha, rect, show_menu_icon);
rect->xmin += icon_size;
/* without this menu keybindings will overlap the arrow icon [#38083] */