Keybind UI fixes

1. Don't clear the description text cell if selected; clear the actual keybind text instead.
2. Header texts are now correct.
3. Make the keybind dialog model and usable with dark mode
This commit is contained in:
Cacodemon345
2025-04-21 14:46:21 +06:00
parent a434a98495
commit 46546f2032
3 changed files with 11 additions and 10 deletions

View File

@@ -63,7 +63,7 @@ SettingsInput::SettingsInput(QWidget *parent)
keyTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
QStringList headers;
//headers << "Action" << "Bound key";
keyTable->setHorizontalHeaderLabels(headers);
keyTable->setHorizontalHeaderLabels(horizontalHeader);
keyTable->verticalHeader()->setVisible(false);
keyTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
keyTable->setSelectionBehavior(QAbstractItemView::SelectRows);
@@ -201,7 +201,7 @@ SettingsInput::on_tableKeys_doubleClicked(int row, int col)
QTableWidgetItem *cell = ui->tableKeys->item(row,1);
if (!cell) return;
QKeySequence keyseq = KeyBinder::BindKey(cell->text());
QKeySequence keyseq = KeyBinder::BindKey(this, cell->text());
if (keyseq != false) {
// If no change was made, don't change anything.
if (keyseq.toString(QKeySequence::NativeText) == cell->text()) return;
@@ -247,7 +247,7 @@ void
SettingsInput::on_pushButtonClearBind_Clicked()
{
// Wipe bind
QTableWidgetItem *cell = ui->tableKeys->currentItem();
QTableWidgetItem *cell = ui->tableKeys->item(ui->tableKeys->currentRow(), 1);
if (!cell) return;
cell->setText("");