summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Gottfried <sebastiangottfried@web.de>2015-07-06 14:39:07 (GMT)
committerSebastian Gottfried <sebastiangottfried@web.de>2015-07-06 14:39:07 (GMT)
commit228a381591793507f8b73d8cc41e95ef2e8f35ee (patch)
tree7c5a291a45f34ad2cdbcde9c51dd079eb79bc2d5
parentfeaca83a6e885e8c841475c217596c16f03b71b3 (diff)
Qt5: Port Keyboard.qml and friends
-rw-r--r--src/qml/KeyItem.qml48
-rw-r--r--src/qml/KeyLabel.qml2
-rw-r--r--src/qml/Keyboard.qml2
-rw-r--r--src/qml/KeyboardUnavailableNotice.qml14
-rw-r--r--src/qml/TrainingScreen.qml7
5 files changed, 34 insertions, 39 deletions
diff --git a/src/qml/KeyItem.qml b/src/qml/KeyItem.qml
index 04bff57..f538b4f 100644
--- a/src/qml/KeyItem.qml
+++ b/src/qml/KeyItem.qml
@@ -1,5 +1,6 @@
/*
* Copyright 2012 Sebastian Gottfried <sebastiangottfried@web.de>
+ * Copyright 2015 Sebastian Gottfried <sebastiangottfried@web.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 1.1
-import Effects 1.0
+import QtQuick 2.4
+import QtGraphicalEffects 1.0
import ktouch 1.0
Item {
@@ -104,22 +105,7 @@ Item {
width: item.width + marginSize
height: item.height + marginSize
smooth: true
- radius: body.radius
- effect: DropShadow {
- color: shadow.color
- blurRadius: 5
- xOffset: 0
- yOffset: 0
-
- Behavior on blurRadius {
- enabled: animateHighlight
- NumberAnimation {
- duration: 150
- easing.type: Easing.InOutQuad
- }
- }
- }
-
+ radius: 5 // body.radius
state: "normal"
states: [
@@ -131,8 +117,8 @@ Item {
marginSize: 0
}
PropertyChanges {
- target: shadow.effect
- blurRadius: 10
+ target: shadowEffect
+ glowRadius: 10
}
},
State {
@@ -143,8 +129,8 @@ Item {
marginSize: 4
}
PropertyChanges {
- target: shadow.effect
- blurRadius: 15
+ target: shadowEffect
+ glowRadius: 15
}
},
State {
@@ -155,8 +141,8 @@ Item {
marginSize: 0
}
PropertyChanges {
- target: shadow.effect
- blurRadius: 15
+ target: shadowEffect
+ glowRadius: 15
}
}
]
@@ -193,7 +179,21 @@ Item {
}
PauseAnimation { duration: 150 }
}
+ }
+
+ RectangularGlow {
+ id: shadowEffect
+ anchors.fill: shadow
+ color: shadow.color
+ glowRadius: 5
+ Behavior on glowRadius {
+ enabled: animateHighlight
+ NumberAnimation {
+ duration: 150
+ easing.type: Easing.InOutQuad
+ }
+ }
}
Rectangle {
diff --git a/src/qml/KeyLabel.qml b/src/qml/KeyLabel.qml
index 73a0325..700b579 100644
--- a/src/qml/KeyLabel.qml
+++ b/src/qml/KeyLabel.qml
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 1.0
+import QtQuick 2.4
import ktouch 1.0
Text {
diff --git a/src/qml/Keyboard.qml b/src/qml/Keyboard.qml
index 469145b..295257a 100644
--- a/src/qml/Keyboard.qml
+++ b/src/qml/Keyboard.qml
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 1.1
+import QtQuick 2.4
import ktouch 1.0
Item {
diff --git a/src/qml/KeyboardUnavailableNotice.qml b/src/qml/KeyboardUnavailableNotice.qml
index ae1cc9f..e6d56c3 100644
--- a/src/qml/KeyboardUnavailableNotice.qml
+++ b/src/qml/KeyboardUnavailableNotice.qml
@@ -1,5 +1,6 @@
/*
* Copyright 2012 Sebastian Gottfried <sebastiangottfried@web.de>
+ * Copyright 2015 Sebastian Gottfried <sebastiangottfried@web.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 1.1
-import org.kde.qtextracomponents 0.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.components 0.1 as PlasmaComponents
+import QtQuick 2.4
+import QtQuick.Controls 1.3
+import QtQuick.Layouts 1.1
+import org.kde.kquickcontrolsaddons 2.0
import ktouch 1.0
Item {
@@ -38,14 +39,13 @@ Item {
anchors.verticalCenter: parent.verticalCenter
width: theme.smallIconSize
height: theme.smallIconSize
- icon: QIcon("dialog-warning")
+ icon: "dialog-warning"
}
- PlasmaComponents.Label {
+ Label {
id: label
anchors.verticalCenter: parent.verticalCenter
width: parent.width - icon.width - parent.spacing
- height: paintedHeight
text: i18n("No visualization available for your keyboard layout.")
color: "white"
}
diff --git a/src/qml/TrainingScreen.qml b/src/qml/TrainingScreen.qml
index 9b7f15c..3808f05 100644
--- a/src/qml/TrainingScreen.qml
+++ b/src/qml/TrainingScreen.qml
@@ -218,21 +218,17 @@ FocusScope {
id: footer
visible: preferences.showKeyboard
Layout.fillWidth: true
- Layout.preferredHeight: 100
- /*
- height: visible?
+ Layout.preferredHeight: visible?
screen.keyboardLayout.isValid?
Math.round(Math.min((parent.height - toolbar.height - header.height) / 2, parent.width / keyboard.aspectRatio)):
keyboardUnavailableNotice.height:
0
- */
border {
top: 1
bottom: 1
}
source: utils.findImage("trainingscreen-footer.png")
cache: false
- /*
Keyboard {
id: keyboard
@@ -302,7 +298,6 @@ FocusScope {
id: keyboardUnavailableNotice
visible: !screen.keyboardLayout.isValid
}
- */
}
}