Add compact mode for sidepanes + setting

This commit is contained in:
miruka
2020-03-22 12:50:10 -04:00
parent c65d51b0e8
commit 5d513f84fa
8 changed files with 27 additions and 3 deletions

View File

@@ -6,8 +6,12 @@ import "../Base"
Rectangle {
id: avatar
implicitWidth: theme.controls.avatar.size
implicitHeight: theme.controls.avatar.size
implicitWidth: implicitHeight
implicitHeight:
compact ?
theme.controls.avatar.compactSize :
theme.controls.avatar.size
radius: theme.controls.avatar.radius
color: avatarImage.visible ? "transparent" : utils.hsluv(
@@ -18,6 +22,8 @@ Rectangle {
)
property bool compact: false
property string name
property alias mxc: avatarImage.mxc
property alias title: avatarImage.title

View File

@@ -11,6 +11,7 @@ HButton {
default property alias additionalData: contentItem.data
property bool compact: window.settings.alwaysUseCompactMode
property real contentOpacity: 1
readonly property alias title: title
@@ -77,7 +78,7 @@ HButton {
color: theme.colors.dimText
visible: Layout.maximumHeight > 0
Layout.maximumHeight: text ? implicitWidth : 0
Layout.maximumHeight: ! compact && text ? implicitHeight : 0
Layout.fillWidth: true
Layout.fillHeight: true
@@ -87,6 +88,16 @@ HButton {
}
Binding on topPadding {
value: spacing / 4
when: compact
}
Binding on bottomPadding {
value: spacing / 4
when: compact
}
TapHandler {
acceptedButtons: Qt.LeftButton
onTapped: leftClicked()