From 3c08bec6d56abdd016a458bd60da6c3835c65eea Mon Sep 17 00:00:00 2001
From: Joakim Bygdell <j.bygdell@gmail.com>
Date: Thu, 30 Jul 2015 08:17:09 +0200
Subject: [PATCH 1/2] QML UI: dynamic button sizes

Butons are sized based in the text printed on them,
we want our buttons to have a meaningful minimum size and a
preferred size that is similar regardless of screen resolution.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
---
 qt-mobile/DiveDetails.qml | 3 +++
 qt-mobile/main.qml        | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/qt-mobile/DiveDetails.qml b/qt-mobile/DiveDetails.qml
index 64b7398..6f8e83b 100644
--- a/qt-mobile/DiveDetails.qml
+++ b/qt-mobile/DiveDetails.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls.Styles 1.2
 import QtQuick.Window 2.2
 import QtQuick.Dialogs 1.2
 import QtQuick.Layouts 1.1
+import QtQuick.Window 2.2
 import org.subsurfacedivelog.mobile 1.0
 
 Item {
@@ -44,10 +45,12 @@ Item {
 					Button {
 						id: backButton
 						Layout.margins: 0.1 * height
+						Layout.preferredWidth: Screen.width * 0.1
 						text: "\u2190"
 						style: ButtonStyle {
 							background: Rectangle {
 								color: "#4C68A2"
+								implicitWidth: 50
 							}
 							label: Text {
 								id: txt
diff --git a/qt-mobile/main.qml b/qt-mobile/main.qml
index c782f1f..2cd1e5f 100644
--- a/qt-mobile/main.qml
+++ b/qt-mobile/main.qml
@@ -4,6 +4,7 @@ import QtQuick.Controls.Styles 1.2
 import QtQuick.Window 2.2
 import QtQuick.Dialogs 1.2
 import QtQuick.Layouts 1.1
+import QtQuick.Window 2.2
 import org.subsurfacedivelog.mobile 1.0
 
 ApplicationWindow {
@@ -85,9 +86,10 @@ ApplicationWindow {
 							id: prefsButton
 							text: "\u22ee"
 							anchors.right: parent.right
+							Layout.preferredWidth: Screen.width * 0.1
 							style: ButtonStyle {
 								background: Rectangle {
-									implicitWidth: 72
+									implicitWidth: 50
 									color: "#2C4882"
 								}
 								label: Text {
-- 
2.3.2 (Apple Git-55)

