Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1230717 > unrolled thread

[PATCH 35/39] Port xconfig to Qt5 - Add(back) one click checkbox toggle.

Started byThiago Macieira <thiago.macieira@intel.com>
First post2015-09-22 20:40 +0200
Last post2015-09-22 20:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 35/39] Port xconfig to Qt5 - Add(back) one click checkbox toggle. Thiago Macieira <thiago.macieira@intel.com> - 2015-09-22 20:40 +0200

#1230717 — [PATCH 35/39] Port xconfig to Qt5 - Add(back) one click checkbox toggle.

FromThiago Macieira <thiago.macieira@intel.com>
Date2015-09-22 20:40 +0200
Subject[PATCH 35/39] Port xconfig to Qt5 - Add(back) one click checkbox toggle.
Message-ID<qbADV-561-65@gated-at.bofh.it>
From: Boris Barbulovski <bbarbulovski@gmail.com>

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
---
 scripts/kconfig/qconf.cc | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 455969c..a46aac7 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -779,10 +779,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);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web