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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-03-26 23:17:50 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-03-26 23:17:50 +0300
commit5183788fd6376db26182c88a2d8e2f7e300d5cc3 (patch)
tree7c0c4c2b85765214e102f0dcad130aed8075b499 /source/blender/src/headerbuttons.c
parent0599a5646887fa7b2ac20b027c697356ce34c408 (diff)
Fix for bug #8746: the fake user button for datablocks was not a toggle
button, while it should be.
Diffstat (limited to 'source/blender/src/headerbuttons.c')
-rw-r--r--source/blender/src/headerbuttons.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c
index 43ca45ffb67..b5c22c9bc1b 100644
--- a/source/blender/src/headerbuttons.c
+++ b/source/blender/src/headerbuttons.c
@@ -384,10 +384,7 @@ int std_libbuttons(uiBlock *block, short xco, short yco,
}
if(keepbut) {
- if(id->flag & LIB_FAKEUSER)
- uiDefBut(block, BUT, keepbut, "F", xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Don't save this datablock even if it has no users");
- else
- uiDefBut(block, BUT, keepbut, "F", xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Saves this datablock even if it has no users");
+ uiDefButBitS(block, TOG, LIB_FAKEUSER, keepbut, "F", xco,yco,XIC,YIC, &id->flag, 0, 0, 0, 0, "Saves this datablock even if it has no users");
xco+= XIC;
}
}
@@ -1649,13 +1646,11 @@ void do_global_buttons(unsigned short event)
id= (ID *)G.saction->action;
}/* similar for other spacetypes ? */
if (id) {
- if( id->flag & LIB_FAKEUSER) {
- id->flag -= LIB_FAKEUSER;
- id->us--;
- } else {
- id->flag |= LIB_FAKEUSER;
+ /* flag was already toggled, just need to update user count */
+ if(id->flag & LIB_FAKEUSER)
id->us++;
- }
+ else
+ id->us--;
}
allqueue(REDRAWHEADERS, 0);