diff options
author | Boris Barbulovski <bbarbulovski@gmail.com> | 2015-09-22 14:36:35 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.com> | 2015-10-14 08:59:04 -0400 |
commit | 76d53cbbae3fe29bfa92177e4bf3377fab176ec6 (patch) | |
tree | 533bfae7fa9d0bcfd26c79e6a74f193f805b252a /scripts | |
parent | e336b9f1325acb65121c6911f6f0bd057073db6a (diff) |
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')
-rw-r--r-- | scripts/kconfig/qconf.cc | 18 |
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) | |||
776 | 776 | ||
777 | menu = item->menu; | 777 | menu = item->menu; |
778 | x = header()->offset() + p.x(); | 778 | x = header()->offset() + p.x(); |
779 | idx = header()->sectionPosition(x); | 779 | idx = header()->logicalIndexAt(x); |
780 | switch (idx) { | 780 | switch (idx) { |
781 | case promptColIdx: | 781 | case promptColIdx: |
782 | icon = item->pixmap(promptColIdx); | 782 | icon = item->pixmap(promptColIdx); |
783 | if (!icon.isNull()) { | ||
784 | int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly. | ||
785 | if (x >= off && x < off + icon.availableSizes().first().width()) { | ||
786 | if (item->goParent) { | ||
787 | emit parentSelected(); | ||
788 | break; | ||
789 | } else if (!menu) | ||
790 | break; | ||
791 | ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; | ||
792 | if (ptype == P_MENU && rootEntry != menu && | ||
793 | mode != fullMode && mode != menuMode) | ||
794 | emit menuSelected(menu); | ||
795 | else | ||
796 | changeValue(item); | ||
797 | } | ||
798 | } | ||
783 | break; | 799 | break; |
784 | case noColIdx: | 800 | case noColIdx: |
785 | setValue(item, no); | 801 | setValue(item, no); |