From 76d53cbbae3fe29bfa92177e4bf3377fab176ec6 Mon Sep 17 00:00:00 2001 From: Boris Barbulovski Date: Tue, 22 Sep 2015 11:36:35 -0700 Subject: Port xconfig to Qt5 - Add(back) one click checkbox toggle. Signed-off-by: Boris Barbulovski Signed-off-by: Thiago Macieira Signed-off-by: Michal Marek --- scripts/kconfig/qconf.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'scripts/kconfig/qconf.cc') diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index b03cfadbd9ef..ca22676da4a9 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -776,10 +776,26 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e) menu = item->menu; x = header()->offset() + p.x(); - idx = header()->sectionPosition(x); + idx = header()->logicalIndexAt(x); switch (idx) { case promptColIdx: icon = item->pixmap(promptColIdx); + if (!icon.isNull()) { + int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly. + if (x >= off && x < off + icon.availableSizes().first().width()) { + if (item->goParent) { + emit parentSelected(); + break; + } else if (!menu) + break; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) + emit menuSelected(menu); + else + changeValue(item); + } + } break; case noColIdx: setValue(item, no); -- cgit v1.2.3