Commit b6b56a00 authored by eekkelund's avatar eekkelund

[Keyboard] Add keyboard to clipped area

parent c2dfacb8
......@@ -194,6 +194,37 @@ NemoWindow {
anchors.fill: parent
rotation: rotationToTransposeToPortrait()
Item {
id: clipping2
z: 1
property bool panelVisible: inputPanel.active
onPanelVisibleChanged:{
if(!panelVisible) {
imShowAnimation.stop()
imHideAnimation.start()
}else {
imHideAnimation.stop()
imShowAnimation.to = inputPanel.height
imShowAnimation.start()
}
}
width:(isUiLandscape ? stackView.panelSize : parent.width)
height:(isUiPortrait ? stackView.panelSize : root.height)
InputPanel {
z:99
id: inputPanel
visible: true
width:isUiPortrait ? backgroundItem.width : backgroundItem.height
x:0
rotation:contentArea.rotation
anchors.centerIn: parent
}
}
Item {
id: clipping
......@@ -206,14 +237,6 @@ NemoWindow {
Item {
id: contentArea
anchors.centerIn: parent
InputPanel {
z:99
id: inputPanel
visible: Qt.inputMethod.visible
y: Qt.inputMethod.visible ? parent.height - inputPanel.height : parent.height
anchors.left: parent.left
anchors.right: parent.right
}
transform: Scale {
id: contentScale
......@@ -244,10 +267,22 @@ NemoWindow {
property real panelSize: 0
property real previousImSize: 0
property real imSize: !root.applicationActive ? 0 : (isUiPortrait ? (root._transpose ? Qt.inputMethod.keyboardRectangle.width
: Qt.inputMethod.keyboardRectangle.height)
: (root._transpose ? Qt.inputMethod.keyboardRectangle.height
: Qt.inputMethod.keyboardRectangle.width))
property real imSize: !root.applicationActive ? 0 : Qt.inputMethod.keyboardRectangle.height
onImSizeChanged: {
if (imSize <= 0 && previousImSize > 0) {
imShowAnimation.stop()
imHideAnimation.start()
} else if (imSize > 0 && previousImSize <= 0) {
imHideAnimation.stop()
imShowAnimation.to = imSize
imShowAnimation.start()
} else {
panelSize = imSize
}
previousImSize = imSize
}
clip: true
Component.onCompleted: {
......@@ -297,6 +332,12 @@ NemoWindow {
delegate: StackViewDelegate {
pushTransition: Component {
StackViewTransition {
ScriptAction {
script: {
imShowAnimation.stop()
imHideAnimation.start()
}
}
PropertyAnimation {
target: enterItem
property: "x"
......@@ -317,6 +358,12 @@ NemoWindow {
}
popTransition: Component {
StackViewTransition {
ScriptAction {
script: {
imShowAnimation.stop()
imHideAnimation.start()
}
}
PropertyAnimation {
target: enterItem
property: "x"
......@@ -368,7 +415,7 @@ NemoWindow {
//used to animate the dimmer when pages are pushed/popped (see Header's QML code)
property alias __dimmer: headerDimmerContainer
}
Item {
//This item handles the rotation of the dimmer.
......@@ -398,6 +445,7 @@ NemoWindow {
}
}
}
}
Item {
id: orientationState
......@@ -433,6 +481,13 @@ NemoWindow {
anchors.right: undefined
anchors.bottom: undefined
}
AnchorChanges {
target: clipping2
anchors.top: clipping.bottom
anchors.left: parent.left
anchors.right: undefined
anchors.bottom: undefined
}
},
State {
name: 'Landscape'
......@@ -458,6 +513,13 @@ NemoWindow {
anchors.right: parent.right
anchors.bottom: parent.bottom
}
AnchorChanges {
target: clipping2
anchors.top: undefined
anchors.left: parent.left
anchors.right: undefined//clipping.left
anchors.bottom: parent.bottom
}
},
State {
name: 'PortraitInverted'
......@@ -483,6 +545,13 @@ NemoWindow {
anchors.right: parent.right
anchors.bottom: parent.bottom
}
AnchorChanges {
target: clipping2
anchors.top: undefined
anchors.left: undefined
anchors.right: clipping.right
anchors.bottom: clipping.top
}
},
State {
name: 'LandscapeInverted'
......@@ -508,6 +577,13 @@ NemoWindow {
anchors.right: undefined
anchors.bottom: parent.bottom
}
AnchorChanges {
target: clipping2
anchors.top: undefined
anchors.left: undefined//clipping.right
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}
]
......@@ -520,12 +596,20 @@ NemoWindow {
property: 'orientationTransitionRunning'
value: true
}
ParallelAnimation {
NumberAnimation {
target: contentArea
property: 'opacity'
to: 0
duration: 150
}
NumberAnimation {
target: inputPanel
property: 'opacity'
to: 0
duration: 150
}
}
PropertyAction {
target: contentArea
properties: 'width,height,rotation,uiOrientation'
......@@ -537,12 +621,20 @@ NemoWindow {
target: headerDimmer
properties: 'width,height,rotation'
}
ParallelAnimation {
NumberAnimation {
target: contentArea
property: 'opacity'
to: 1
duration: 150
}
NumberAnimation {
target: inputPanel
property: 'opacity'
to: 1
duration: 150
}
}
PropertyAction {
target: contentArea
property: 'orientationTransitionRunning'
......
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