Fix QPalette highlights not working for all macOS themes
This commit is contained in:
parent
69c1ae678d
commit
8137388364
4 changed files with 6 additions and 16 deletions
|
@ -65,6 +65,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
|
|||
- Metatile behaviors with no constant will now display their value in the Tileset Editor.
|
||||
- Fix incorrect limits on Floor Number and Border Width/Height in the New Map Options window.
|
||||
- Fix Border Width/Height being set to 0 when creating a new map from an existing layout.
|
||||
- Fix certain UI elements not highlighting red on some platforms.
|
||||
|
||||
## [4.5.0] - 2021-12-26
|
||||
### Added
|
||||
|
|
|
@ -265,14 +265,10 @@ void Editor::addNewWildMonGroup(QWidget *window) {
|
|||
lineEdit->setValidator(validator);
|
||||
connect(lineEdit, &QLineEdit::textChanged, [this, &lineEdit, &buttonBox](QString text){
|
||||
if (this->project->encounterGroupLabels.contains(text)) {
|
||||
QPalette palette = lineEdit->palette();
|
||||
QColor color = Qt::red;
|
||||
color.setAlpha(25);
|
||||
palette.setColor(QPalette::Base, color);
|
||||
lineEdit->setPalette(palette);
|
||||
lineEdit->setStyleSheet("QLineEdit { background-color: rgba(255, 0, 0, 25%) }");
|
||||
buttonBox.button(QDialogButtonBox::Ok)->setDisabled(true);
|
||||
} else {
|
||||
lineEdit->setPalette(QPalette());
|
||||
lineEdit->setStyleSheet("");
|
||||
buttonBox.button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -2590,9 +2590,7 @@ void MainWindow::on_pushButton_ChangeDimensions_clicked()
|
|||
}
|
||||
|
||||
QLabel *errorLabel = new QLabel();
|
||||
QPalette errorPalette;
|
||||
errorPalette.setColor(QPalette::WindowText, Qt::red);
|
||||
errorLabel->setPalette(errorPalette);
|
||||
errorLabel->setStyleSheet("QLabel { color: red }");
|
||||
errorLabel->setVisible(false);
|
||||
|
||||
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
#include <QPalette>
|
||||
#include <QStringList>
|
||||
|
||||
struct NewMapPopup::Settings NewMapPopup::settings = {};
|
||||
|
@ -228,13 +227,9 @@ void NewMapPopup::useLayout(QString layoutId) {
|
|||
|
||||
void NewMapPopup::on_lineEdit_NewMap_Name_textChanged(const QString &text) {
|
||||
if (project->mapNames.contains(text)) {
|
||||
QPalette palette = this->ui->lineEdit_NewMap_Name->palette();
|
||||
QColor color = Qt::red;
|
||||
color.setAlpha(25);
|
||||
palette.setColor(QPalette::Base, color);
|
||||
this->ui->lineEdit_NewMap_Name->setPalette(palette);
|
||||
this->ui->lineEdit_NewMap_Name->setStyleSheet("QLineEdit { background-color: rgba(255, 0, 0, 25%) }");
|
||||
} else {
|
||||
this->ui->lineEdit_NewMap_Name->setPalette(QPalette());
|
||||
this->ui->lineEdit_NewMap_Name->setStyleSheet("");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue