History

Port xconfig to Qt5 - Add(back) one click checkbox toggle.

Boris Barbulovski committed 11 years ago

Commit 76d53cb1 parent e336b9f1 file · +17 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/qconf.cc+17−1
@@ -776,10 +776,26 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e) · 775 unmodified lines
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);