mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Use style sheet for login model string field, remove hardcoded values
This commit is contained in:
committed by
Mat Sutcliffe
parent
73e566a76e
commit
970a7a0af8
@@ -763,22 +763,10 @@ namespace BlackGui
|
||||
|
||||
void CLoginComponent::highlightModelField(const CAircraftModel &model)
|
||||
{
|
||||
static const QString error("rgba(255, 0, 0, 40%)");
|
||||
static const QString warning("rgba(255, 255, 0, 40%)");
|
||||
static const QString ok("rgba(0, 255, 0, 40%)");
|
||||
QString color(ok);
|
||||
if (!model.hasModelString())
|
||||
{
|
||||
color = error;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!model.isLoadedFromDb())
|
||||
{
|
||||
color = warning;
|
||||
}
|
||||
}
|
||||
ui->le_SimulatorModel->setStyleSheet(QStringLiteral("background-color: %1;").arg(color));
|
||||
if (!model.hasModelString()) { ui->le_SimulatorModel->setProperty("validation", "error"); }
|
||||
else if (!model.isLoadedFromDb()) { ui->le_SimulatorModel->setProperty("validation", "warning"); }
|
||||
else { ui->le_SimulatorModel->setProperty("validation", "ok"); }
|
||||
ui->le_SimulatorModel->setStyleSheet(""); // force update
|
||||
}
|
||||
|
||||
bool CLoginComponent::isVatsimNetworkTabSelected() const
|
||||
|
||||
@@ -330,6 +330,10 @@ QLineEdit:disabled {
|
||||
border: 1px solid rgba(50,50,50);
|
||||
}
|
||||
|
||||
QLineEdit[validation="error"] { border: 2px solid red; }
|
||||
QLineEdit[validation="warning"] { border: 2px solid yellow; }
|
||||
QLineEdit[validation="ok"] { border: 2px solid green; }
|
||||
|
||||
QTextEdit {
|
||||
border: 1px solid green;
|
||||
background: transparent;
|
||||
|
||||
Reference in New Issue
Block a user