aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollbar_p_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-11-01 15:25:38 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-11-03 17:04:09 +0000
commit9e1b044afa994cdd77fd256cea78cd144e804d76 (patch)
tree396019ecd2f4ee64e2285465e83051ab237c5391 /src/quicktemplates2/qquickscrollbar_p_p.h
parent043e3d24f9306c18af97156ec613bb64a9dc0d91 (diff)
ScrollBar: allow configuring the minimum size
The existing size and position properties cannot be changed, because then they won't match with Flickable::visibleArea and we get major problems connecting the two. Thus, the effective visible position and size are provided as separate properties. [ChangeLog][Controls][ScrollBar] Added minimumSize, visualSize, and visualPosition properties. Task-number: QTBUG-56557 Change-Id: I923a74e5f6db7013b30fc2bef35e3d01282d5d98 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickscrollbar_p_p.h')
-rw-r--r--src/quicktemplates2/qquickscrollbar_p_p.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickscrollbar_p_p.h b/src/quicktemplates2/qquickscrollbar_p_p.h
index 431bb383..384348b4 100644
--- a/src/quicktemplates2/qquickscrollbar_p_p.h
+++ b/src/quicktemplates2/qquickscrollbar_p_p.h
@@ -68,6 +68,17 @@ public:
return bar->d_func();
}
+ struct VisualArea
+ {
+ VisualArea(qreal pos, qreal sz)
+ : position(pos), size(sz) { }
+ qreal position;
+ qreal size;
+ };
+ VisualArea visualArea() const;
+
+ qreal logicalPosition(qreal position) const;
+
qreal snapPosition(qreal position) const;
qreal positionAt(const QPointF &point) const;
void setInteractive(bool interactive);
@@ -79,10 +90,13 @@ public:
void handleRelease(const QPointF &point) override;
void handleUngrab() override;
+ void visualAreaChange(const VisualArea &newVisualArea, const VisualArea &oldVisualArea);
+
qreal size;
qreal position;
qreal stepSize;
qreal offset;
+ qreal minimumSize;
bool active;
bool pressed;
bool moving;