Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -776,10 +776,26 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e) · 775 unmodified lines | ||
| 776 | 776 | |
| 777 | 777 | menu = item->menu; |
| 778 | 778 | x = header()->offset() + p.x(); |
| 779 | − idx = header()->sectionPosition(x); | |
| 779 | + idx = header()->logicalIndexAt(x); | |
| 780 | 780 | switch (idx) { |
| 781 | 781 | case promptColIdx: |
| 782 | 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 | 799 | break; |
| 784 | 800 | case noColIdx: |
| 785 | 801 | setValue(item, no); |