QTfrontend: Fix flickering and bad offset of control config popup
authorWuzzy <almikes@aol.com>
Thu, 12 Oct 2017 20:17:00 +0200
changeset 12698 f2690a0ccf19
parent 12697 c71e330d5094
child 12699 608db0fb90f0
QTfrontend: Fix flickering and bad offset of control config popup If you opened the pop-up to change a key, there was a very short flicker at the left side and the pop-up had a bad offset which sometimes caused entries to be out of screen bounds.
QTfrontend/ui/widget/keybinder.cpp
--- a/QTfrontend/ui/widget/keybinder.cpp	Thu Oct 12 19:04:30 2017 +0200
+++ b/QTfrontend/ui/widget/keybinder.cpp	Thu Oct 12 20:17:00 2017 +0200
@@ -242,13 +242,12 @@
 {
     QComboBox * box = bindCellComboBoxMappings->value(item);
     QTableWidget * table = item->tableWidget();
-    QFrame * frame = box->findChild<QFrame*>();
 
+    box->move(
+        table->horizontalHeader()->sectionSize(0),
+        (table->verticalHeader()->defaultSectionSize() * (item->row() + 1)) - (box->height()) + 1
+    );
     box->showPopup();
-    frame->move(
-        frame->x() + table->horizontalHeader()->sectionSize(0),
-        frame->y() + (table->verticalHeader()->defaultSectionSize() * item->row())
-    );
 }
 
 // When a new row in a bind table is *selected*, this clears selection in any other table