Fix #279432: Right-click menu on palette items seems dead.

See https://musescore.org/en/node/279432 for explanation
This commit is contained in:
JoshuaBonn1 2018-12-05 16:27:47 -08:00
parent 082e635c1d
commit fc1fb4d466
2 changed files with 6 additions and 4 deletions

View file

@ -234,6 +234,8 @@ void Palette::contextMenuEvent(QContextMenuEvent* event)
int i = idx(event->pos());
if (i == -1) {
// palette context menu
if (!_moreElements)
return;
QMenu menu;
QAction* moreAction = menu.addAction(tr("More Elements..."));
moreAction->setEnabled(_moreElements);
@ -251,9 +253,12 @@ void Palette::contextMenuEvent(QContextMenuEvent* event)
QAction* moreAction = menu.addAction(tr("More Elements..."));
moreAction->setEnabled(_moreElements);
if (cellAt(i) && cellAt(i)->readOnly)
if (filterActive || (cellAt(i) && cellAt(i)->readOnly))
clearAction->setEnabled(false);
if (!clearAction->isEnabled() && !contextAction->isEnabled() && !moreAction->isEnabled())
return;
QAction* action = menu.exec(mapToGlobal(event->pos()));
if (action == clearAction) {

View file

@ -123,9 +123,6 @@ void PaletteBox::filterPalettes(const QString& text)
}
else
b->showPalette(false);
// disable editing while palette is filtered
b->enableEditing(text.isEmpty());
}
}