aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/SubsurfaceButton.qml
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2016-01-20 22:47:58 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-20 07:53:49 -0800
commit471270437b47926afcdf1ff67ab817bc179b8bf4 (patch)
tree3998dc3b800ead975c094487a89414ac6045ab23 /qt-mobile/qml/SubsurfaceButton.qml
parentf3f79309d35b52788ea9b1ab0d5728c77b7eb330 (diff)
downloadsubsurface-471270437b47926afcdf1ff67ab817bc179b8bf4.tar.gz
QML UI: make all buttons more attractive
Commit f3f7930 introduced a more attractive button style to the start page. This patch turns it into its own type so it can easily be used everywhere. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/SubsurfaceButton.qml')
-rw-r--r--qt-mobile/qml/SubsurfaceButton.qml26
1 files changed, 26 insertions, 0 deletions
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
+ }
+ }
+}