diff options
Diffstat (limited to 'homescreen/qml')
-rw-r--r-- | homescreen/qml/MediaArea.qml | 3 | ||||
-rw-r--r-- | homescreen/qml/MediaAreaBlank.qml | 5 | ||||
-rw-r--r-- | homescreen/qml/ShortcutArea.qml | 5 | ||||
-rw-r--r-- | homescreen/qml/ShortcutIcon.qml | 11 | ||||
-rw-r--r-- | homescreen/qml/StatusArea.qml | 95 | ||||
-rw-r--r-- | homescreen/qml/TopArea.qml | 10 | ||||
-rw-r--r-- | homescreen/qml/background.qml | 15 | ||||
-rw-r--r-- | homescreen/qml/bottompanel.qml | 14 | ||||
-rw-r--r-- | homescreen/qml/main.qml | 32 | ||||
-rw-r--r-- | homescreen/qml/qml.qrc | 3 | ||||
-rw-r--r-- | homescreen/qml/toppanel.qml | 15 |
11 files changed, 127 insertions, 81 deletions
diff --git a/homescreen/qml/MediaArea.qml b/homescreen/qml/MediaArea.qml index 0447589..88eaf1e 100644 --- a/homescreen/qml/MediaArea.qml +++ b/homescreen/qml/MediaArea.qml @@ -20,8 +20,7 @@ import QtQuick.Controls 2.0 StackView { id: root - width: 1080 - height: 215 + anchors.fill: parent initialItem: blank diff --git a/homescreen/qml/MediaAreaBlank.qml b/homescreen/qml/MediaAreaBlank.qml index 347c26a..44baaa0 100644 --- a/homescreen/qml/MediaAreaBlank.qml +++ b/homescreen/qml/MediaAreaBlank.qml @@ -22,8 +22,7 @@ import AGL.Demo.Controls 1.0 import MasterVolume 1.0 Image { - width: 1080 - height: 215 + anchors.fill: parent source: './images/Utility_Logo_Background-01.svg' property bool displayVolume: false; @@ -40,7 +39,7 @@ Image { } Image { - id: logo_image + id: logo_image anchors.centerIn: parent source: './images/Utility_Logo_Grey-01.svg' } diff --git a/homescreen/qml/ShortcutArea.qml b/homescreen/qml/ShortcutArea.qml index a8ce127..9e404dc 100644 --- a/homescreen/qml/ShortcutArea.qml +++ b/homescreen/qml/ShortcutArea.qml @@ -21,9 +21,6 @@ import QtQuick.Layouts 1.1 Item { id: root - width: 785 - height: 218 - ListModel { id: applicationModel @@ -53,7 +50,7 @@ Item { RowLayout { anchors.fill: parent - spacing: 2 + spacing: 0 Repeater { model: applicationModel delegate: ShortcutIcon { diff --git a/homescreen/qml/ShortcutIcon.qml b/homescreen/qml/ShortcutIcon.qml index 1100a7c..d039d36 100644 --- a/homescreen/qml/ShortcutIcon.qml +++ b/homescreen/qml/ShortcutIcon.qml @@ -21,8 +21,6 @@ import QtGraphicalEffects 1.0 MouseArea { id: root - width: 195 - height: 216.8 property string name: 'Home' property bool active: false Item { @@ -32,12 +30,14 @@ MouseArea { Image { id: inactiveIcon anchors.fill: parent - source: './images/Shortcut/%1.svg'.arg(root.name.toLowerCase()) + source: './images/Shortcut/%1.svg'.arg(root.name.toLowerCase()) + fillMode: Image.PreserveAspectFit } Image { id: activeIcon anchors.fill: parent source: './images/Shortcut/%1_active.svg'.arg(root.name.toLowerCase()) + fillMode: Image.PreserveAspectFit opacity: 0.0 } layer.enabled: true @@ -49,12 +49,13 @@ MouseArea { } Label { id: name - y: 160 width: root.width - 10 font.pixelSize: 15 font.letterSpacing: 5 // wrapMode: Text.WordWrap - anchors.horizontalCenter: parent.horizontalCenter + anchors.centerIn: icon + anchors.verticalCenterOffset: icon.height * 0.2 + //anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter color: "white" text: qsTr(model.name.toUpperCase()) diff --git a/homescreen/qml/StatusArea.qml b/homescreen/qml/StatusArea.qml index d2e0930..c74672c 100644 --- a/homescreen/qml/StatusArea.qml +++ b/homescreen/qml/StatusArea.qml @@ -22,8 +22,6 @@ import HomeScreen 1.0 Item { id: root - width: 295 - height: 218 property date now: new Date Timer { @@ -58,48 +56,71 @@ Item { RowLayout { anchors.fill: parent spacing: 0 - Item { + + ColumnLayout { Layout.fillWidth: true Layout.fillHeight: true - Layout.preferredWidth: 295 - 76 + Layout.preferredWidth: 217 + spacing: 0 + ColumnLayout { - anchors.fill: parent - anchors.margins: 40 + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 130 spacing: 0 - Text { + + Item { Layout.fillWidth: true Layout.fillHeight: true - text: Qt.formatDate(now, 'dddd').toUpperCase() - font.family: 'Roboto' - font.pixelSize: 13 - color: 'white' - verticalAlignment: Text.AlignVCenter -// Rectangle { -// anchors.fill: parent -// anchors.margins: 5 -// color: 'red' -// border.color: 'blue' -// border.width: 1 -// z: -1 -// } + Layout.preferredHeight: 70 + + Text { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: parent.width * 0.2 + + text: Qt.formatDate(now, 'dddd').toUpperCase() + font.family: 'Roboto' + font.pixelSize: 13 + color: 'white' + verticalAlignment: Text.AlignVCenter + fontSizeMode: Text.Fit + } } - Text { + Item { Layout.fillWidth: true Layout.fillHeight: true - text: Qt.formatTime(now, 'h:mm ap').toUpperCase() - font.family: 'Roboto' - font.pixelSize: 40 - color: 'white' - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + Layout.preferredHeight: 60 + + Text { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: parent.height * 0.05 + + text: Qt.formatTime(now, 'h:mm ap').toUpperCase() + font.family: 'Roboto' + font.pixelSize: 40 + color: 'white' + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + fontSizeMode: Text.Fit + } } + } + Item { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 82 + RowLayout { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.preferredHeight: 20 + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: parent.height * 0.1 + Image { id: condition_item source: './images/Weather/WeatherIcons_Rain-01.png' + fillMode: Image.PreserveAspectFit } Text { id: temperature_item @@ -107,6 +128,8 @@ Item { color: 'white' font.family: 'Helvetica' font.pixelSize: 32 + fontSizeMode: Text.Fit + verticalAlignment: Text.AlignVCenter } } } @@ -115,13 +138,14 @@ Item { id: icons Layout.fillWidth: true Layout.fillHeight: true - Layout.preferredWidth: 76 + Layout.preferredWidth: 74 spacing: -10 Image { id: bt_icon - Layout.preferredWidth: 77 - Layout.preferredHeight: 73 + Layout.preferredHeight: 70 + Layout.fillWidth: true + Layout.fillHeight: true source: connStatus ? './images/Status/HMI_Status_Bluetooth_On-01.png' : './images/Status/HMI_Status_Bluetooth_Inactive-01.png' fillMode: Image.PreserveAspectFit property string deviceName: "none" @@ -137,8 +161,9 @@ Item { Repeater { model: StatusBarModel { objectName: "statusBar" } delegate: Image { - Layout.preferredWidth: 77 - Layout.preferredHeight: 73 + Layout.preferredHeight: 70 + Layout.fillWidth: true + Layout.fillHeight: true source: model.modelData fillMode: Image.PreserveAspectFit } diff --git a/homescreen/qml/TopArea.qml b/homescreen/qml/TopArea.qml index 2a75cf8..19bed91 100644 --- a/homescreen/qml/TopArea.qml +++ b/homescreen/qml/TopArea.qml @@ -20,10 +20,10 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 Image { - width: 1920 - height: 218 + anchors.fill: parent source: './images/TopSection_NoText_NoIcons-01.svg' - fillMode: Image.PreserveAspectCrop + //fillMode: Image.PreserveAspectCrop + fillMode: Image.Stretch RowLayout { anchors.fill: parent @@ -32,13 +32,13 @@ Image { id: shortcutArea Layout.fillWidth: true Layout.fillHeight: true - Layout.preferredWidth: 785 + Layout.preferredWidth: 775 } StatusArea { id: statusArea Layout.fillWidth: true Layout.fillHeight: true - Layout.preferredWidth: 295 + Layout.preferredWidth: 291 } } diff --git a/homescreen/qml/background.qml b/homescreen/qml/background.qml new file mode 100644 index 0000000..c2bb309 --- /dev/null +++ b/homescreen/qml/background.qml @@ -0,0 +1,15 @@ +import QtQuick 2.13 +import QtQuick.Window 2.13 + +Window { + id: background + width: Screen.width + height: Screen.height + flags: Qt.FramelessWindowHint + visible: true + + Image { + anchors.fill: parent + source: './images/AGL_HMI_Blue_Background_NoCar-01.png' + } +} diff --git a/homescreen/qml/bottompanel.qml b/homescreen/qml/bottompanel.qml new file mode 100644 index 0000000..a859418 --- /dev/null +++ b/homescreen/qml/bottompanel.qml @@ -0,0 +1,14 @@ +import QtQuick 2.13 +import QtQuick.Window 2.13 +import QtQuick.Controls 2.13 + +Window { + id: bottompanel + width: Screen.width + height: Screen.height * (215.0 / 1920.0) + flags: Qt.FramelessWindowHint + visible: true + //color: "#aaaa0000" + MediaArea { + } +} diff --git a/homescreen/qml/main.qml b/homescreen/qml/main.qml index 7d40276..0526526 100644 --- a/homescreen/qml/main.qml +++ b/homescreen/qml/main.qml @@ -16,23 +16,20 @@ */ import QtQuick 2.2 -import QtQuick.Window 2.1 +import QtQuick.Window 2.13 import QtQuick.Layouts 1.1 import HomeScreen 1.0 Window { visible: true flags: Qt.FramelessWindowHint - width: container.width * container.scale - height: container.height * container.scale + width: Screen.width + height: Screen.height title: 'HomeScreen' Image { id: container - anchors.centerIn: parent - width: 1080 - height: 1920 - scale: screenInfo.scale_factor() + anchors.fill: parent source: './images/AGL_HMI_Blue_Background_NoCar-01.png' ColumnLayout { @@ -90,16 +87,7 @@ Window { } } - Connections { - target: homescreenHandler - onShowInformation: { - bottomText.text = info - bottomInformation.visible = true - informationTimer.restart() - } - } - - Timer { + Timer { id:notificationTimer interval: 3000 running: false @@ -143,14 +131,4 @@ Window { } } } - - Connections { - target: homescreenHandler - onShowNotification: { - notificationIcon.source = icon_path - notificationtext.text = text - notificationItem.visible = true - notificationTimer.restart() - } - } } diff --git a/homescreen/qml/qml.qrc b/homescreen/qml/qml.qrc index e60ea63..9639467 100644 --- a/homescreen/qml/qml.qrc +++ b/homescreen/qml/qml.qrc @@ -1,6 +1,9 @@ <RCC> <qresource prefix="/"> <file>main.qml</file> + <file>background.qml</file> + <file>toppanel.qml</file> + <file>bottompanel.qml</file> <file>MediaArea.qml</file> <file>MediaAreaBlank.qml</file> <file>MediaAreaMusic.qml</file> diff --git a/homescreen/qml/toppanel.qml b/homescreen/qml/toppanel.qml new file mode 100644 index 0000000..957b957 --- /dev/null +++ b/homescreen/qml/toppanel.qml @@ -0,0 +1,15 @@ +import QtQuick 2.13 +import QtQuick.Window 2.13 +import QtQuick.Controls 2.13 + +Window { + id: toppanel + width: Screen.width + height: Screen.height * (240.0 / 1920.0) + flags: Qt.FramelessWindowHint + visible: true + //color: "#aaaa0000" + + TopArea { + } +} |