diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-03 01:44:39 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-03 01:44:39 +0100 |
| commit | e96a1f3ced974b5d1b02907bf9feabca97d2baa9 (patch) | |
| tree | cce4230f65796a2a19656021b06072f096328ffc /src/moapplication.cpp | |
| parent | c8eb3f6e052852fc8440efe2f8257119a714789e (diff) | |
Fix indentation of indicators branches when using collapsible separators.
Diffstat (limited to 'src/moapplication.cpp')
| -rw-r--r-- | src/moapplication.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/moapplication.cpp b/src/moapplication.cpp index 15fbdb3c..709bcbda 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -60,13 +60,13 @@ using namespace MOShared; //
class ProxyStyle : public QProxyStyle {
public:
- ProxyStyle(QStyle *baseStyle = 0)
+ ProxyStyle(QStyle* baseStyle = 0)
: QProxyStyle(baseStyle)
{
}
- void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const {
- if(element == QStyle::PE_IndicatorItemViewItemDrop) {
+ void drawPrimitive(PrimitiveElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const {
+ if (element == QStyle::PE_IndicatorItemViewItemDrop) {
// 1. full-width drop indicator
QRect rect(option->rect);
@@ -85,7 +85,7 @@ public: painter->setPen(pen);
painter->setBrush(QBrush(col));
- if(rect.height() == 0) {
+ if (rect.height() == 0) {
QPoint tri[3] = {
rect.topLeft(),
rect.topLeft() + QPoint(-5, 5),
@@ -93,13 +93,16 @@ public: };
painter->drawPolygon(tri, 3);
painter->drawLine(QPoint(rect.topLeft().x(), rect.topLeft().y()), rect.topRight());
- } else {
+ }
+ else {
painter->drawRoundedRect(rect, 5, 5);
}
- } else {
+ }
+ else {
QProxyStyle::drawPrimitive(element, option, painter, widget);
}
}
+
};
@@ -535,8 +538,8 @@ bool MOApplication::notify(QObject* receiver, QEvent* event) void MOApplication::updateStyle(const QString& fileName)
{
if (QStyleFactory::keys().contains(fileName)) {
- setStyle(QStyleFactory::create(fileName));
setStyleSheet("");
+ setStyle(new ProxyStyle(QStyleFactory::create(fileName)));
} else {
setStyle(new ProxyStyle(QStyleFactory::create(m_DefaultStyle)));
if (QFile::exists(fileName)) {
|
