Skip to content

Commit

Permalink
Port xconfig to Qt5 - Add(back) one click checkbox toggle.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Boris Barbulovski authored and Michal Marek committed Oct 14, 2015
1 parent e336b9f commit 76d53cb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 76d53cb

Please sign in to comment.