Image viewer: fix info bar text vertical alignment

This commit is contained in:
miruka 2020-07-22 01:31:06 -04:00
parent aba29a198d
commit 5dbcf9c825

View File

@ -30,12 +30,13 @@ Rectangle {
id: title id: title
text: viewer.fullTitle text: viewer.fullTitle
elide: HLabel.ElideMiddle elide: HLabel.ElideMiddle
topPadding: theme.spacing / 2 topPadding: layout.vertical ? theme.spacing / 2 : 0
bottomPadding: topPadding verticalAlignment: HLabel.AlignVCenter
horizontalAlignment: horizontalAlignment:
layout.vertical ? HLabel.AlignHCenter : HLabel.AlignLeft layout.vertical ? HLabel.AlignHCenter : HLabel.AlignLeft
Layout.fillWidth: maxTitleWidth < 0 Layout.fillWidth: maxTitleWidth < 0
Layout.fillHeight: true
Layout.maximumWidth: maxTitleWidth Layout.maximumWidth: maxTitleWidth
} }
@ -53,8 +54,10 @@ Rectangle {
topPadding: theme.spacing / 2 topPadding: theme.spacing / 2
bottomPadding: topPadding bottomPadding: topPadding
horizontalAlignment: HLabel.AlignHCenter horizontalAlignment: HLabel.AlignHCenter
verticalAlignment: HLabel.AlignVCenter
Layout.fillWidth: layout.vertical Layout.fillWidth: layout.vertical
Layout.fillHeight: true
} }
HLabel { HLabel {
@ -62,11 +65,11 @@ Rectangle {
visible: viewer.fullFileSize !== 0 visible: viewer.fullFileSize !== 0
text: CppUtils.formattedBytes(viewer.fullFileSize) text: CppUtils.formattedBytes(viewer.fullFileSize)
elide: HLabel.ElideRight elide: HLabel.ElideRight
topPadding: theme.spacing / 2
bottomPadding: topPadding
horizontalAlignment: HLabel.AlignHCenter horizontalAlignment: HLabel.AlignHCenter
verticalAlignment: HLabel.AlignVCenter
Layout.fillWidth: layout.vertical Layout.fillWidth: layout.vertical
Layout.fillHeight: true
} }
HLoader { HLoader {
@ -78,9 +81,14 @@ Rectangle {
Layout.bottomMargin: Layout.topMargin Layout.bottomMargin: Layout.topMargin
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: active ? height : 0 Layout.preferredWidth: active ? height : 0
Layout.preferredHeight: fileSize.implicitHeight - theme.spacing Layout.preferredHeight: theme.baseElementsHeight - theme.spacing
Behavior on Layout.preferredWidth { HNumberAnimation {} } Behavior on Layout.preferredWidth { HNumberAnimation {} }
} }
Item {
visible: layout.vertical
height: theme.spacing / 2
}
} }
} }