Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_search.c
| Show First 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | if (data->preview) { | ||||
| const int state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a]; | const int state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a]; | ||||
| /* ensure icon is up-to-date */ | /* ensure icon is up-to-date */ | ||||
| ui_icon_ensure_deferred(C, data->items.icons[a], data->preview); | ui_icon_ensure_deferred(C, data->items.icons[a], data->preview); | ||||
| ui_searchbox_butrect(&rect, data, a); | ui_searchbox_butrect(&rect, data, a); | ||||
| /* widget itself */ | /* widget itself */ | ||||
| ui_draw_preview_item( | ui_draw_preview_item(&data->fstyle, | ||||
| &data->fstyle, &rect, data->items.names[a], data->items.icons[a], state); | &rect, | ||||
| data->items.names[a], | |||||
| data->items.icons[a], | |||||
| state, | |||||
| UI_STYLE_TEXT_LEFT); | |||||
| } | } | ||||
| /* indicate more */ | /* indicate more */ | ||||
| if (data->items.more) { | if (data->items.more) { | ||||
| ui_searchbox_butrect(&rect, data, data->items.maxitem - 1); | ui_searchbox_butrect(&rect, data, data->items.maxitem - 1); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| UI_icon_draw(rect.xmax - 18, rect.ymin - 7, ICON_TRIA_DOWN); | UI_icon_draw(rect.xmax - 18, rect.ymin - 7, ICON_TRIA_DOWN); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | else { | ||||
| /* The previous menu item draws the active selection. */ | /* The previous menu item draws the active selection. */ | ||||
| ui_draw_menu_item(&data->fstyle, &rect, name_sep, icon, state, separator_type, NULL); | ui_draw_menu_item(&data->fstyle, &rect, name_sep, icon, state, separator_type, NULL); | ||||
| } | } | ||||
| } | } | ||||
| /* indicate more */ | /* indicate more */ | ||||
| if (data->items.more) { | if (data->items.more) { | ||||
| ui_searchbox_butrect(&rect, data, data->items.maxitem - 1); | ui_searchbox_butrect(&rect, data, data->items.maxitem - 1); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| UI_icon_draw((BLI_rcti_size_x(&rect)) / 2, rect.ymin - 9, ICON_TRIA_DOWN); | UI_icon_draw(BLI_rcti_size_x(&rect) / 2, rect.ymin - 9, ICON_TRIA_DOWN); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| if (data->items.offset) { | if (data->items.offset) { | ||||
| ui_searchbox_butrect(&rect, data, 0); | ui_searchbox_butrect(&rect, data, 0); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| UI_icon_draw((BLI_rcti_size_x(&rect)) / 2, rect.ymax - 7, ICON_TRIA_UP); | UI_icon_draw(BLI_rcti_size_x(&rect) / 2, rect.ymax - 7, ICON_TRIA_UP); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void ui_searchbox_region_free_cb(ARegion *region) | static void ui_searchbox_region_free_cb(ARegion *region) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | for (a = 0; a < data->items.totitem; a++) { | ||||
| UI_MENU_ITEM_SEPARATOR_NONE, | UI_MENU_ITEM_SEPARATOR_NONE, | ||||
| NULL); | NULL); | ||||
| } | } | ||||
| } | } | ||||
| /* indicate more */ | /* indicate more */ | ||||
| if (data->items.more) { | if (data->items.more) { | ||||
| ui_searchbox_butrect(&rect, data, data->items.maxitem - 1); | ui_searchbox_butrect(&rect, data, data->items.maxitem - 1); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| UI_icon_draw((BLI_rcti_size_x(&rect)) / 2, rect.ymin - 9, ICON_TRIA_DOWN); | UI_icon_draw(BLI_rcti_size_x(&rect) / 2, rect.ymin - 9, ICON_TRIA_DOWN); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| if (data->items.offset) { | if (data->items.offset) { | ||||
| ui_searchbox_butrect(&rect, data, 0); | ui_searchbox_butrect(&rect, data, 0); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| UI_icon_draw((BLI_rcti_size_x(&rect)) / 2, rect.ymax - 7, ICON_TRIA_UP); | UI_icon_draw(BLI_rcti_size_x(&rect) / 2, rect.ymax - 7, ICON_TRIA_UP); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ARegion *ui_searchbox_create_operator(bContext *C, ARegion *butregion, uiButSearch *search_but) | ARegion *ui_searchbox_create_operator(bContext *C, ARegion *butregion, uiButSearch *search_but) | ||||
| { | { | ||||
| ARegion *region = ui_searchbox_create_generic_ex(C, butregion, search_but, true); | ARegion *region = ui_searchbox_create_generic_ex(C, butregion, search_but, true); | ||||
| ▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines | |||||