From 02f751eba52245f2ea2788abb7933e3ccfc8fb32 Mon Sep 17 00:00:00 2001 From: George Yatsev Date: Mon, 16 Jul 2018 18:32:20 +0300 Subject: [PATCH] ui improvements first part. --- nymea-app/ui/Nymea.qml | 1 + nymea-app/ui/components/FancyHeader.qml | 2 +- nymea-app/ui/devicelistpages/GenericDeviceListPage.qml | 2 +- nymea-app/ui/mainviews/DevicesPage.qml | 2 +- nymea-app/ui/mainviews/DevicesPageDelegate.qml | 6 ++++-- nymea-app/ui/mainviews/FavoritesView.qml | 5 ++++- nymea-app/ui/mainviews/ScenesView.qml | 7 +++++-- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml index 5c0b2c46..df8ee59b 100644 --- a/nymea-app/ui/Nymea.qml +++ b/nymea-app/ui/Nymea.qml @@ -16,6 +16,7 @@ ApplicationWindow { property int margins: 14 property int bigMargins: 20 + property int extraSmallFont: 10 property int smallFont: 13 property int mediumFont: 16 property int largeFont: 20 diff --git a/nymea-app/ui/components/FancyHeader.qml b/nymea-app/ui/components/FancyHeader.qml index cc22e67e..86046168 100644 --- a/nymea-app/ui/components/FancyHeader.qml +++ b/nymea-app/ui/components/FancyHeader.qml @@ -113,7 +113,7 @@ ToolBar { elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - font.pixelSize: app.smallFont - 2 + font.pixelSize: app.extraSmallFont } } } diff --git a/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml b/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml index a792d936..dacc2ce5 100644 --- a/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml @@ -19,7 +19,7 @@ Page { header: GuhHeader { text: { if (subPage.shownInterfaces.length === 1) { - return qsTr("My %1 things").arg(interfaceToString(subPage.filterInterface)) + return qsTr("My %1 things").arg(app.interfaceToString(subPage.shownInterfaces[0])) } else if (subPage.shownInterfaces.length > 1 || subPage.hiddenInterfaces.length > 0) { return qsTr("My things") } diff --git a/nymea-app/ui/mainviews/DevicesPage.qml b/nymea-app/ui/mainviews/DevicesPage.qml index fbaa2f5b..7eca6603 100644 --- a/nymea-app/ui/mainviews/DevicesPage.qml +++ b/nymea-app/ui/mainviews/DevicesPage.qml @@ -24,7 +24,7 @@ Item { devices: Engine.deviceManager.devices } cellWidth: width / tilesPerRow - cellHeight: Math.max(cellWidth, minTileHeight) + cellHeight: cellWidth delegate: DevicesPageDelegate { width: interfacesGridView.cellWidth height: interfacesGridView.cellHeight diff --git a/nymea-app/ui/mainviews/DevicesPageDelegate.qml b/nymea-app/ui/mainviews/DevicesPageDelegate.qml index 863e8bee..72fc4e50 100644 --- a/nymea-app/ui/mainviews/DevicesPageDelegate.qml +++ b/nymea-app/ui/mainviews/DevicesPageDelegate.qml @@ -18,7 +18,7 @@ Item { anchors.verticalCenterOffset: -app.iconSize spacing: app.margins ColorIcon { - height: app.iconSize * 2 + height: app.iconSize * 1.3 width: height color: app.guhAccent anchors.horizontalCenter: parent.horizontalCenter @@ -27,6 +27,9 @@ Item { Label { text: interfaceToString(model.name).toUpperCase() + font.pixelSize: app.extraSmallFont + font.bold: true + font.letterSpacing: 1 width: parent.width horizontalAlignment: Text.AlignHCenter wrapMode: Text.WrapAtWordBoundaryOrAnywhere @@ -69,7 +72,6 @@ Item { color: "black" opacity: .05 } - Loader { id: inlineControlLoader anchors { diff --git a/nymea-app/ui/mainviews/FavoritesView.qml b/nymea-app/ui/mainviews/FavoritesView.qml index 747b6550..aa5354dc 100644 --- a/nymea-app/ui/mainviews/FavoritesView.qml +++ b/nymea-app/ui/mainviews/FavoritesView.qml @@ -128,7 +128,10 @@ Item { Label { Layout.fillWidth: true - text: delegateRoot.device.name + text: delegateRoot.device.name.toUpperCase() + font.pixelSize: app.extraSmallFont + font.bold: true + font.letterSpacing: 1 wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter } diff --git a/nymea-app/ui/mainviews/ScenesView.qml b/nymea-app/ui/mainviews/ScenesView.qml index 62714156..11e67b7e 100644 --- a/nymea-app/ui/mainviews/ScenesView.qml +++ b/nymea-app/ui/mainviews/ScenesView.qml @@ -24,7 +24,7 @@ Item { filterExecutable: true } cellWidth: width / tilesPerRow - cellHeight: Math.max(cellWidth, minTileHeight) + cellHeight: cellWidth delegate: Item { id: scenesDelegate width: interfacesGridView.cellWidth @@ -67,7 +67,10 @@ Item { Label { Layout.fillWidth: true - text: model.name + text: model.name.toUpperCase() + font.pixelSize: app.extraSmallFont + font.bold: true + font.letterSpacing: 1 wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter maximumLineCount: 2