Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 8,702 Lines • ▼ Show 20 Lines | static uiBut *ui_context_button_active(const ARegion *region, bool (*but_check_cb)(const uiBut *)) | ||||
| uiBut *but_found = NULL; | uiBut *but_found = NULL; | ||||
| while (region) { | while (region) { | ||||
| uiBut *activebut = NULL; | uiBut *activebut = NULL; | ||||
| /* find active button */ | /* find active button */ | ||||
| LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) { | LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) { | ||||
| LISTBASE_FOREACH (uiBut *, but, &block->buttons) { | LISTBASE_FOREACH (uiBut *, but, &block->buttons) { | ||||
| if (but->flag & UI_BUT_ACTIVE_OVERRIDE) { | |||||
| activebut = but; | |||||
| break; | |||||
| } | |||||
| if (but->active) { | if (but->active) { | ||||
| activebut = but; | activebut = but; | ||||
| break; | |||||
| } | } | ||||
| else if (!activebut && (but->flag & UI_BUT_LAST_ACTIVE)) { | if (but->flag & UI_BUT_LAST_ACTIVE) { | ||||
| activebut = but; | activebut = but; | ||||
| break; | |||||
| } | |||||
| } | } | ||||
| if (activebut) { | |||||
| break; | |||||
| } | } | ||||
| } | } | ||||
| if (activebut && (but_check_cb == NULL || but_check_cb(activebut))) { | if (activebut && (but_check_cb == NULL || but_check_cb(activebut))) { | ||||
| uiHandleButtonData *data = activebut->active; | uiHandleButtonData *data = activebut->active; | ||||
| but_found = activebut; | but_found = activebut; | ||||
| ▲ Show 20 Lines • Show All 3,068 Lines • Show Last 20 Lines | |||||