on xenial help sign in
touches
commitc4232283675c9e82449257a94456db47eb946be4 authorNick Dedekind <nicholas.dedekind@gmail.com> dateFri 2 May 2014, 09:29 (12 years ago) parent7265b38
7 files changed+112−36
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+1 plugins/Ubuntu/Gestures/DirectionalDragArea.h+1 qml/Panel/ActiveCallHint.qml+17−5 qml/Panel/Indicators.qml+8−2 qml/Panel/Panel.qml+64−7 qml/Panel/SearchIndicator.qml+2−3 qml/Shell.qml+19−19
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+1
@@ -378,6 +378,7 @@ void DirectionalDragArea::touchEvent_undecided(QTouchEvent *event)
378378 // touch has ended before recognition concluded
379379 DDA_DEBUG("Touch has ended before recognition concluded");
380380 setStatus(WaitingForTouch);
381+ Q_EMIT tapped();
381382 return;
382383 }
383384
plugins/Ubuntu/Gestures/DirectionalDragArea.h+1
@@ -212,6 +212,7 @@ Q_SIGNALS:
212212 void touchYChanged(qreal value);
213213 void touchSceneXChanged(qreal value);
214214 void touchSceneYChanged(qreal value);
215+ void tapped();
215216
216217protected:
217218 virtual void touchEvent(QTouchEvent *event);
qml/Panel/ActiveCallHint.qml+17−5
@@ -23,16 +23,29 @@ import "../Components"
2323Item {
2424 id: callHint
2525
26− readonly property bool active: callManager.hasCalls && ApplicationManager.focusedApplicationId !== "dialer-app"
26+ property bool active: true//callManager.hasCalls && ApplicationManager.focusedApplicationId !== "dialer-app"
2727 readonly property QtObject contactWatcher: _contactWatcher
2828 property int alternateLabelInterval: 4000
2929 property color color: Qt.rgba(0.1, 0.6, 0.1, 1.0)
30− property color colorFlash: Qt.rgba(0.1, 0.9, 0.1, 1.0)
30+ property color colorFlash: Qt.lighter(color)
31+ readonly property alias mouseArea: __mouseArea
3132
3233 Component.onCompleted: {
3334 telepathyHelper.registerChannelObserver("unity8");
3435 }
3536
37+ function activate() {
38+ console.log("PLOP")
39+// ApplicationManager.requestFocusApplication("dialer-app");
40+ }
41+
42+ Timer {
43+ running: true
44+ interval: 4000
45+ repeat: true
46+ onTriggered: active = !active
47+ }
48+
3649 Rectangle {
3750 id: background
3851 anchors.fill: parent
@@ -226,11 +239,10 @@ Item {
226239 }
227240 }
228241
242+ // eater
229243 MouseArea {
244+ id: __mouseArea
230245 anchors.fill: parent
231− onClicked: {
232− ApplicationManager.requestFocusApplication("dialer-app");
233− }
234246 }
235247
236248 Telephony.ContactWatcher {
qml/Panel/Indicators.qml+8−2
@@ -43,6 +43,10 @@ Showable {
4343 property bool initalizeItem: true
4444 readonly property alias content: menuContent
4545 property real unitProgress: (height - panelHeight) / (openedHeight - panelHeight)
46+ property bool enableHint: true
47+ property real hintAreaHeightOffset: 0
48+
49+ signal showTapped(point position)
4650
4751 // TODO: Perhaps we need a animation standard for showing/hiding? Each showable seems to
4852 // use its own values. Need to ask design about this.
@@ -357,10 +361,10 @@ Showable {
357361 anchors.bottomMargin: pinnedMode ? 0 : -panelHeight
358362 anchors.left: parent.left
359363 anchors.right: parent.right
360− height: panelHeight
364+ height: panelHeight + hintAreaHeightOffset
361365 direction: Direction.Downwards
362366 enabled: !indicators.shown && indicators.available
363− hintDisplacement: pinnedMode ? indicators.hintValue : 0
367+ hintDisplacement: enableHint && pinnedMode ? indicators.hintValue : 0
364368 autoCompleteDragThreshold: maxTotalDragDistance / 2
365369 stretch: true
366370 maxTotalDragDistance: openedHeight - panelHeight
@@ -371,6 +375,8 @@ Showable {
371375 menuContent.activateContent();
372376 }
373377 }
378+
379+ onTapped: showTapped(Qt.point(x + touchX, y + touchY))
374380 }
375381 DragHandle {
376382 id: hideDragHandle
qml/Panel/Panel.qml+64−7
@@ -16,11 +16,12 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import Unity.Application 0.1
1920import "../Components"
2021
2122Item {
2223 id: root
23− readonly property real panelHeight: callHint.active ? callHint.height + indicatorArea.indicatorHeight : indicatorArea.indicatorHeight
24+ readonly property real panelHeight: indicatorArea.y + indicatorArea.indicatorHeight
2425 property alias indicators: indicatorsMenu
2526 property bool fullscreenMode: false
2627 property bool searchVisible: true
@@ -62,16 +63,30 @@ Item {
6263 right: parent.right
6364 }
6465 height: units.gu(3)
66+ y: -height
6567
66− y: active ? 0 : -height
67− z: 1
68+ states: [
69+ State {
70+ name: "active"
71+ when: callHint.active
72+ PropertyChanges { target: callHint; y: 0 }
73+ PropertyChanges { target: search.mouseArea; anchors.topMargin: -callHint.height/3 }
74+ }
75+ ]
76+ Behavior on y { StandardAnimation { id: callHintYAnimation } }
6877
69− Behavior on y { StandardAnimation {} }
78+ mouseArea.onClicked: callHint.activate();
79+
80+ Rectangle {
81+ anchors.fill: callHint.mouseArea
82+ color: Qt.rgba(0,1,0,0.5)
83+ }
7084 }
7185
7286 Item {
7387 id: indicatorArea
7488 objectName: "indicatorArea"
89+ z: 1
7590
7691 readonly property real indicatorHeight: indicatorsMenu.panelHeight + leftSeparatorLine.height
7792
@@ -80,7 +95,11 @@ Item {
8095 right: parent.right
8196 }
8297 height: root.height - indicatorArea.y
83− z: 0
98+
99+ Behavior on y {
100+ enabled: !callHintYAnimation.running
101+ StandardAnimation {}
102+ }
84103
85104 PanelBackground {
86105 id: panelBackground
@@ -113,6 +132,7 @@ Item {
113132 }
114133 color: "black"
115134 opacity: indicatorsMenu.unitProgress * darkenedOpacity
135+
116136 MouseArea {
117137 anchors.fill: parent
118138 enabled: indicatorsMenu.shown
@@ -120,6 +140,23 @@ Item {
120140 }
121141 }
122142
143+ MouseArea {
144+ id: indicatorAreaClick
145+ enabled: callHint.active
146+ anchors {
147+ top: parent.top
148+ left: search.right
149+ right: indicatorsMenu.right
150+ }
151+ height: indicatorsMenu.panelHeight/2
152+ onClicked: callHint.activate();
153+
154+ Rectangle {
155+ anchors.fill: indicatorAreaClick
156+ color: Qt.rgba(0,1,0,0.5)
157+ }
158+ }
159+
123160 Indicators {
124161 id: indicatorsMenu
125162 objectName: "indicators"
@@ -134,7 +171,20 @@ Item {
134171 panelHeight: units.gu(3)
135172 openedHeight: parent.height
136173 pinnedMode: !fullscreenMode
174+ enableHint: !callHint.active
137175 overFlowWidth: search.state=="hidden" ? parent.width : parent.width - search.width
176+ hintAreaHeightOffset: callHint.active ? callHint.height : 0
177+
178+ onShowTapped: {
179+ if (callHint.active && position.y < y + indicatorsMenu.panelHeight/2) {
180+ callHint.activate();
181+ }
182+ }
183+
184+ Rectangle {
185+ anchors.fill: indicatorsMenu
186+ color: Qt.rgba(1,1,0,0.5)
187+ }
138188 }
139189
140190 PanelSeparatorLine {
@@ -174,7 +224,6 @@ Item {
174224 if (root.searchVisible && !indicatorsMenu.showAll) {
175225 return "visible";
176226 }
177−
178227 return "hidden";
179228 }
180229
@@ -184,7 +233,13 @@ Item {
184233 }
185234 height: panelBackground.height
186235
187− onClicked: root.searchClicked()
236+ mouseArea {
237+ onClicked: root.searchClicked()
238+ }
239+ Rectangle {
240+ anchors.fill: search.mouseArea
241+ color: Qt.rgba(1,0,0,0.5)
242+ }
188243 }
189244 }
190245
@@ -193,11 +248,13 @@ Item {
193248 name: "in" //fully opaque and visible at top edge of screen
194249 when: !fullscreenMode
195250 PropertyChanges { target: indicatorArea; y: callHint.y + callHint.height }
251+ PropertyChanges { target: callHint; z: 0 }
196252 },
197253 State {
198254 name: "out" //pushed off screen
199255 when: fullscreenMode
200256 PropertyChanges { target: indicatorArea; y: callHint.y + callHint.height - indicatorHeight }
257+ PropertyChanges { target: callHint; z: 2 }
201258 }
202259 ]
203260}
qml/Panel/SearchIndicator.qml+2−3
@@ -25,13 +25,12 @@ Item {
2525 height: units.gu(3)
2626
2727 property string headerText: i18n.tr("Search")
28−
29− signal clicked
28+ readonly property alias mouseArea: __mouseArea
3029
3130 // eater
3231 MouseArea {
32+ id: __mouseArea
3333 anchors.fill: parent
34− onClicked: search.clicked()
3534 }
3635
3736 Row {
qml/Shell.qml+19−19
@@ -151,10 +151,10 @@ FocusScope {
151151 shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0
152152 enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
153153
154− y: panel.panelHeight
155− width: parent.width
156− height: parent.height - panel.panelHeight
157− Behavior on y { StandardAnimation {} }
154+ anchors {
155+ fill: parent
156+ topMargin: panel.panelHeight
157+ }
158158
159159 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
160160 opacity: 1.0 - disappearingAnimationProgress
@@ -314,12 +314,12 @@ FocusScope {
314314 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
315315 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
316316
317− y: panel.panelHeight
318− x: required ? 0 : - width
319− width: parent.width
320− height: parent.height - panel.panelHeight
321− Behavior on y { StandardAnimation {} }
322−
317+ anchors {
318+ top: parent.top
319+ right: parent.right
320+ bottom: parent.bottom
321+ topMargin: panel.panelHeight
322+ }
323323 background: shell.background
324324 pinLength: 4
325325
@@ -374,8 +374,6 @@ FocusScope {
374374 y: panel.panelHeight
375375 width: parent.width
376376 height: parent.height - panel.panelHeight
377− Behavior on y { StandardAnimation {} }
378− Behavior on height { StandardAnimation {} }
379377
380378 Behavior on x {SmoothedAnimation{velocity: 600}}
381379
@@ -463,6 +461,13 @@ FocusScope {
463461 panel.hideIndicatorMenu(delay);
464462 }
465463
464+ Timer {
465+ running: true
466+ interval: 7000
467+ repeat: true
468+ onTriggered: {panel.fullscreenMode = !panel.fullscreenMode }
469+ }
470+
466471 Item {
467472 id: overlay
468473
@@ -597,8 +602,6 @@ FocusScope {
597602 y: panel.panelHeight
598603 width: parent.width
599604 height: parent.height - panel.panelHeight
600− Behavior on y { StandardAnimation {} }
601− Behavior on height { StandardAnimation {} }
602605
603606 states: [
604607 State {
@@ -652,11 +655,8 @@ FocusScope {
652655 }
653656
654657 OSKController {
655− y: panel.panelHeight
656− width: parent.width
657− height: parent.height - panel.panelHeight
658− Behavior on y { StandardAnimation {} }
659− Behavior on height { StandardAnimation {} }
658+ anchors.topMargin: panel.panelHeight
659+ anchors.fill: parent // as needs to know the geometry of the shell
660660 }
661661
662662 //FIXME: This should be handled in the input stack, keyboard shouldnt propagate