diff --git a/src/controls/GlobalDrawer.qml b/src/controls/GlobalDrawer.qml --- a/src/controls/GlobalDrawer.qml +++ b/src/controls/GlobalDrawer.qml @@ -255,7 +255,7 @@ : bannerImage.Layout.preferredHeight Layout.fillWidth: true - visible: bannerImage.title.length > 0 || bannerImage.titleIcon.length > 0 || bannerImage.source.length > 0 || root.collapsible + visible: !bannerImage.empty || root.collapsible BannerImage { id: bannerImage @@ -286,11 +286,12 @@ } PrivateActionToolButton { id: collapseButton + readonly property bool noTitle: (!root.title || root.title.length===0) && (!root.titleIcon || root.title.length===0) anchors { top: parent.top left: parent.left - topMargin: root.collapsed || (root.title.length == 0 && root.titleIcon.length == 0) ? 0 : Units.smallSpacing + Units.iconSizes.large/2 - height/2 - leftMargin: root.collapsed || (root.title.length == 0 && root.titleIcon.length == 0) ? 0 : Units.smallSpacing + topMargin: root.collapsed || noTitle ? 0 : Units.smallSpacing + Units.iconSizes.large/2 - height/2 + leftMargin: root.collapsed || noTitle ? 0 : Units.smallSpacing Behavior on leftMargin { NumberAnimation { duration: Units.longDuration diff --git a/src/controls/private/BannerImage.qml b/src/controls/private/BannerImage.qml --- a/src/controls/private/BannerImage.qml +++ b/src/controls/private/BannerImage.qml @@ -76,6 +76,12 @@ Layout.minimumHeight: titleLayout.implicitHeight > 0 ? titleLayout.implicitHeight + Kirigami.Units.smallSpacing * 2 : 0 property int implicitWidth: Layout.preferredWidth + readonly property bool empty: bannerImage.title !== undefined && bannerImage.title.length === 0 && + bannerImage.source !== undefined && bannerImage.source.length === 0 && + bannerImage.titleIcon !== undefined &&bannerImage.titleIcon.length === 0 + + + fillMode: Image.PreserveAspectCrop asynchronous: true