diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 13:39:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 16:26:00 +0300 |
commit | 2d34420648e5feacf1237abc975f8ff2a0c2a907 (patch) | |
tree | 1a59f1e4afa3d84e6b7899f9501ad5a346054571 /source/blender/editors/include/UI_interface.h | |
parent | e3b83e2921922a45db5a33c739e1d993452944d0 (diff) |
UI: support an 'active default' button for pop-ups
Use this for the save confirmation dialog so it has a default action
when pressing enter which draws with a highlight so it's clear what the
default action is (the dialog was just closing before).
Resolves T57686
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 6a9034f9097..ec88278ec88 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -193,6 +193,9 @@ enum { UI_BUT_IMMEDIATE = 1 << 20, UI_BUT_NO_UTF8 = 1 << 21, + /** For popups, pressing return activates this button, overriding the highlighed button. */ + UI_BUT_ACTIVE_DEFAULT = 1 << 23, + /** This but is "inside" a list item (currently used to change theme colors). */ UI_BUT_LIST_ITEM = 1 << 24, /** edit this button as well as the active button (not just dragging) */ @@ -1053,6 +1056,7 @@ void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but); void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext); void uiLayoutSetActive(uiLayout *layout, bool active); +void uiLayoutSetActiveDefault(uiLayout *layout, bool active_default); void uiLayoutSetActivateInit(uiLayout *layout, bool active); void uiLayoutSetEnabled(uiLayout *layout, bool enabled); void uiLayoutSetRedAlert(uiLayout *layout, bool redalert); @@ -1069,6 +1073,7 @@ int uiLayoutGetLocalDir(const uiLayout *layout); int uiLayoutGetOperatorContext(uiLayout *layout); bool uiLayoutGetActive(uiLayout *layout); +bool uiLayoutGetActiveDefault(uiLayout *layout); bool uiLayoutGetActivateInit(uiLayout *layout); bool uiLayoutGetEnabled(uiLayout *layout); bool uiLayoutGetRedAlert(uiLayout *layout); |