mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 02:35:20 +00:00
Do not use toobar menu as fallback context menu
This is a consequence of060a9664
, although it is not clear why. The contextMenuEvent code of the workarea should not delegate context menu when it cannot honor it. Also fix a small memory leak. Fixes bug #10616. (cherry picked from commitab81c23656
)
This commit is contained in:
parent
476705ba76
commit
e5105a0dce
@ -3361,8 +3361,7 @@ bool GuiView::goToFileRow(string const & argument)
|
|||||||
|
|
||||||
void GuiView::toolBarPopup(const QPoint & /*pos*/)
|
void GuiView::toolBarPopup(const QPoint & /*pos*/)
|
||||||
{
|
{
|
||||||
QMenu * menu = new QMenu;
|
QMenu * menu = guiApp->menus().menu(toqstr("context-toolbars"), * this);
|
||||||
menu = guiApp->menus().menu(toqstr("context-toolbars"), * this);
|
|
||||||
menu->exec(QCursor::pos());
|
menu->exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,7 +784,7 @@ void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
QAbstractScrollArea::contextMenuEvent(e);
|
e->accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// always show mnemonics when the keyboard is used to show the context menu
|
// always show mnemonics when the keyboard is used to show the context menu
|
||||||
@ -792,7 +792,7 @@ void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
|
|||||||
bool const keyboard = (e->reason() == QContextMenuEvent::Keyboard);
|
bool const keyboard = (e->reason() == QContextMenuEvent::Keyboard);
|
||||||
QMenu * menu = guiApp->menus().menu(toqstr(name), *d->lyx_view_, keyboard);
|
QMenu * menu = guiApp->menus().menu(toqstr(name), *d->lyx_view_, keyboard);
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
QAbstractScrollArea::contextMenuEvent(e);
|
e->accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Position the menu to the right.
|
// Position the menu to the right.
|
||||||
|
@ -100,6 +100,8 @@ What's new
|
|||||||
|
|
||||||
- Don't swallow labels not entered through the toolbar in mathed (bug 10546).
|
- Don't swallow labels not entered through the toolbar in mathed (bug 10546).
|
||||||
|
|
||||||
|
- Fix bad context menu on insets that do not have one (bug 10626).
|
||||||
|
|
||||||
|
|
||||||
* INTERNALS
|
* INTERNALS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user