Commit f2758f73 authored by Jimmy HUGUET's avatar Jimmy HUGUET

Improve navigation between mode and mode design

parent ab59c98f
......@@ -59,6 +59,7 @@ KeyBase {
property point tempPoint: Qt.point(0,0)
property point startPoint:Qt.point(0,0)
property point currentPoint:Qt.point(0,0)
property bool swipeHighlightEnable: true
property var swipeArray: attributes.isShifted ? swipeCaptionShifted : swipeCaption
......@@ -95,7 +96,7 @@ KeyBase {
font.pixelSize: Theme.fontSizeSmall
color: Theme.primaryColor
text: modelData === "" ? swipeSpecial[index] : !attributes.inSymView ? modelData : ""
opacity: modelData !== "" ? 0.8 : attributes.inSymView2 ? 0.5 : 0
opacity: modelData !== "" ? 0.8 : attributes.inSymView2 || attributes.inSymView ? 0.5 : 0
}
}
......@@ -107,7 +108,7 @@ KeyBase {
z: -1
color: Theme.highlightBackgroundColor
opacity: 0.5
visible: pressed && showHighlight
visible: pressed && showHighlight && swipeHighlightEnable
}
Rectangle {
......@@ -119,6 +120,7 @@ KeyBase {
z: -1
color: Theme.highlightBackgroundColor
opacity: 0.3
visible: swipeHighlightEnable
transformOrigin: Item.Left
property real xDist: startPoint.x - currentPoint.x
......
......@@ -530,7 +530,7 @@ Item {
}
inSymView = !inSymView
if (!inSymView) {
if (!inSymView && typeof layout.isEase === 'undefined') {
inSymView2 = false
}
}
......
/*
* Copyright (C) 2013 Jolla ltd. and/or its subsidiary(-ies). All rights reserved.
*
* Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* Neither the name of Jolla ltd nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
import QtQuick 2.0
import com.jolla.keyboard 1.0
import Sailfish.Silica 1.0
FunctionKey {
id: shiftKey
property int _charactersWhenPressed
property bool _quickPicking
implicitWidth: shiftKeyWidth
icon.source: (attributes.isShifted && !attributes.isShiftLocked ? "image://theme/icon-m-autocaps"
: "image://theme/icon-m-capslock")
+ (pressed ? ("?" + Theme.highlightColor) : "")
// dim normal shift mode
icon.opacity: (!attributes.isShiftLocked && !attributes.isShifted) ? 0.2 : 1.0
caption: ""
key: Qt.Key_Shift
keyType: KeyType.ShiftKey
background.visible: false
onPressedChanged: {
if (pressed && !keyboard.isShifted && keyboard.lastInitialKey === shiftKey) {
_quickPicking = true
keyboard.shiftState = ShiftState.LatchedShift
} else {
_quickPicking = false
}
_charactersWhenPressed = keyboard.characterKeyCounter
keyboard.shiftKeyPressed = pressed
keyboard.updatePopper()
}
onClicked: {
if (keyboard.characterKeyCounter > _charactersWhenPressed) {
keyboard.shiftState = ShiftState.NoShift
} else if (!_quickPicking) {
keyboard.cycleShift()
}
}
}
......@@ -31,20 +31,40 @@ import QtQuick 2.0
import com.jolla.keyboard 1.0
import Sailfish.Silica 1.0
FunctionKey {
CharacterEaseKey {
id: symbolKey
property int _charactersWhenPressed
property bool _quickPicking
property string symbolCaption: "*.$"
caption: !attributes.inSymView2 ? symbolCaption : " "
caption: attributes.inSymView ? "0" : ""
captionShifted: caption
implicitWidth: functionKeyWidth
keyType: KeyType.SymbolKey
swipeHighlightEnable: attributes.inSymView
onPressedChanged: {
Rectangle {
id: backgroundItem
color: parent.pressed ? Theme.highlightBackgroundColor : Theme.primaryColor
opacity: parent.pressed ? 0.6 : 0.17
radius: geometry.keyRadius
anchors { fill: parent; margins: Theme.paddingMedium }
visible: !attributes.inSymView
}
Text {
id: textItem
anchors.centerIn: parent
anchors.horizontalCenterOffset: Math.round((leftPadding - rightPadding) / 2)
width: parent.width - leftPadding - rightPadding - 4
fontSizeMode: Text.HorizontalFit
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: Theme.fontSizeMedium
font.family: Theme.fontFamily
color: parent.pressed ? Theme.highlightColor : Theme.primaryColor
text: !attributes.inSymView2 ? "*.$" : " "
visible: !attributes.inSymView
}
onClicked: {
......
......@@ -66,7 +66,7 @@ KeyboardEaseLayout {
caption: "r"; swipeCaption: ["", "", "", "m", "", "", "", ""]; swipeSpecial: ["|", "", "}", "", ")", "@", "", "]"];
captionShifted: "R"; swipeCaptionShifted: ["", "", "", "M", "", "", "", ""]; symView: "6"; symView2: caption }
ShiftKey {implicitWidth: symbol.width}
ShiftEaseKey {implicitWidth: symbol.width}
}
KeyboardRow {
CharacterEaseKey {
......@@ -79,7 +79,7 @@ KeyboardEaseLayout {
caption: "s"; swipeCaption: ["f", "", "", "", "", "", "", ""]; swipeSpecial: ["", "&", "", "#", ">", ";", "", ""];
captionShifted: "S"; swipeCaptionShifted: ["F", "", "", "", "", "", "", ""]; symView: "9"; symView2: caption }
SymbolKey {id: symbol}
SymbolEaseKey {id: symbol}
}
SpacebarEaseRow {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment