diff --git a/nymea-app/ui/MainPage.qml b/nymea-app/ui/MainPage.qml index ac0016b2..88a24a37 100644 --- a/nymea-app/ui/MainPage.qml +++ b/nymea-app/ui/MainPage.qml @@ -48,6 +48,10 @@ Page { title: d.configOverlay !== null ? qsTr("Configure main view") : filteredContentModel.data(swipeView.currentIndex, "displayName") leftButtonVisible: true leftButtonImageSource: { + if (app.hasOwnProperty("headerIcon")) { + return app.headerIcon + } + switch (engine.jsonRpcClient.currentConnection.bearerType) { case Connection.BearerTypeLan: case Connection.BearerTypeWan: diff --git a/nymea-app/ui/components/FancyHeader.qml b/nymea-app/ui/components/FancyHeader.qml index 59099639..69aadafd 100644 --- a/nymea-app/ui/components/FancyHeader.qml +++ b/nymea-app/ui/components/FancyHeader.qml @@ -56,18 +56,43 @@ ToolBar { opacity: menuOpen ? 0 : 1 Behavior on opacity { NumberAnimation { easing.type: Easing.InOutQuad; duration: 200 } } - HeaderButton { + ToolButton { id: leftButton - imageSource: "../images/navigation-menu.svg" + property string imageSource: "../images/navigation-menu.svg" visible: false onClicked: root.leftButtonClicked() + + contentItem: Item { + height: 20 + width: 20 + Loader { + id: image + anchors.fill: parent + anchors.margins: app.margins / 2 + opacity: enabled ? 1 : .5 + sourceComponent: leftButton.imageSource.endsWith(".gif") ? animatedImageComponent : stillImageComponent + Component { + id: animatedImageComponent + AnimatedImage { + source: leftButton.imageSource + } + } + Component { + id: stillImageComponent + Image { + source: leftButton.imageSource + } + } + + } + } } Label { id: label Layout.fillWidth: true Layout.fillHeight: true - Layout.margins: app.margins + Layout.topMargin: app.margins; Layout.bottomMargin: app.margins; Layout.leftMargin: leftButton.visible ? 0 : app.margins verticalAlignment: Text.AlignVCenter font.pixelSize: app.mediumFont elide: Text.ElideRight