From a1addc5c633d4c35eeb491c698052ec9300271dc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 Mar 2019 22:40:38 +1100 Subject: UI: support for popups starting with buttons activated While this could already be done from C, this is now exposed to Python --- source/blender/editors/include/UI_interface.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 7d28c538780..80f58a9548b 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -201,6 +201,8 @@ enum { UI_BUT_LIST_ITEM = 1 << 24, /** edit this button as well as the active button (not just dragging) */ UI_BUT_DRAG_MULTI = 1 << 25, + /** Use for popups to start editing the button on initialization. */ + UI_BUT_ACTIVATE_ON_INIT = 1 << 26, /** #uiBut.str contains #UI_SEP_CHAR, used for key shortcuts */ UI_BUT_HAS_SEP_CHAR = 1 << 27, @@ -631,6 +633,7 @@ void UI_but_type_set_menu_from_pulldown(uiBut *but); /* special button case, only draw it when used actively, for outliner etc */ bool UI_but_active_only(const struct bContext *C, struct ARegion *ar, uiBlock *block, uiBut *but); +bool UI_block_active_only_flagged_buttons(const struct bContext *C, struct ARegion *ar, struct uiBlock *block); void UI_but_execute(const struct bContext *C, uiBut *but); @@ -1053,6 +1056,7 @@ void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but); void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext); void uiLayoutSetActive(uiLayout *layout, bool active); +void uiLayoutSetActivateInit(uiLayout *layout, bool active); void uiLayoutSetEnabled(uiLayout *layout, bool enabled); void uiLayoutSetRedAlert(uiLayout *layout, bool redalert); void uiLayoutSetAlignment(uiLayout *layout, char alignment); @@ -1068,6 +1072,7 @@ int uiLayoutGetLocalDir(const uiLayout *layout); int uiLayoutGetOperatorContext(uiLayout *layout); bool uiLayoutGetActive(uiLayout *layout); +bool uiLayoutGetActivateInit(uiLayout *layout); bool uiLayoutGetEnabled(uiLayout *layout); bool uiLayoutGetRedAlert(uiLayout *layout); int uiLayoutGetAlignment(uiLayout *layout); -- cgit v1.2.3