Add compact mode for sidepanes + setting
This commit is contained in:
@@ -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
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user