aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml
diff options
context:
space:
mode:
Diffstat (limited to 'qt-mobile/qml')
-rw-r--r--qt-mobile/qml/CloudCredentials.qml2
-rw-r--r--qt-mobile/qml/DiveDetailsEdit.qml2
-rw-r--r--qt-mobile/qml/DownloadFromDiveComputer.qml12
-rw-r--r--qt-mobile/qml/Preferences.qml2
-rw-r--r--qt-mobile/qml/StartPage.qml25
-rw-r--r--qt-mobile/qml/SubsurfaceButton.qml26
-rw-r--r--qt-mobile/qml/main.qml1
-rw-r--r--qt-mobile/qml/mobile-resources.qrc1
8 files changed, 40 insertions, 31 deletions
diff --git a/qt-mobile/qml/CloudCredentials.qml b/qt-mobile/qml/CloudCredentials.qml
index bb61cb2a2..54b1e8e92 100644
--- a/qt-mobile/qml/CloudCredentials.qml
+++ b/qt-mobile/qml/CloudCredentials.qml
@@ -79,7 +79,7 @@ Item {
Item {
height: saveButton.height
width: saveButton.width
- Button {
+ SubsurfaceButton {
id: saveButton
text: "Save"
anchors.centerIn: parent
diff --git a/qt-mobile/qml/DiveDetailsEdit.qml b/qt-mobile/qml/DiveDetailsEdit.qml
index 51325b7ae..476bc77f1 100644
--- a/qt-mobile/qml/DiveDetailsEdit.qml
+++ b/qt-mobile/qml/DiveDetailsEdit.qml
@@ -150,7 +150,7 @@ Item {
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
}
- Button {
+ SubsurfaceButton {
anchors.horizontalCenter: parent.horizontalCenter
text: "Save"
onClicked: {
diff --git a/qt-mobile/qml/DownloadFromDiveComputer.qml b/qt-mobile/qml/DownloadFromDiveComputer.qml
index d23754407..a401d5712 100644
--- a/qt-mobile/qml/DownloadFromDiveComputer.qml
+++ b/qt-mobile/qml/DownloadFromDiveComputer.qml
@@ -36,7 +36,7 @@ Item {
RowLayout {
Layout.fillWidth: true
TextField { Layout.fillWidth: true }
- Button { text: "..." }
+ SubsurfaceButton { text: "..." }
}
GridLayout {
columns: 2
@@ -51,7 +51,7 @@ Item {
RowLayout {
Layout.fillWidth: true
ProgressBar { Layout.fillWidth: true }
- Button { text: "Download" }
+ SubsurfaceButton { text: "Download" }
}
}
}
@@ -62,10 +62,10 @@ Item {
Text {
text: "Downloaded dives"
}
- Button {
+ SubsurfaceButton {
text: "Select All"
}
- Button {
+ SubsurfaceButton {
text: "Unselect All"
}
}
@@ -77,14 +77,14 @@ Item {
}
RowLayout {
width: parent.width
- Button {
+ SubsurfaceButton {
text: "OK"
onClicked: {
stackView.pop();
}
}
- Button {
+ SubsurfaceButton {
text: "Cancel"
onClicked: {
diff --git a/qt-mobile/qml/Preferences.qml b/qt-mobile/qml/Preferences.qml
index 1644b5949..67f53c05a 100644
--- a/qt-mobile/qml/Preferences.qml
+++ b/qt-mobile/qml/Preferences.qml
@@ -58,7 +58,7 @@ GridLayout {
Item {
height: saveButton.height
Layout.preferredWidth: saveButton.width
- Button {
+ SubsurfaceButton {
id: saveButton
text: "Save"
anchors.centerIn: parent
diff --git a/qt-mobile/qml/StartPage.qml b/qt-mobile/qml/StartPage.qml
index 741a879a8..468415701 100644
--- a/qt-mobile/qml/StartPage.qml
+++ b/qt-mobile/qml/StartPage.qml
@@ -6,22 +6,6 @@ import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
import org.subsurfacedivelog.mobile 1.0
Item {
- property var subsurfaceButton: Component {
- ButtonStyle {
- background: Rectangle {
- border.width: 1
- radius: height / 3
- color: subsurfaceTheme.accentColor
- }
- label: Text{
- text: control.text
- color: subsurfaceTheme.accentTextColor
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- }
- }
- }
-
ColumnLayout {
id: startpage
anchors.fill: parent
@@ -42,8 +26,7 @@ Item {
wrapMode: Text.WordWrap
Layout.columnSpan: 2
}
- Button {
- style: subsurfaceButton
+ SubsurfaceButton {
id: cloudstorageButton
Layout.bottomMargin: MobileComponents.Units.largeSpacing
Layout.preferredWidth: startpage.buttonWidth
@@ -53,8 +36,7 @@ Item {
stackView.push(cloudCredWindow)
}
}
- Button {
- style: subsurfaceButton
+ SubsurfaceButton {
id: computerButton
Layout.preferredWidth: startpage.buttonWidth
Layout.bottomMargin: MobileComponents.Units.largeSpacing
@@ -64,8 +46,7 @@ Item {
stackView.push(downloadDivesWindow)
}
}
- Button {
- style: subsurfaceButton
+ SubsurfaceButton {
id: manualButton
Layout.preferredWidth: startpage.buttonWidth
Layout.bottomMargin: MobileComponents.Units.largeSpacing
diff --git a/qt-mobile/qml/SubsurfaceButton.qml b/qt-mobile/qml/SubsurfaceButton.qml
new file mode 100644
index 000000000..5f8bb6fdd
--- /dev/null
+++ b/qt-mobile/qml/SubsurfaceButton.qml
@@ -0,0 +1,26 @@
+import QtQuick 2.5
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
+
+Button {
+ style: ButtonStyle {
+ padding {
+ top: MobileComponents.Units.smallSpacing
+ left: MobileComponents.Units.smallSpacing * 2
+ right: MobileComponents.Units.smallSpacing * 2
+ bottom: MobileComponents.Units.smallSpacing
+ }
+ background: Rectangle {
+ border.width: 1
+ radius: height / 3
+ color: control.pressed ? subsurfaceTheme.shadedColor : subsurfaceTheme.accentColor
+ }
+ label: Text{
+ text: control.text
+ color: subsurfaceTheme.accentTextColor
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
+}
diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml
index b2c94f4f4..43e7cf2a0 100644
--- a/qt-mobile/qml/main.qml
+++ b/qt-mobile/qml/main.qml
@@ -189,6 +189,7 @@ MobileComponents.ApplicationWindow {
property int titlePointSize: Math.round(fontMetrics.font.pointSize * 1.5)
property int smallPointSize: Math.round(fontMetrics.font.pointSize * 0.8)
property color accentColor: "#2d5b9a"
+ property color shadedColor: "#224575"
property color accentTextColor: "#ececec"
}
diff --git a/qt-mobile/qml/mobile-resources.qrc b/qt-mobile/qml/mobile-resources.qrc
index 3a84bbf66..50565e0a8 100644
--- a/qt-mobile/qml/mobile-resources.qrc
+++ b/qt-mobile/qml/mobile-resources.qrc
@@ -15,6 +15,7 @@
<file>ThemeTest.qml</file>
<file>StartPage.qml</file>
<file>dive.jpg</file>
+ <file>SubsurfaceButton.qml</file>
<file alias="subsurface-mobile-icon.png">../../icons/subsurface-mobile-icon.png</file>
<file alias="main-menu.png">icons/main-menu.png</file>
<file alias="context-menu.png">icons/context-menu.png</file>