2 * Copyright (C) 2015 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef FLOATING_FLICKABLE_H
18#define FLOATING_FLICKABLE_H
21#include "UbuntuGesturesQmlGlobal.h"
24class DirectionalDragArea;
28 A Flickable that can be put in front of the item to be flicked and
29 still have the item-to-be-flicked receive input events that are not flicks.
31 Ie, it's a Flickable that, input-wise, is transparent to non-flick gestures.
33 With a regular Flickable you would have to make the item-to-be-flicked a child
34 of Flicakble to achieve the same result. FloatingFlickable has no such requirement
37class UBUNTUGESTURESQML_EXPORT FloatingFlickable : public QQuickItem {
40 Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
41 Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
42 Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
43 Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
45 Q_PROPERTY(Direction::Type direction READ direction WRITE setDirection NOTIFY directionChanged)
48 void contentWidthChanged();
49 void contentHeightChanged();
50 void contentXChanged();
51 void contentYChanged();
52 void directionChanged();
55 FloatingFlickable(QQuickItem *parent = nullptr);
57 qreal contentWidth() const;
58 void setContentWidth(qreal contentWidth);
60 qreal contentHeight() const;
61 void setContentHeight(qreal contentHeight);
63 qreal contentX() const;
64 void setContentX(qreal contentX);
66 qreal contentY() const;
67 void setContentY(qreal contentY);
69 Direction::Type direction() const;
70 void setDirection(Direction::Type);
73 void updateChildrenWidth();
74 void updateChildrenHeight();
75 void onDragAreaTouchPosChanged(qreal);
76 void onDragAreaDraggingChanged(bool value);
79 DirectionalDragArea *m_dragArea;
80 QQuickFlickable *m_flickable;
83 friend class tst_FloatingFlickable;
86#endif // FLOATING_FLICKABLE_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list