Automatically append the InsetCollapsable context menu.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36609 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-11-30 00:05:06 +00:00
parent b600508ee2
commit 5cc077c571
2 changed files with 10 additions and 51 deletions

View File

@ -160,12 +160,6 @@ Menuset
Item "Drop Shadow|w" "inset-modify changetype Shadowbox"
Item "Shaded Background|B" "inset-modify changetype Shaded"
Item "Double Frame|u" "inset-modify changetype Doublebox"
Separator
OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close"
Separator
Item "Dissolve Inset|D" "inset-dissolve"
Item "Settings...|S" "inset-settings box"
End
#
@ -177,13 +171,8 @@ Menuset
Item "Comment|m" "inset-modify note Note Comment"
Item "Greyed Out|G" "inset-modify note Note Greyedout"
Separator
OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close"
Separator
Item "Open All Notes|A" "inset-forall Note inset-toggle open"
Item "Close All Notes|l" "inset-forall Note inset-toggle close"
Separator
Item "Dissolve Inset|D" "inset-dissolve"
End
#
@ -354,18 +343,6 @@ Menuset
Item "Remove Last Argument Spitting Out to the Right" "math-macro-remove-greedy-param"
End
#
# InsetListing context menu
#
Menu "context-listings"
OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close"
Separator
Item "Dissolve Inset|D" "inset-dissolve"
Item "Settings...|S" "inset-settings listings"
End
#
# InsetGraphics context menu
#
@ -442,11 +419,6 @@ Menuset
Item "LyX Version|X" "inset-modify lyxinfo version"
End
#
# InsetInfo context menu
#
Menu "context-info"
Submenu "Document Info|D" "buffer-info"
Separator
@ -459,14 +431,8 @@ Menuset
#
Menu "context-branch"
OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close"
Separator
OptItem "Activate Branch|A" "branch-activate"
OptItem "Deactivate Branch|e" "branch-deactivate"
Separator
Item "Dissolve Inset|D" "inset-dissolve"
OptItem "Settings...|S" "inset-settings"
End
#
@ -562,13 +528,6 @@ Menuset
Menu "context-index"
IndicesContext
Separator
OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close"
Separator
Item "Dissolve Inset|D" "inset-dissolve"
Separator
OptItem "Settings...|S" "inset-settings"
End
#
@ -627,13 +586,7 @@ Menuset
# InsetERT context menu
#
Menu "context-ert"
OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close"
Separator
Item "Wrap by Preview|P" "command-sequence inset-begin;char-backward;char-forward-select;preview-insert"
Separator
Item "Dissolve Inset|D" "inset-dissolve"
OptItem "Settings...|S" "inset-settings"
End
#

View File

@ -621,17 +621,23 @@ InsetLayout::InsetDecoration InsetCollapsable::decoration() const
docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
int y) const
{
docstring context_menu = contextMenuName();
docstring const it_context_menu = InsetText::contextMenuName();
if (decoration() == InsetLayout::CONGLOMERATE)
return contextMenuName() + ";" + InsetText::contextMenuName();
return context_menu + ";" + it_context_menu;
docstring const ic_context_menu = InsetCollapsable::contextMenuName();
if (ic_context_menu != context_menu)
context_menu += ";" + ic_context_menu;
if (geometry(bv) == NoButton)
return contextMenuName() + ";" + InsetText::contextMenuName();
return context_menu + ";" + it_context_menu;
Dimension dim = dimensionCollapsed(bv);
if (x < xo(bv) + dim.wid && y < yo(bv) + dim.des)
return contextMenuName();
return context_menu;
return InsetText::contextMenuName();
return it_context_menu;
}