summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Gottfried <sebastiangottfried@web.de>2015-06-30 11:17:43 (GMT)
committerSebastian Gottfried <sebastiangottfried@web.de>2015-06-30 11:17:43 (GMT)
commitfeaca83a6e885e8c841475c217596c16f03b71b3 (patch)
tree9e263a23311cea3e95091424083964b803658833
parent4d7e764349512d4fae16f779fc804e69a19b6b24 (diff)
Qt5: Port TrainingScreenToolbar.qml
-rw-r--r--src/qml/MessageBox.qml15
-rw-r--r--src/qml/TrainingScreen.qml6
-rw-r--r--src/qml/TrainingScreenToolbar.qml17
3 files changed, 16 insertions, 22 deletions
diff --git a/src/qml/MessageBox.qml b/src/qml/MessageBox.qml
index b340029..29ba948 100644
--- a/src/qml/MessageBox.qml
+++ b/src/qml/MessageBox.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,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 1.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 org.kde.kquickcontrolsaddons 2.0
Rectangle {
id: item
@@ -31,7 +32,7 @@ Rectangle {
function showMessage(msg, iconSource) {
item.state = "hidden";
label.text = msg
- icon.source = iconSource || ""
+ icon.icon = iconSource || ""
item.state = "normal"
}
@@ -62,16 +63,14 @@ Rectangle {
width: icon.width + spacing + label.width
spacing: icon.valid? 3: 0
- PlasmaCore.IconItem {
+ QIconItem {
id: icon
width: height
height: valid? label.height: 0
}
- PlasmaComponents.Label {
+ Label {
id: label
- height: paintedHeight
- smooth: true
color: "#000000"
}
}
diff --git a/src/qml/TrainingScreen.qml b/src/qml/TrainingScreen.qml
index 4b2597b..9b7f15c 100644
--- a/src/qml/TrainingScreen.qml
+++ b/src/qml/TrainingScreen.qml
@@ -127,7 +127,7 @@ FocusScope {
spacing: 0
BorderImage {
Layout.fillWidth: true
- Layout.preferredHeight: 29
+ Layout.preferredHeight: 41
border {
top: 1
bottom: 1
@@ -136,15 +136,15 @@ FocusScope {
source: utils.findImage("trainingscreen-toolbar.png")
horizontalTileMode: BorderImage.Repeat
verticalTileMode: BorderImage.Repeat
- /*
+
TrainingScreenToolbar {
id: toolbar
+ anchors.fill: parent
trainingStarted: screen.trainingStarted
trainingFinished: screen.trainingFinished
stats: stats
menuOverlayItem: menuOverlay
}
- */
}
BorderImage {
diff --git a/src/qml/TrainingScreenToolbar.qml b/src/qml/TrainingScreenToolbar.qml
index ddfb244..2bf30e5 100644
--- a/src/qml/TrainingScreenToolbar.qml
+++ b/src/qml/TrainingScreenToolbar.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,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 1.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 ktouch 1.0
Item {
@@ -52,12 +53,6 @@ Item {
onTimeIsRunningChanged: setMessage()
}
- PlasmaCore.FrameSvgItem {
- anchors.fill: parent
- imagePath: findImage("trainingscreen.svgz")
- prefix: "toolbar"
- }
-
Row {
anchors {
verticalCenter: parent.verticalCenter
@@ -71,9 +66,9 @@ Item {
spacing: 3
height: menuButton.height
- PlasmaComponents.ToolButton {
+ ToolButton {
id: menuButton
- iconSource: "go-home"
+ iconName: "go-home"
onClicked: item.menuOverlayItem.show()
}