From 45ed196344a7534c9965015ca653c90f5f00d97f Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 5 Jun 2009 16:11:18 +0000 Subject: 2.5 Search menu: - Made nicer drawing for popup version of search. It now uses entire backdrop like pulldowns. Search boxes for text buttons will use different style still; if we use this option all over it shouldn't look too intrusive. - Search menu allows scroll, to view all items. It doesn't cycle anymore. - Click outside search menu now cancels - If a match is in search button, it highlights it. This also allows ALT+CTRL+F - Enter to redo last op. - Search popup draws higher when no no space below. No order flipping! --- source/blender/editors/interface/interface_handlers.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/interface/interface_handlers.c') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 52b14d6823e..933d57c8983 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1169,7 +1169,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data) /* optional searchbox */ if(but->type==SEARCH_MENU) { data->searchbox= ui_searchbox_create(C, data->region, but); - ui_searchbox_update(C, data->searchbox, but); + ui_searchbox_update(C, data->searchbox, but, 1); /* 1= reset */ } ui_check_but(but); @@ -1247,7 +1247,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle switch(event->type) { case MOUSEMOVE: if(data->searchbox) - ui_searchbox_event(data->searchbox, event); + ui_searchbox_event(C, data->searchbox, but, event); break; case RIGHTMOUSE: @@ -1277,6 +1277,9 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle retval= WM_UI_HANDLER_BREAK; } else if(inbox==0) { + /* if searchbox, click outside will cancel */ + if(data->searchbox) + data->cancel= data->escapecancel= 1; button_activate_state(C, but, BUTTON_STATE_EXIT); retval= WM_UI_HANDLER_BREAK; } @@ -1315,7 +1318,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle break; case DOWNARROWKEY: if(data->searchbox) { - ui_searchbox_event(data->searchbox, event); + ui_searchbox_event(C, data->searchbox, but, event); break; } /* pass on purposedly */ @@ -1325,7 +1328,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle break; case UPARROWKEY: if(data->searchbox) { - ui_searchbox_event(data->searchbox, event); + ui_searchbox_event(C, data->searchbox, but, event); break; } /* pass on purposedly */ @@ -1378,7 +1381,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle else ui_check_but(but); if(data->searchbox) - ui_searchbox_update(C, data->searchbox, but); + ui_searchbox_update(C, data->searchbox, but, 1); /* 1 = reset */ } if(changed || (retval == WM_UI_HANDLER_BREAK)) -- cgit v1.2.3