Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-08-18 22:42:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-08-18 22:42:42 +0400
commit238955070b334062764e81c01c6d8381c332a54a (patch)
tree8171b85461b7ef2bd2aa7bbfb72f43d18010a6b6 /source/blender/editors/space_outliner/outliner_select.c
parentccdec67fec8a39b8239e93bd04e38b4d8cbd18e7 (diff)
minor change for operator OUTLINER_OT_item_activate
Noticed clicking anywhere in the outliner was doing undo pushes, even in empty areas. - check if any selection is made before redrawing. - don't do an undo push when selecting outliner items since only screen data is touched here.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_select.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 620a936a944..46a9bde8267 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -106,10 +106,11 @@
/* ****************************************************** */
/* Outliner Selection (grey-blue highlight for rows) */
-void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selecting)
+static int outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selecting)
{
TreeElement *te;
TreeStoreElem *tselem;
+ int change= 0;
for (te= lb->first; te && *index >= 0; te=te->next, (*index)--) {
tselem= TREESTORE(te);
@@ -131,6 +132,8 @@ void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selectin
tselem->flag |= TSE_SELECTED;
else
tselem->flag &= ~TSE_SELECTED;
+
+ change |= 1;
}
}
else if ((tselem->flag & TSE_CLOSED)==0) {
@@ -142,10 +145,12 @@ void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selectin
* function correctly
*/
(*index)--;
- outliner_select(soops, &te->subtree, index, selecting);
+ change |= outliner_select(soops, &te->subtree, index, selecting);
(*index)++;
}
}
+
+ return change;
}
/* ****************************************************** */
@@ -839,11 +844,14 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event)
fmval[0], fmval[1], NULL, &row);
/* select relevant row */
- outliner_select(soops, &soops->tree, &row, &selecting);
+ if(outliner_select(soops, &soops->tree, &row, &selecting)) {
- soops->storeflag |= SO_TREESTORE_REDRAW;
+ soops->storeflag |= SO_TREESTORE_REDRAW;
- ED_undo_push(C, "Outliner selection event");
+ /* no need for undo push here, only changing outliner data which is
+ * scene level - campbell */
+ /* ED_undo_push(C, "Outliner selection event"); */
+ }
}
ED_region_tag_redraw(ar);