Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_templates.c
| Show First 20 Lines • Show All 1,106 Lines • ▼ Show 20 Lines | if ((ID_REAL_USERS(id) > 1) && (hide_buttons == false)) { | ||||
| UI_but_flag_enable(but, UI_BUT_DISABLED); | UI_but_flag_enable(but, UI_BUT_DISABLED); | ||||
| } | } | ||||
| } | } | ||||
| if (user_alert) { | if (user_alert) { | ||||
| UI_but_flag_enable(but, UI_BUT_REDALERT); | UI_but_flag_enable(but, UI_BUT_REDALERT); | ||||
| } | } | ||||
| if (!ID_IS_LINKED(id) && !(ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_OB, ID_WS)) && | if (!ID_IS_LINKED(id)) { | ||||
| if (ID_IS_ASSET(id)) { | |||||
| uiDefIconButO(block, | |||||
| /* Using `_N` version allows us to get the 'active' state by default. */ | |||||
| UI_BTYPE_ICON_TOGGLE_N, | |||||
| "ASSET_OT_clear", | |||||
| WM_OP_INVOKE_DEFAULT, | |||||
| /* 'active' state of a toggle button uses icon + 1, so to get proper asset | |||||
| * icon we need to pass its value - 1 here. */ | |||||
| ICON_ASSET_MANAGER - 1, | |||||
| 0, | |||||
| 0, | |||||
| UI_UNIT_X, | |||||
| UI_UNIT_Y, | |||||
| NULL); | |||||
| } | |||||
| else if (!(ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_OB, ID_WS)) && | |||||
| (hide_buttons == false)) { | (hide_buttons == false)) { | ||||
| uiDefIconButR(block, | uiDefIconButR(block, | ||||
| UI_BTYPE_ICON_TOGGLE, | UI_BTYPE_ICON_TOGGLE, | ||||
| 0, | 0, | ||||
| ICON_FAKE_USER_OFF, | ICON_FAKE_USER_OFF, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| UI_UNIT_X, | UI_UNIT_X, | ||||
| UI_UNIT_Y, | UI_UNIT_Y, | ||||
| &idptr, | &idptr, | ||||
| "use_fake_user", | "use_fake_user", | ||||
| -1, | -1, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| -1, | -1, | ||||
| -1, | -1, | ||||
| NULL); | NULL); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| if ((flag & UI_ID_ADD_NEW) && (hide_buttons == false)) { | if ((flag & UI_ID_ADD_NEW) && (hide_buttons == false)) { | ||||
| template_id_def_new_but( | template_id_def_new_but( | ||||
| block, id, template_ui, type, newop, editable, flag & UI_ID_OPEN, false, UI_UNIT_X); | block, id, template_ui, type, newop, editable, flag & UI_ID_OPEN, false, UI_UNIT_X); | ||||
| } | } | ||||
| /* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack. | /* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack. | ||||
| * Only for images, sound and fonts */ | * Only for images, sound and fonts */ | ||||
| ▲ Show 20 Lines • Show All 5,442 Lines • Show Last 20 Lines | |||||