LFUN to toggle branch inversion status, now available from the

context menu.
This commit is contained in:
Richard Heck 2016-07-12 00:16:05 -04:00
parent 5df323a0dd
commit e1ca7733c3
4 changed files with 18 additions and 0 deletions

View File

@ -494,6 +494,7 @@ Menuset
OptItem "Deactivate Branch|e" "branch-deactivate" OptItem "Deactivate Branch|e" "branch-deactivate"
OptItem "Activate Branch in Master|M" "branch-master-activate" OptItem "Activate Branch in Master|M" "branch-master-activate"
OptItem "Deactivate Branch in Master|v" "branch-master-deactivate" OptItem "Deactivate Branch in Master|v" "branch-master-deactivate"
OptItem "Toggle Inversion|I" "branch-invert"
OptItem "Add Unknown Branch|w" "branch-add" OptItem "Add Unknown Branch|w" "branch-add"
End End

View File

@ -465,6 +465,7 @@ enum FuncCode
// 340 // 340
LFUN_BUFFER_MOVE_PREVIOUS, // skostysh 20150408 LFUN_BUFFER_MOVE_PREVIOUS, // skostysh 20150408
LFUN_TABULAR_FEATURE, // gm, 20151210 LFUN_TABULAR_FEATURE, // gm, 20151210
LFUN_BRANCH_INVERT, // rgheck, 20160712
LFUN_LASTACTION // end of the table LFUN_LASTACTION // end of the table
}; };

View File

@ -3641,6 +3641,15 @@ void LyXAction::init()
{ LFUN_BRANCH_ADD, "branch-add", AtPoint, Buffer }, { LFUN_BRANCH_ADD, "branch-add", AtPoint, Buffer },
/*!
* \var lyx::FuncCode lyx::LFUN_BRANCH_INVERT
* \li Action: Toggles inversion status of branch inset.
* \li Syntax: branch-invert
* \li Origin: rgheck, 12 July 2016
* \endvar
*/
{ LFUN_BRANCH_INVERT, "branch-invert", AtPoint, Buffer },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_BRANCH_ACTIVATE * \var lyx::FuncCode lyx::LFUN_BRANCH_ACTIVATE
* \li Action: Activate the branch. * \li Action: Activate the branch.

View File

@ -188,6 +188,9 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
} }
break; break;
} }
case LFUN_BRANCH_INVERT:
params_.inverted = !params_.inverted;
break;
case LFUN_BRANCH_ADD: case LFUN_BRANCH_ADD:
lyx::dispatch(FuncRequest(LFUN_BRANCH_ADD, params_.branch)); lyx::dispatch(FuncRequest(LFUN_BRANCH_ADD, params_.branch));
break; break;
@ -220,6 +223,10 @@ bool InsetBranch::getStatus(Cursor & cur, FuncRequest const & cmd,
flag.setEnabled(known_branch && !isBranchSelected(true)); flag.setEnabled(known_branch && !isBranchSelected(true));
break; break;
case LFUN_BRANCH_INVERT:
flag.setEnabled(true);
break;
case LFUN_BRANCH_ADD: case LFUN_BRANCH_ADD:
flag.setEnabled(!known_branch); flag.setEnabled(!known_branch);
break; break;