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:
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r--source/blender/editors/interface/interface_utils.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 0823238fcb1..576e17727dd 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -43,6 +43,7 @@
#include "BLF_translation.h"
+#include "BKE_context.h"
#include "BKE_report.h"
#include "MEM_guardedalloc.h"
@@ -313,6 +314,25 @@ int UI_calc_float_precision(int prec, double value)
return prec;
}
+uiBut *ui_but_find_menu_root(struct bContext *C) {
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar;
+ uiBlock *block;
+ uiBut *but;
+
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ for (but = block->buttons.first; but; but = but->next) {
+ if (but->flag & UI_BUT_MENU_ROOT) {
+ return but;
+ }
+ }
+ }
+ }
+
+ return NULL;
+}
+
bool UI_but_online_manual_id(const uiBut *but, char *r_str, size_t maxlength)
{
if (but->rnapoin.id.data && but->rnapoin.data && but->rnaprop) {