on xenial help sign in
drop spreadflickable. It has been replaced by FloatingFlickable
3cea423Michael Zanetti
plugins/Utils/CMakeLists.txt−1
@@ -21,7 +21,6 @@ set(QMLPLUGIN_SRC
21 windowkeysfilter.cpp
21 windowkeysfilter.cpp
22 easingcurve.cpp
22 easingcurve.cpp
23 windowstatestorage.cpp
23 windowstatestorage.cpp
24− spreadflickable.cpp
25 plugin.cpp
24 plugin.cpp
26 )
25 )
27
26
plugins/Utils/plugin.cpp−2
@@ -33,7 +33,6 @@
33#include "windowkeysfilter.h"
33#include "windowkeysfilter.h"
34#include "easingcurve.h"
34#include "easingcurve.h"
35#include "windowstatestorage.h"
35#include "windowstatestorage.h"
36−#include "spreadflickable.h"
37#include "constants.h"
36#include "constants.h"
38
37
39static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
38static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
@@ -65,7 +64,6 @@ void UtilsPlugin::registerTypes(const char *uri)
65 qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
64 qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
66 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
65 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
67 qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");
66 qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");
68− qmlRegisterType<SpreadFlickable>(uri, 0, 1, "SpreadFlickable");
69 qmlRegisterSingletonType<Constants>(uri, 0, 1, "Constants", createConstants);
67 qmlRegisterSingletonType<Constants>(uri, 0, 1, "Constants", createConstants);
70}
68}
71
69
plugins/Utils/spreadflickable.cppdeleted−66
@@ -1,66 +0,0 @@
1−#include "spreadflickable.h"
2−
3−SpreadFlickable::SpreadFlickable(QQuickItem *parent):
4− QQuickItem(parent),
5− m_mousePressed(false),
6− m_touchPressed(false)
7−{
8− m_flickable = new QQuickFlickable(this);
9− m_flickable->installEventFilter(this);
10− connect(m_flickable, &QQuickFlickable::contentWidthChanged, this, &SpreadFlickable::contentWidthChanged);
11− connect(m_flickable, &QQuickFlickable::contentXChanged, this, &SpreadFlickable::contentXChanged);
12−
13− connect(this, &QQuickItem::heightChanged, this, &SpreadFlickable::slotHeightChanged);
14− connect(this, &QQuickItem::widthChanged, this, &SpreadFlickable::slotWidthChanged);
15−}
16−
17−qreal SpreadFlickable::contentWidth() const
18−{
19− return m_flickable->contentWidth();
20−}
21−
22−void SpreadFlickable::setContentWidth(qreal contentWidth)
23−{
24− m_flickable->setContentWidth(contentWidth);
25−}
26−
27−qreal SpreadFlickable::contentX() const
28−{
29− return m_flickable->contentX();
30−}
31−
32−void SpreadFlickable::setContentX(qreal contentX)
33−{
34− m_flickable->setContentX(contentX);
35−}
36−
37−void SpreadFlickable::slotHeightChanged()
38−{
39− m_flickable->setHeight(height());
40−}
41−
42−void SpreadFlickable::slotWidthChanged()
43−{
44− m_flickable->setWidth(width());
45−}
46−
47−bool SpreadFlickable::eventFilter(QObject* /*watched*/, QEvent *event)
48−{
49− //m_flickable->eventFilter(watched, event);
50− switch (event->type()) {
51− case QEvent::TouchBegin:
52− break;
53− case QEvent::TouchEnd:
54− break;
55− case QEvent::MouseButtonPress:
56− break;
57− case QEvent::MouseButtonRelease:
58− break;
59− default:
60− // Not interested
61− break;
62− }
63−
64− // We never filter them out. We are just watching.
65− return false;
66−}
plugins/Utils/spreadflickable.hdeleted−37
@@ -1,37 +0,0 @@
1−#include <QQuickItem>
2−#include <private/qquickflickable_p.h>
3−
4−class SpreadFlickable: public QQuickItem
5−{
6− Q_OBJECT
7− Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
8− Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
9−
10−public:
11− SpreadFlickable(QQuickItem *parent = nullptr);
12−
13− qreal contentWidth() const;
14− void setContentWidth(qreal contentWidth);
15−
16− qreal contentX() const;
17− void setContentX(qreal contentX);
18−
19− bool eventFilter(QObject* /*watched*/, QEvent *event) override;
20−
21−Q_SIGNALS:
22− void contentWidthChanged();
23− void contentXChanged();
24−
25−private Q_SLOTS:
26− void slotHeightChanged();
27− void slotWidthChanged();
28−
29−private:
30− void setMousePressed(bool value);
31− void setTouchPressed(bool value);
32−
33− bool m_mousePressed;
34− bool m_touchPressed;
35−
36− QQuickFlickable *m_flickable;
37−};
qml/Stages/DesktopStage.qml+2−2
@@ -148,7 +148,7 @@ Rectangle {
148
148
149 property int highlightedIndex: -1
149 property int highlightedIndex: -1
150
150
151− delegate: Item {
151+ delegate: FocusScope {
152 id: appDelegate
152 id: appDelegate
153 z: ApplicationManager.count - index
153 z: ApplicationManager.count - index
154 y: units.gu(3)
154 y: units.gu(3)
@@ -159,7 +159,7 @@ Rectangle {
159 readonly property int minHeight: units.gu(10)
159 readonly property int minHeight: units.gu(10)
160
160
161 function focusWindow() {
161 function focusWindow() {
162− decoratedWindow.window.forceActiveFocus();
162+ ApplicationManager.requestFocusApplication(model.appId);
163 }
163 }
164
164
165 states: [
165 states: [
tests/mocks/Utils/CMakeLists.txt−1
@@ -18,7 +18,6 @@ set(QMLPLUGIN_SRC
18 ${CMAKE_SOURCE_DIR}/plugins/Utils/windowkeysfilter.cpp
18 ${CMAKE_SOURCE_DIR}/plugins/Utils/windowkeysfilter.cpp
19 ${CMAKE_SOURCE_DIR}/plugins/Utils/easingcurve.cpp
19 ${CMAKE_SOURCE_DIR}/plugins/Utils/easingcurve.cpp
20 ${CMAKE_SOURCE_DIR}/plugins/Utils/inputwatcher.cpp
20 ${CMAKE_SOURCE_DIR}/plugins/Utils/inputwatcher.cpp
21− ${CMAKE_SOURCE_DIR}/plugins/Utils/spreadflickable.cpp
22 constants.cpp
21 constants.cpp
23 plugin.cpp
22 plugin.cpp
24 windowstatestorage.cpp
23 windowstatestorage.cpp
tests/mocks/Utils/plugin.cpp−2
@@ -36,7 +36,6 @@
36#include "windowkeysfilter.h"
36#include "windowkeysfilter.h"
37#include "easingcurve.h"
37#include "easingcurve.h"
38#include "windowstatestorage.h"
38#include "windowstatestorage.h"
39−#include "spreadflickable.h"
40#include "constants.h"
39#include "constants.h"
41
40
42// plugin
41// plugin
@@ -77,7 +76,6 @@ void FakeUtilsPlugin::registerTypes(const char *uri)
77 qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
76 qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
78 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
77 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
79 qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");
78 qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");
80− qmlRegisterType<SpreadFlickable>(uri, 0, 1, "SpreadFlickable");
81 qmlRegisterSingletonType<Constants>(uri, 0, 1, "Constants", createConstants);
79 qmlRegisterSingletonType<Constants>(uri, 0, 1, "Constants", createConstants);
82}
80}
83
81