Skip to content

Commit fa8de0a

Browse files
committed
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 <[email protected]>
1 parent 5cb255f commit fa8de0a

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

scripts/kconfig/qconf.cc

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

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

903903
ConfigView*ConfigView::viewList;

0 commit comments

Comments
 (0)