]> git.lyx.org Git - features.git/commitdiff
Use 'assign' as the name for the operation that opens/closes branch
authorMartin Vermeer <martin.vermeer@hut.fi>
Wed, 7 Apr 2004 05:28:51 +0000 (05:28 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Wed, 7 Apr 2004 05:28:51 +0000 (05:28 +0000)
insets according to selection

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8616 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlDocument.C
src/insets/ChangeLog
src/insets/insetbranch.C
src/insets/insetcollapsable.C

index 0729b3599b63eed5be4d599a6b8e161170a998d9..ff80490396269f78a8cec7141595f65e203902bf 100644 (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
index 25c3212de7b04131a9809a71b0ba679939a6e89e..5dc34b009578a9156c9ecd3848eec6593cf93671 100644 (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"));
 }
 
 
index b82e93b099d134bb665d7a1399846138acbcac73..6e4d931debf5171c5fbe6316f653aff9fff38f91 100644 (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,
index d1a400e08efa51b936dcf2309362741e60982f82..a8909d5a07dedfc672bf1f4d9a57ffe40c0d979a 100644 (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();
index 5871a073e7478cd9974dc4a88ae6feba7273254f..6d908ce86e3d68ef327bfd58c3d62e33e670b16a 100644 (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;