Fix background color error for invalid autotype shortcut

This commit is contained in:
xboxones1 2025-03-31 13:47:16 +00:00
parent af2479da8d
commit 9a476167f9

View file

@ -30,6 +30,7 @@
#include "gui/Icons.h" #include "gui/Icons.h"
#include "gui/MainWindow.h" #include "gui/MainWindow.h"
#include "gui/osutils/OSUtils.h" #include "gui/osutils/OSUtils.h"
#include "gui/styles/StateColorPalette.h"
#include "quickunlock/QuickUnlockInterface.h" #include "quickunlock/QuickUnlockInterface.h"
#include "FileDialog.h" #include "FileDialog.h"
@ -155,7 +156,9 @@ ApplicationSettingsWidget::ApplicationSettingsWidget(QWidget* parent)
m_generalUi->autoTypeShortcutWidget->setStyleSheet(""); m_generalUi->autoTypeShortcutWidget->setStyleSheet("");
} else { } else {
QToolTip::showText(mapToGlobal(rect().bottomLeft()), error); QToolTip::showText(mapToGlobal(rect().bottomLeft()), error);
m_generalUi->autoTypeShortcutWidget->setStyleSheet("background-color: #FF9696;"); StateColorPalette statePalette;
auto color = statePalette.color(StateColorPalette::ColorRole::Error);
m_generalUi->autoTypeShortcutWidget->setStyleSheet(QString("QLineEdit { background: %1; }").arg(color.name()));
} }
}); });
connect(m_generalUi->autoTypeShortcutWidget, &ShortcutWidget::shortcutReset, this, [this] { connect(m_generalUi->autoTypeShortcutWidget, &ShortcutWidget::shortcutReset, this, [this] {