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

@@ -6,15 +6,15 @@
*
* This file is part of the 86Box distribution.
*
* Device configuration UI code.
* Keybind dialog
*
*
*
* Authors: Joakim L. Gilje <jgilje@jgilje.net>
* Authors: Cathode Ray Dude
* Cacodemon345
*
* Copyright 2021 Joakim L. Gilje
* Copyright 2022 Cacodemon345
* Copyright 2025 Cathode Ray Dude
* Copyright 2025 Cacodemon345
*/
#include "qt_keybind.hpp"
#include "ui_qt_keybind.h"
@@ -85,12 +85,13 @@ bool KeyBinder::eventFilter(QObject *obj, QEvent *event)
}
QKeySequence
KeyBinder::BindKey(QString CurValue)
KeyBinder::BindKey(QWidget* widget, QString CurValue)
{
KeyBinder kb;
KeyBinder kb(widget);
kb.setWindowTitle("Bind Key");
kb.setFixedSize(kb.minimumSizeHint());
kb.findChild<QKeySequenceEdit*>()->setKeySequence(QKeySequence::fromString(CurValue));
kb.setEnabled(true);
if (kb.exec() == QDialog::Accepted) {
QKeySequenceEdit *seq = kb.findChild<QKeySequenceEdit*>();