From patchwork Tue Sep 22 18:36:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Macieira X-Patchwork-Id: 7243551 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9C216BEEC1 for ; Tue, 22 Sep 2015 18:38:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CFC07209B6 for ; Tue, 22 Sep 2015 18:38:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E05A9209C4 for ; Tue, 22 Sep 2015 18:38:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759070AbbIVShb (ORCPT ); Tue, 22 Sep 2015 14:37:31 -0400 Received: from mga14.intel.com ([192.55.52.115]:8362 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758000AbbIVSg4 (ORCPT ); Tue, 22 Sep 2015 14:36:56 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 22 Sep 2015 11:36:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,574,1437462000"; d="scan'208";a="650218064" Received: from tjmaciei-mobl4.jf.intel.com ([10.7.197.224]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2015 11:36:43 -0700 From: Thiago Macieira To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Michal Marek , Boris Barbulovski Subject: [PATCH 35/39] Port xconfig to Qt5 - Add(back) one click checkbox toggle. Date: Tue, 22 Sep 2015 11:36:35 -0700 Message-Id: <1442946999-37018-36-git-send-email-thiago.macieira@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442946999-37018-1-git-send-email-thiago.macieira@intel.com> References: <1442946999-37018-1-git-send-email-thiago.macieira@intel.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Boris Barbulovski Signed-off-by: Boris Barbulovski Signed-off-by: Thiago Macieira --- 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);