1
0
Fork 0

kconfig: qconf: do not limit the pop-up menu to the first row

If you right-click the first row in the option tree, the pop-up menu
shows up, but if you right-click the second row or below, the event
is ignored due to the following check:

  if (e->y() <= header()->geometry().bottom()) {

Perhaps, the intention was to show the pop-menu only when the tree
header was right-clicked, but this handler is not called in that case.

Since the origin of e->y() starts from the bottom of the header,
this check is odd.

Going forward, you can right-click anywhere in the tree to get the
pop-up menu.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
zero-sugar-mainline-defconfig
Masahiro Yamada 2020-08-07 18:19:08 +09:00
parent 5cb255ffa1
commit fa8de0a3bf
1 changed files with 33 additions and 33 deletions

View File

@ -864,40 +864,40 @@ void ConfigList::focusInEvent(QFocusEvent *e)
void ConfigList::contextMenuEvent(QContextMenuEvent *e) void ConfigList::contextMenuEvent(QContextMenuEvent *e)
{ {
if (e->y() <= header()->geometry().bottom()) { if (!headerPopup) {
if (!headerPopup) { QAction *action;
QAction *action;
headerPopup = new QMenu(this); headerPopup = new QMenu(this);
action = new QAction("Show Name", this); action = new QAction("Show Name", this);
action->setCheckable(true); action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)), connect(action, SIGNAL(toggled(bool)),
parent(), SLOT(setShowName(bool))); parent(), SLOT(setShowName(bool)));
connect(parent(), SIGNAL(showNameChanged(bool)), connect(parent(), SIGNAL(showNameChanged(bool)),
action, SLOT(setOn(bool))); action, SLOT(setOn(bool)));
action->setChecked(showName); action->setChecked(showName);
headerPopup->addAction(action); headerPopup->addAction(action);
action = new QAction("Show Range", this);
action->setCheckable(true); action = new QAction("Show Range", this);
connect(action, SIGNAL(toggled(bool)), action->setCheckable(true);
parent(), SLOT(setShowRange(bool))); connect(action, SIGNAL(toggled(bool)),
connect(parent(), SIGNAL(showRangeChanged(bool)), parent(), SLOT(setShowRange(bool)));
action, SLOT(setOn(bool))); connect(parent(), SIGNAL(showRangeChanged(bool)),
action->setChecked(showRange); action, SLOT(setOn(bool)));
headerPopup->addAction(action); action->setChecked(showRange);
action = new QAction("Show Data", this); headerPopup->addAction(action);
action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)), action = new QAction("Show Data", this);
parent(), SLOT(setShowData(bool))); action->setCheckable(true);
connect(parent(), SIGNAL(showDataChanged(bool)), connect(action, SIGNAL(toggled(bool)),
action, SLOT(setOn(bool))); parent(), SLOT(setShowData(bool)));
action->setChecked(showData); connect(parent(), SIGNAL(showDataChanged(bool)),
headerPopup->addAction(action); action, SLOT(setOn(bool)));
} action->setChecked(showData);
headerPopup->exec(e->globalPos()); headerPopup->addAction(action);
e->accept(); }
} else
e->ignore(); headerPopup->exec(e->globalPos());
e->accept();
} }
ConfigView*ConfigView::viewList; ConfigView*ConfigView::viewList;