forked from qt-creator/qt-creator
Apply ManhattanStyle to QCheckBox on a toolbar
And consolidate the palette setting code for QLabel, QSpinBox and QCheckBox. Change-Id: If0dea048e2341bcbb35c52eb394d4d01efef88be Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
@@ -288,7 +289,8 @@ void ManhattanStyle::polish(QWidget *widget)
|
|||||||
if (qobject_cast<QToolButton*>(widget) || qobject_cast<QLineEdit*>(widget)) {
|
if (qobject_cast<QToolButton*>(widget) || qobject_cast<QLineEdit*>(widget)) {
|
||||||
widget->setAttribute(Qt::WA_Hover);
|
widget->setAttribute(Qt::WA_Hover);
|
||||||
widget->setMaximumHeight(height - 2);
|
widget->setMaximumHeight(height - 2);
|
||||||
} else if (qobject_cast<QLabel*>(widget)) {
|
} else if (qobject_cast<QLabel*>(widget) || qobject_cast<QSpinBox*>(widget)
|
||||||
|
|| qobject_cast<QCheckBox*>(widget)) {
|
||||||
widget->setPalette(panelPalette(widget->palette(), lightColored(widget)));
|
widget->setPalette(panelPalette(widget->palette(), lightColored(widget)));
|
||||||
} else if (widget->property("panelwidget_singlerow").toBool()) {
|
} else if (widget->property("panelwidget_singlerow").toBool()) {
|
||||||
widget->setFixedHeight(height);
|
widget->setFixedHeight(height);
|
||||||
@@ -303,10 +305,6 @@ void ManhattanStyle::polish(QWidget *widget)
|
|||||||
widget->setPalette(palette);
|
widget->setPalette(palette);
|
||||||
widget->setMaximumHeight(height - 2);
|
widget->setMaximumHeight(height - 2);
|
||||||
widget->setAttribute(Qt::WA_Hover);
|
widget->setAttribute(Qt::WA_Hover);
|
||||||
} else if (qobject_cast<QSpinBox*>(widget)) {
|
|
||||||
const bool isLightColored = lightColored(widget);
|
|
||||||
QPalette palette = panelPalette(widget->palette(), isLightColored);
|
|
||||||
widget->setPalette(palette);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user