Skip to content

Commit f0a4033

Browse files
masahir0ygregkh
authored andcommitted
kconfig: qconf: do not limit the pop-up menu to the first row
[ Upstream commit fa8de0a ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e9701d5 commit f0a4033

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

scripts/kconfig/qconf.cc

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -869,40 +869,40 @@ void ConfigList::focusInEvent(QFocusEvent *e)
869869

870870
void ConfigList::contextMenuEvent(QContextMenuEvent *e)
871871
{
872-
if (e->y() <= header()->geometry().bottom()) {
873-
if (!headerPopup) {
874-
QAction *action;
875-
876-
headerPopup = new QMenu(this);
877-
action = new QAction("Show Name", this);
878-
action->setCheckable(true);
879-
connect(action, SIGNAL(toggled(bool)),
880-
parent(), SLOT(setShowName(bool)));
881-
connect(parent(), SIGNAL(showNameChanged(bool)),
882-
action, SLOT(setOn(bool)));
883-
action->setChecked(showName);
884-
headerPopup->addAction(action);
885-
action = new QAction("Show Range", this);
886-
action->setCheckable(true);
887-
connect(action, SIGNAL(toggled(bool)),
888-
parent(), SLOT(setShowRange(bool)));
889-
connect(parent(), SIGNAL(showRangeChanged(bool)),
890-
action, SLOT(setOn(bool)));
891-
action->setChecked(showRange);
892-
headerPopup->addAction(action);
893-
action = new QAction("Show Data", this);
894-
action->setCheckable(true);
895-
connect(action, SIGNAL(toggled(bool)),
896-
parent(), SLOT(setShowData(bool)));
897-
connect(parent(), SIGNAL(showDataChanged(bool)),
898-
action, SLOT(setOn(bool)));
899-
action->setChecked(showData);
900-
headerPopup->addAction(action);
901-
}
902-
headerPopup->exec(e->globalPos());
903-
e->accept();
904-
} else
905-
e->ignore();
872+
if (!headerPopup) {
873+
QAction *action;
874+
875+
headerPopup = new QMenu(this);
876+
action = new QAction("Show Name", this);
877+
action->setCheckable(true);
878+
connect(action, SIGNAL(toggled(bool)),
879+
parent(), SLOT(setShowName(bool)));
880+
connect(parent(), SIGNAL(showNameChanged(bool)),
881+
action, SLOT(setOn(bool)));
882+
action->setChecked(showName);
883+
headerPopup->addAction(action);
884+
885+
action = new QAction("Show Range", this);
886+
action->setCheckable(true);
887+
connect(action, SIGNAL(toggled(bool)),
888+
parent(), SLOT(setShowRange(bool)));
889+
connect(parent(), SIGNAL(showRangeChanged(bool)),
890+
action, SLOT(setOn(bool)));
891+
action->setChecked(showRange);
892+
headerPopup->addAction(action);
893+
894+
action = new QAction("Show Data", this);
895+
action->setCheckable(true);
896+
connect(action, SIGNAL(toggled(bool)),
897+
parent(), SLOT(setShowData(bool)));
898+
connect(parent(), SIGNAL(showDataChanged(bool)),
899+
action, SLOT(setOn(bool)));
900+
action->setChecked(showData);
901+
headerPopup->addAction(action);
902+
}
903+
904+
headerPopup->exec(e->globalPos());
905+
e->accept();
906906
}
907907

908908
ConfigView*ConfigView::viewList;

0 commit comments

Comments
 (0)