Use 'assign' as the name for the operation that opens/closes branch

insets according to selection


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8616 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2004-04-07 05:28:51 +00:00
parent dcd66fa802
commit 9b35643f8e
5 changed files with 24 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2004-04-07 Martin Vermeer <martin.vermeer@hut.fi>
* ControlDocument.C: 'assign' for opening/closing branch insets
according to selection
2004-04-05 Angus Leeming <leeming@lyx.org>
* ButtonPolicies.C (printState, printInput): human-readable output

View File

@ -115,7 +115,7 @@ void ControlDocument::dispatchParams()
}
// Open insets of selected branches, close deselected ones
kernel().dispatch(FuncRequest(LFUN_ALL_INSETS_TOGGLE, "toggle branch"));
kernel().dispatch(FuncRequest(LFUN_ALL_INSETS_TOGGLE, "assign branch"));
}

View File

@ -1,3 +1,9 @@
2004-04-07 Martin Vermeer <martin.vermeer@hut.fi>
* insetcollapsable.C:
* insetbranch.C: 'assign' to open/close branch inset according to
selection; also print content on closed branch button
2004-04-06 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* ExternalSupport.C (doSubstitution): add new variables $$AbsPath,

View File

@ -94,7 +94,8 @@ void InsetBranch::setButtonLabel()
font.decSize();
font.decSize();
setLabel("Branch: " + params_.branch);
string s = "Branch: " + params_.branch;
setLabel(isOpen() ? s : getNewLabel(s) );
font.setColor(LColor::foreground);
if (!params_.branch.empty())
setBackgroundColor(lcolor.getFromLyXName(params_.branch));
@ -150,9 +151,15 @@ void InsetBranch::priv_dispatch(LCursor & cur, FuncRequest & cmd)
else if (cmd.argument == "close") {
setStatus(Collapsed);
leaveInset(cur, *this);
} else if (cmd.argument == "toggle") {
if (isOpen()) {
setStatus(Collapsed);
leaveInset(cur, *this);
} else
setStatus(Open);
// The branch inset specialises its behaviour on "toggle".
} else if (cmd.argument == "toggle"
// The branch inset uses "assign".
} else if (cmd.argument == "assign"
|| cmd.argument.empty()) {
BranchList const & branchlist =
cur.bv().buffer()->params().branchlist();

View File

@ -323,7 +323,8 @@ void InsetCollapsable::priv_dispatch(LCursor & cur, FuncRequest & cmd)
leaveInset(cur, *this);
} else
setStatus(Open);
}
} else // if assign or anything else
cur.undispatched();
cur.dispatched();
break;