diff options
author | Nedim Hadzic <nedim.hadzic@pelagicore.com> | 2017-07-17 14:09:57 +0200 |
---|---|---|
committer | Nedim Hadzic <nedim.hadzic@pelagicore.com> | 2017-07-24 07:59:41 +0000 |
commit | 401902acd444d7f4903be15776f2b3faf36f3c7d (patch) | |
tree | df6350d48f65e62cebbbf755248e4f80266b9d19 | |
parent | 4f9a5703a0224e5524c91da1b619303af6948b24 (diff) |
Use vspan and hspan instead of fixed numbers
For scalability it is better to use size
calculations instead of fixed numbers.
Task-number: QTAUTO-498
Change-Id: Ie53d7d8260bb0dacdce322d10d44a588edc42e9e
Reviewed-by: Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com>
-rw-r--r-- | imports/shared/utils/Style.qml | 4 | ||||
-rw-r--r-- | sysui/display/Display.qml | 4 | ||||
-rw-r--r-- | sysui/popup/PopupContainer.qml | 8 | ||||
-rw-r--r-- | sysui/popup/PopupFooter.qml | 3 |
4 files changed, 12 insertions, 7 deletions
diff --git a/imports/shared/utils/Style.qml b/imports/shared/utils/Style.qml index 23aa4fa..14bbae5 100644 --- a/imports/shared/utils/Style.qml +++ b/imports/shared/utils/Style.qml @@ -95,6 +95,10 @@ QtObject { property int statusBarSpan: 2 property real statusBarHeight: vspan(statusBarSpan) + //Popup config + property real popupWidth: isPotrait ? hspan(12) : hspan(8) + property real popupHeight: vspan(6) + property int notificationCenterWidth: hspan(notificationCenterSpan) property real launcherHeight: vspan(launcherSpan) diff --git a/sysui/display/Display.qml b/sysui/display/Display.qml index 64542e2..02cdc53 100644 --- a/sysui/display/Display.qml +++ b/sysui/display/Display.qml @@ -123,8 +123,8 @@ Item { StageLoader { id: popupContainerLoader - width: Style.hspan(8) - height: Style.vspan(6) + width: Style.popupWidth + height: Style.popupHeight anchors.centerIn: parent active: StagedStartupModel.loadBackgroundElements source: "../popup/PopupContainer.qml" diff --git a/sysui/popup/PopupContainer.qml b/sysui/popup/PopupContainer.qml index e3a67ec..4521274 100644 --- a/sysui/popup/PopupContainer.qml +++ b/sysui/popup/PopupContainer.qml @@ -38,8 +38,8 @@ import models.popup 1.0 MouseArea { id: root - width: Style.hspan(8) - height: Style.vspan(6) + width: Style.popupWidth + height: Style.popupHeight visible: opacity > 0 @@ -66,7 +66,7 @@ MouseArea { PopupHeader { id: popupHeader width: root.width - height: 100 + height: Style.vspan(2) anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top title: root.contentAvailable && root.popupBody !== undefined && root.popupBody.title !== undefined ? root.popupBody.title : "" @@ -91,7 +91,7 @@ MouseArea { id: progressBar width: parent.width - Style.screenMargin - height: 50 + height: Style.vspan(0.5) anchors.top: body.bottom anchors.topMargin: 5 anchors.horizontalCenter: parent.horizontalCenter diff --git a/sysui/popup/PopupFooter.qml b/sysui/popup/PopupFooter.qml index 076ba09..ab30082 100644 --- a/sysui/popup/PopupFooter.qml +++ b/sysui/popup/PopupFooter.qml @@ -32,6 +32,7 @@ import QtQuick 2.6 import QtQuick.Controls 2.0 import controls 1.0 +import utils 1.0 Row { id: root @@ -49,7 +50,7 @@ Row { delegate: Button { width: buttonModel.buttonWidth - height: 80 + height: Style.vspan(1) text: modelData.text onClicked: root.buttonClicked(index) } |