summaryrefslogtreecommitdiff
path: root/scripts/kconfig/qconf.cc
diff options
context:
space:
mode:
authorBoris Barbulovski <bbarbulovski@gmail.com>2015-09-22 21:36:35 +0300
committerMichal Marek <mmarek@suse.com>2015-10-14 15:59:04 +0300
commit76d53cbbae3fe29bfa92177e4bf3377fab176ec6 (patch)
tree533bfae7fa9d0bcfd26c79e6a74f193f805b252a /scripts/kconfig/qconf.cc
parente336b9f1325acb65121c6911f6f0bd057073db6a (diff)
downloadlinux-76d53cbbae3fe29bfa92177e4bf3377fab176ec6.tar.xz
Port xconfig to Qt5 - Add(back) one click checkbox toggle.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Thiago Macieira <thiago.macieira@intel.com> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r--scripts/kconfig/qconf.cc18
1 files changed, 17 insertions, 1 deletions
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);