Show simple drop-down icon next to key binder widget
authorWuzzy <Wuzzy2@mail.ru>
Wed, 04 Apr 2018 19:33:19 +0200
changeset 13314 2bdae461ae5f
parent 13313 49bedbc76120
child 13315 af229e3d274a
Show simple drop-down icon next to key binder widget
QTfrontend/hedgewars.qrc
QTfrontend/res/dropdown_selected.png
QTfrontend/ui/widget/keybinder.cpp
--- a/QTfrontend/hedgewars.qrc	Wed Apr 04 18:38:00 2018 +0200
+++ b/QTfrontend/hedgewars.qrc	Wed Apr 04 19:33:19 2018 +0200
@@ -83,6 +83,7 @@
         <file>res/Settings.png</file>
         <file>res/dropdown.png</file>
         <file>res/dropdown_disabled.png</file>
+        <file>res/dropdown_selected.png</file>
         <file>res/new.png</file>
         <file>res/edit.png</file>
         <file>res/delete.png</file>
Binary file QTfrontend/res/dropdown_selected.png has changed
--- a/QTfrontend/ui/widget/keybinder.cpp	Wed Apr 04 18:38:00 2018 +0200
+++ b/QTfrontend/ui/widget/keybinder.cpp	Wed Apr 04 19:33:19 2018 +0200
@@ -180,6 +180,12 @@
         curTable->insertRow(row);
         curTable->setItem(row, 0, nameCell);
         QTableWidgetItem * bindCell = new QTableWidgetItem(comboBox->currentText());
+        QIcon dropDownIcon = QIcon();
+        QPixmap dd1 = QPixmap(":/res/dropdown.png");
+        QPixmap dd2 = QPixmap(":/res/dropdown_selected.png");
+        dropDownIcon.addPixmap(dd1, QIcon::Normal);
+        dropDownIcon.addPixmap(dd2, QIcon::Selected);
+        bindCell->setIcon(dropDownIcon);
         bindCell->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
         curTable->setItem(row, 1, bindCell);
         curTable->resizeColumnsToContents();