diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-02-13 17:05:16 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-04-23 06:15:58 +0000 |
commit | 5adce042aa8c75970eef4cc8a5492b8d644ffcf7 (patch) | |
tree | a0afbc94a2ffb7e05b1cfd111ec8256cdff82d77 /src/quicktemplates2/qquickcontrol_p_p.h | |
parent | 2c16d86b4b839eb8958c3bb210f0682a27618d48 (diff) |
Control: add support for background insets
[ChangeLog][Controls][Control] Added topInset, bottomInset, leftInset,
and rightInset properties to control the geometry of the background
similarly to how paddings control the geometry of the contentItem.
Task-number: QTBUG-60156
Change-Id: Id8228d32f6a5fffeb771964a153ee062a5a083b5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickcontrol_p_p.h')
-rw-r--r-- | src/quicktemplates2/qquickcontrol_p_p.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickcontrol_p_p.h b/src/quicktemplates2/qquickcontrol_p_p.h index f1873da9..757452a6 100644 --- a/src/quicktemplates2/qquickcontrol_p_p.h +++ b/src/quicktemplates2/qquickcontrol_p_p.h @@ -107,6 +107,17 @@ public: void setHorizontalPadding(qreal value, bool reset = false); void setVerticalPadding(qreal value, bool reset = false); + inline QMarginsF getInset() const { return QMarginsF(getLeftInset(), getTopInset(), getRightInset(), getBottomInset()); } + inline qreal getTopInset() const { return extra.isAllocated() ? extra->topInset : 0; } + inline qreal getLeftInset() const { return extra.isAllocated() ? extra->leftInset : 0; } + inline qreal getRightInset() const { return extra.isAllocated() ? extra->rightInset : 0; } + inline qreal getBottomInset() const { return extra.isAllocated() ? extra->bottomInset : 0; } + + void setTopInset(qreal value, bool reset = false); + void setLeftInset(qreal value, bool reset = false); + void setRightInset(qreal value, bool reset = false); + void setBottomInset(qreal value, bool reset = false); + void resizeBackground(); virtual void resizeContent(); @@ -180,10 +191,18 @@ public: bool hasRightPadding; bool hasBottomPadding; bool hasBaselineOffset; + bool hasTopInset; + bool hasLeftInset; + bool hasRightInset; + bool hasBottomInset; qreal topPadding; qreal leftPadding; qreal rightPadding; qreal bottomPadding; + qreal topInset; + qreal leftInset; + qreal rightInset; + qreal bottomInset; QFont requestedFont; QPalette requestedPalette; }; |