mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Read only checkbox style
This commit is contained in:
@@ -257,15 +257,18 @@ namespace BlackGui
|
|||||||
BLACK_VERIFY_X(checkBox, Q_FUNC_INFO, "no checkbox");
|
BLACK_VERIFY_X(checkBox, Q_FUNC_INFO, "no checkbox");
|
||||||
if (!checkBox) { return; }
|
if (!checkBox) { return; }
|
||||||
|
|
||||||
|
static const QString background("background: rgba(40,40,40)"); //! \todo hardcoded, should come from stylesheet
|
||||||
if (readOnly)
|
if (readOnly)
|
||||||
{
|
{
|
||||||
checkBox->setAttribute(Qt::WA_TransparentForMouseEvents);
|
checkBox->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
checkBox->setFocusPolicy(Qt::NoFocus);
|
checkBox->setFocusPolicy(Qt::NoFocus);
|
||||||
|
checkBox->setStyleSheet(background);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
checkBox->setAttribute(Qt::WA_TransparentForMouseEvents, defaultBox.testAttribute(Qt::WA_TransparentForMouseEvents));
|
checkBox->setAttribute(Qt::WA_TransparentForMouseEvents, defaultBox.testAttribute(Qt::WA_TransparentForMouseEvents));
|
||||||
checkBox->setFocusPolicy(defaultBox.focusPolicy());
|
checkBox->setFocusPolicy(defaultBox.focusPolicy());
|
||||||
|
checkBox->setStyleSheet("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user