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>2020-04-17 04:16:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-17 04:16:48 +0300
commit0f0436c15e00df4a04b028ac5781f5255fa66310 (patch)
treecd90284ba41028bb6d0ec91dd954dbb0d36f251b /source/blender/editors/interface/interface_widgets.c
parentab93e568ebbfeec0c22ee581c39e2f56d5fb443f (diff)
Cleanup: comments for ui_draw_menu_item & correct argument name
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 53c488bf765..03f2fddc168 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -5292,15 +5292,23 @@ void ui_draw_tooltip_background(const uiStyle *UNUSED(style), uiBlock *UNUSED(bl
wt->draw(&wt->wcol, rect, 0, 0);
}
-/* helper call to draw a menu item without button */
-/* state: UI_ACTIVE or 0 */
+/**
+ * Helper call to draw a menu item without a button.
+ *
+ * \param state: The state of the button,
+ * typically #UI_ACTIVE, #UI_BUT_DISABLED, #UI_BUT_INACTIVE.
+ * \param use_sep: When true, characters after the last #UI_SEP_CHAR are right aligned,
+ * use for displaying key shortcuts.
+ * \param r_xmax: The right hand position of the text, this takes into the icon,
+ * padding and text clipping when there is not enough room to display the full text.
+ */
void ui_draw_menu_item(const uiFontStyle *fstyle,
rcti *rect,
const char *name,
int iconid,
int state,
bool use_sep,
- int *r_name_width)
+ int *r_xmax)
{
uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM);
rcti _rect = *rect;
@@ -5363,8 +5371,8 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
&xofs,
&yofs,
&info);
- if (r_name_width != NULL) {
- *r_name_width = xofs + info.width;
+ if (r_xmax != NULL) {
+ *r_xmax = xofs + info.width;
}
}