mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +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)
|
void CLoginComponent::highlightModelField(const CAircraftModel &model)
|
||||||
{
|
{
|
||||||
static const QString error("rgba(255, 0, 0, 40%)");
|
if (!model.hasModelString()) { ui->le_SimulatorModel->setProperty("validation", "error"); }
|
||||||
static const QString warning("rgba(255, 255, 0, 40%)");
|
else if (!model.isLoadedFromDb()) { ui->le_SimulatorModel->setProperty("validation", "warning"); }
|
||||||
static const QString ok("rgba(0, 255, 0, 40%)");
|
else { ui->le_SimulatorModel->setProperty("validation", "ok"); }
|
||||||
QString color(ok);
|
ui->le_SimulatorModel->setStyleSheet(""); // force update
|
||||||
if (!model.hasModelString())
|
|
||||||
{
|
|
||||||
color = error;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!model.isLoadedFromDb())
|
|
||||||
{
|
|
||||||
color = warning;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ui->le_SimulatorModel->setStyleSheet(QStringLiteral("background-color: %1;").arg(color));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CLoginComponent::isVatsimNetworkTabSelected() const
|
bool CLoginComponent::isVatsimNetworkTabSelected() const
|
||||||
|
|||||||
@@ -330,6 +330,10 @@ QLineEdit:disabled {
|
|||||||
border: 1px solid rgba(50,50,50);
|
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 {
|
QTextEdit {
|
||||||
border: 1px solid green;
|
border: 1px solid green;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|||||||
Reference in New Issue
Block a user