Skip to content

Commit a977c93

Browse files
committed
Theme: default paddings exposed from attached type
1 parent bf7f40d commit a977c93

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

ui/StatusQ/include/StatusQ/theme.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ class Theme : public QQuickAttachedPropertyPropagator
1111
Q_OBJECT
1212

1313
Q_PROPERTY(qreal defaultPadding READ defaultPadding CONSTANT)
14+
15+
Q_PROPERTY(qreal defaultXlPadding READ defaultXlPadding CONSTANT)
16+
Q_PROPERTY(qreal defaultBigPadding READ defaultBigPadding CONSTANT)
17+
Q_PROPERTY(qreal defaultHalfPadding READ defaultHalfPadding CONSTANT)
18+
Q_PROPERTY(qreal defaultSmallPadding READ defaultSmallPadding CONSTANT)
19+
1420
Q_PROPERTY(qreal padding READ padding WRITE setPadding
1521
RESET resetPadding NOTIFY paddingChanged)
1622
Q_PROPERTY(qreal xlPadding READ xlPadding NOTIFY paddingChanged)
@@ -64,6 +70,11 @@ class Theme : public QQuickAttachedPropertyPropagator
6470

6571
// paddings
6672
qreal defaultPadding() const;
73+
qreal defaultXlPadding() const;
74+
qreal defaultBigPadding() const;
75+
qreal defaultHalfPadding() const;
76+
qreal defaultSmallPadding() const;
77+
6778
qreal padding() const;
6879
qreal xlPadding() const;
6980
qreal bigPadding() const;

ui/StatusQ/src/theme.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ qreal Theme::defaultPadding() const {
3333
return s_defaultPadding;
3434
}
3535

36+
qreal Theme::defaultXlPadding() const {
37+
return s_defaultPadding * s_xlPaddingFactor;
38+
}
39+
40+
qreal Theme::defaultBigPadding() const {
41+
return s_defaultPadding * s_bigPaddingFactor;
42+
}
43+
44+
qreal Theme::defaultHalfPadding() const {
45+
return s_defaultPadding * s_halfPaddingFactor;
46+
}
47+
48+
qreal Theme::defaultSmallPadding() const {
49+
return s_defaultPadding * s_smallPaddingFactor;
50+
}
51+
3652
qreal Theme::padding() const {
3753
return m_padding;
3854
}

0 commit comments

Comments
 (0)