Add compact mode for sidepanes + setting
This commit is contained in:
parent
c65d51b0e8
commit
5d513f84fa
|
@ -208,6 +208,7 @@ class UISettings(JSONDataFile):
|
||||||
return {
|
return {
|
||||||
"alertOnMessageForMsec": 4000,
|
"alertOnMessageForMsec": 4000,
|
||||||
"alwaysCenterRoomHeader": False,
|
"alwaysCenterRoomHeader": False,
|
||||||
|
"alwaysUseCompactMode": False,
|
||||||
"clearRoomFilterOnEnter": True,
|
"clearRoomFilterOnEnter": True,
|
||||||
"clearRoomFilterOnEscape": True,
|
"clearRoomFilterOnEscape": True,
|
||||||
"collapseSidePanesUnderWindowWidth": 400,
|
"collapseSidePanesUnderWindowWidth": 400,
|
||||||
|
|
|
@ -6,8 +6,12 @@ import "../Base"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: avatar
|
id: avatar
|
||||||
implicitWidth: theme.controls.avatar.size
|
implicitWidth: implicitHeight
|
||||||
implicitHeight: theme.controls.avatar.size
|
implicitHeight:
|
||||||
|
compact ?
|
||||||
|
theme.controls.avatar.compactSize :
|
||||||
|
theme.controls.avatar.size
|
||||||
|
|
||||||
radius: theme.controls.avatar.radius
|
radius: theme.controls.avatar.radius
|
||||||
|
|
||||||
color: avatarImage.visible ? "transparent" : utils.hsluv(
|
color: avatarImage.visible ? "transparent" : utils.hsluv(
|
||||||
|
@ -18,6 +22,8 @@ Rectangle {
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
property bool compact: false
|
||||||
|
|
||||||
property string name
|
property string name
|
||||||
property alias mxc: avatarImage.mxc
|
property alias mxc: avatarImage.mxc
|
||||||
property alias title: avatarImage.title
|
property alias title: avatarImage.title
|
||||||
|
|
|
@ -11,6 +11,7 @@ HButton {
|
||||||
|
|
||||||
default property alias additionalData: contentItem.data
|
default property alias additionalData: contentItem.data
|
||||||
|
|
||||||
|
property bool compact: window.settings.alwaysUseCompactMode
|
||||||
property real contentOpacity: 1
|
property real contentOpacity: 1
|
||||||
|
|
||||||
readonly property alias title: title
|
readonly property alias title: title
|
||||||
|
@ -77,7 +78,7 @@ HButton {
|
||||||
color: theme.colors.dimText
|
color: theme.colors.dimText
|
||||||
|
|
||||||
visible: Layout.maximumHeight > 0
|
visible: Layout.maximumHeight > 0
|
||||||
Layout.maximumHeight: text ? implicitWidth : 0
|
Layout.maximumHeight: ! compact && text ? implicitHeight : 0
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: 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 {
|
TapHandler {
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onTapped: leftClicked()
|
onTapped: leftClicked()
|
||||||
|
|
|
@ -23,6 +23,7 @@ HTileDelegate {
|
||||||
userId: model.id
|
userId: model.id
|
||||||
displayName: model.display_name
|
displayName: model.display_name
|
||||||
mxc: model.avatar_url
|
mxc: model.avatar_url
|
||||||
|
compact: account.compact
|
||||||
|
|
||||||
radius:
|
radius:
|
||||||
mainPane.small ?
|
mainPane.small ?
|
||||||
|
|
|
@ -7,6 +7,7 @@ import ".."
|
||||||
import "../Base"
|
import "../Base"
|
||||||
|
|
||||||
HTileDelegate {
|
HTileDelegate {
|
||||||
|
id: room
|
||||||
backgroundColor: theme.mainPane.listView.room.background
|
backgroundColor: theme.mainPane.listView.room.background
|
||||||
opacity: model.left ? theme.mainPane.listView.room.leftRoomOpacity : 1
|
opacity: model.left ? theme.mainPane.listView.room.leftRoomOpacity : 1
|
||||||
|
|
||||||
|
@ -19,6 +20,7 @@ HTileDelegate {
|
||||||
roomId: model.id
|
roomId: model.id
|
||||||
displayName: model.display_name
|
displayName: model.display_name
|
||||||
mxc: model.avatar_url
|
mxc: model.avatar_url
|
||||||
|
compact: room.compact
|
||||||
|
|
||||||
radius:
|
radius:
|
||||||
mainPane.small ?
|
mainPane.small ?
|
||||||
|
|
|
@ -17,6 +17,7 @@ HTileDelegate {
|
||||||
powerLevel: model.power_level
|
powerLevel: model.power_level
|
||||||
shiftMembershipIconPosition: ! roomPane.collapsed
|
shiftMembershipIconPosition: ! roomPane.collapsed
|
||||||
invited: model.invited
|
invited: model.invited
|
||||||
|
compact: memberDelegate.compact
|
||||||
}
|
}
|
||||||
|
|
||||||
title.text: model.display_name || model.id
|
title.text: model.display_name || model.id
|
||||||
|
|
|
@ -218,6 +218,7 @@ controls:
|
||||||
|
|
||||||
avatar:
|
avatar:
|
||||||
int size: baseElementsHeight
|
int size: baseElementsHeight
|
||||||
|
int compactSize: baseElementsHeight / 2
|
||||||
int radius: theme.radius
|
int radius: theme.radius
|
||||||
|
|
||||||
hoveredImage:
|
hoveredImage:
|
||||||
|
|
|
@ -224,6 +224,7 @@ controls:
|
||||||
|
|
||||||
avatar:
|
avatar:
|
||||||
int size: baseElementsHeight
|
int size: baseElementsHeight
|
||||||
|
int compactSize: baseElementsHeight / 2
|
||||||
int radius: theme.radius
|
int radius: theme.radius
|
||||||
|
|
||||||
hoveredImage:
|
hoveredImage:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user