[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32358] trunk/blender/source/blender/ editors: bugfix [#24158] Object text fields immediately search based on existing content
Campbell Barton
ideasman42 at gmail.com
Thu Oct 7 02:14:21 CEST 2010
Revision: 32358
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32358
Author: campbellbarton
Date: 2010-10-07 02:14:21 +0200 (Thu, 07 Oct 2010)
Log Message:
-----------
bugfix [#24158] Object text fields immediately search based on existing content
also remove some unused struct members from uiBlock/uiBut.
Modified Paths:
--------------
trunk/blender/source/blender/editors/include/UI_interface.h
trunk/blender/source/blender/editors/interface/interface.c
trunk/blender/source/blender/editors/interface/interface_handlers.c
trunk/blender/source/blender/editors/interface/interface_intern.h
trunk/blender/source/blender/editors/interface/interface_layout.c
Modified: trunk/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_interface.h 2010-10-06 22:29:34 UTC (rev 32357)
+++ trunk/blender/source/blender/editors/include/UI_interface.h 2010-10-07 00:14:21 UTC (rev 32358)
@@ -77,17 +77,18 @@
#define UI_EMBOSST 3 /* Table */
/* uiBlock->direction */
+#define UI_DIRECTION (UI_TOP|UI_DOWN|UI_LEFT|UI_RIGHT)
#define UI_TOP 1
#define UI_DOWN 2
#define UI_LEFT 4
#define UI_RIGHT 8
-#define UI_DIRECTION 15
+
#define UI_CENTER 16
#define UI_SHIFT_FLIPPED 32
/* uiBlock->autofill (not yet used) */
-#define UI_BLOCK_COLLUMNS 1
-#define UI_BLOCK_ROWS 2
+// #define UI_BLOCK_COLLUMNS 1
+// #define UI_BLOCK_ROWS 2
/* uiBlock->flag (controls) */
#define UI_BLOCK_LOOP 1
@@ -316,7 +317,7 @@
uiBlock *uiGetBlock(char *name, struct ARegion *ar);
-void uiBlockSetEmboss(uiBlock *block, short dt);
+void uiBlockSetEmboss(uiBlock *block, char dt);
void uiFreeBlock(const struct bContext *C, uiBlock *block);
void uiFreeBlocks(const struct bContext *C, struct ListBase *lb);
Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c 2010-10-06 22:29:34 UTC (rev 32357)
+++ trunk/blender/source/blender/editors/interface/interface.c 2010-10-07 00:14:21 UTC (rev 32358)
@@ -937,7 +937,7 @@
void uiBlockSetButLock(uiBlock *block, int val, char *lockstr)
{
if(val) {
- block->lock |= val;
+ block->lock= val ? 1:0;
block->lockstr= lockstr;
}
}
@@ -1947,7 +1947,7 @@
return NULL;
}
-void uiBlockSetEmboss(uiBlock *block, short dt)
+void uiBlockSetEmboss(uiBlock *block, char dt)
{
block->dt= dt;
}
Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c 2010-10-06 22:29:34 UTC (rev 32357)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c 2010-10-07 00:14:21 UTC (rev 32358)
@@ -1816,6 +1816,7 @@
/* only update when typing for TAB key */
if(update && data->interactive) ui_apply_button(C, block, but, data, 1);
else ui_check_but(but);
+ but->changed= TRUE;
if(data->searchbox)
ui_searchbox_update(C, data->searchbox, but, 1); /* 1 = reset */
Modified: trunk/blender/source/blender/editors/interface/interface_intern.h
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_intern.h 2010-10-06 22:29:34 UTC (rev 32357)
+++ trunk/blender/source/blender/editors/interface/interface_intern.h 2010-10-07 00:14:21 UTC (rev 32358)
@@ -206,10 +206,11 @@
char *tip, *lockstr;
BIFIconID icon;
- short but_align; /* aligning buttons, horiz/vertical */
- short lock;
+ char lock;
+ char dt;
+ short changed; /* could be made into a single flag */
short modifier_key;
- short iconadd, dt;
+ short iconadd;
/* IDPOIN data */
uiIDPoinFuncFP idpoin_func;
@@ -296,13 +297,14 @@
void *drawextra_arg1;
void *drawextra_arg2;
- int afterval, flag;
-
- short direction, dt;
- short auto_open, in_use;
+ int flag;
+ char direction, dt;
+ short auto_open;
double auto_open_last;
- int lock;
+ char active; // to keep blocks while drawing and free them afterwards
+ char tooltipdisabled; // to avoid tooltip after click
+ short lock;
char *lockstr;
float xofs, yofs; // offset to parent button
@@ -314,9 +316,7 @@
ListBase saferct; // uiSafetyRct list
uiPopupBlockHandle *handle; // handle
- int tooltipdisabled; // to avoid tooltip after click
- int active; // to keep blocks while drawing and free them afterwards
int puphash; // popup menu hash for memory
int color_profile; // color profile for correcting linear colors for display
Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c 2010-10-06 22:29:34 UTC (rev 32357)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c 2010-10-07 00:14:21 UTC (rev 32358)
@@ -1109,6 +1109,7 @@
int i=0, iconid=0, flag= RNA_property_flag(but->rnaprop);
ListBase *items_list= MEM_callocN(sizeof(ListBase), "items_list");
CollItemSearch *cis;
+ const int skip_filter= !but->changed;
/* build a temporary list of relevant items first */
RNA_PROP_BEGIN(&but->rnasearchpoin, itemptr, but->rnasearchprop) {
@@ -1140,7 +1141,7 @@
}
if(name) {
- if(BLI_strcasestr(name, str)) {
+ if(skip_filter || BLI_strcasestr(name, str)) {
cis = MEM_callocN(sizeof(CollItemSearch), "CollectionItemSearch");
cis->name = MEM_dupallocN(name);
cis->index = i;
More information about the Bf-blender-cvs
mailing list