Add more control on radiuses from themes

This commit is contained in:
miruka 2020-03-15 15:01:09 -04:00
parent 615c08848d
commit ebab1e15c2
6 changed files with 55 additions and 23 deletions

View File

@ -6,7 +6,7 @@ import QtQuick.Layouts 1.12
Rectangle {
id: box
color: theme.controls.box.background
radius: theme.radius
radius: theme.controls.box.radius
implicitWidth: theme.controls.box.defaultWidth
implicitHeight: childrenRect.height

View File

@ -23,7 +23,11 @@ HTileDelegate {
userId: model.id
displayName: model.display_name
mxc: model.avatar_url
radius: mainPane.small ? circleRadius : theme.controls.avatar.radius
radius:
mainPane.small ?
theme.mainPane.listView.account.collapsedAvatarRadius :
theme.mainPane.listView.account.avatarRadius
Behavior on radius { HNumberAnimation {} }
}

View File

@ -19,6 +19,13 @@ HTileDelegate {
roomId: model.id
displayName: model.display_name
mxc: model.avatar_url
radius:
mainPane.small ?
theme.mainPane.listView.room.collapsedAvatarRadius :
theme.mainPane.listView.room.avatarRadius
Behavior on radius { HNumberAnimation {} }
}
title.color: theme.mainPane.listView.room.name

View File

@ -7,7 +7,7 @@ import "../../.."
HRowLayout {
id: eventContent
spacing: theme.spacing / 1.25
spacing: theme.chat.message.horizontalSpacing
layoutDirection: onRight ? Qt.RightToLeft: Qt.LeftToRight
@ -77,6 +77,7 @@ HRowLayout {
mxc: model.sender_avatar
width: parent.width
height: collapseAvatar ? 1 : theme.chat.message.avatarSize
radius: theme.chat.message.avatarRadius
}
}
@ -92,7 +93,7 @@ HRowLayout {
index: model.index
visible: ! pureMedia
topPadding: theme.spacing / 1.75
topPadding: theme.chat.message.verticalSpacing
bottomPadding: topPadding
leftPadding: eventContent.spacing
rightPadding: leftPadding
@ -154,7 +155,7 @@ HRowLayout {
(pureMedia ? 0 : parent.leftPadding + parent.rightPadding),
)
height: contentColumn.height
radius: theme.radius
radius: theme.chat.message.radius
z: -100
color: isOwn?
theme.chat.message.ownBackground :

View File

@ -268,6 +268,9 @@ mainPane:
color background: "transparent"
color name: colors.text
int avatarRadius: controls.avatar.radius
int collapsedAvatarRadius: controls.avatar.size / 2
room:
real leftRoomOpacity: 0.65
@ -278,6 +281,9 @@ mainPane:
color subtitle: colors.dimText
color subtitleQuote: chat.message.quote
int avatarRadius: controls.avatar.radius
int collapsedAvatarRadius: controls.avatar.radius
bottomBar:
color background: colors.strongBackground
color settingsButtonBackground: "transparent"
@ -326,8 +332,12 @@ chat:
message:
int avatarSize: 58 * uiScale
int collapsedAvatarSize: 28 * uiScale
int avatarRadius: controls.avatar.radius
int radius: theme.radius
int horizontalSpacing: theme.spacing / 1.25
int verticalSpacing: theme.spacing / 1.75
color background: colors.mediumBackground
color ownBackground: colors.strongBackground

View File

@ -278,6 +278,9 @@ mainPane:
color background: "transparent"
color name: colors.text
int avatarRadius: controls.avatar.radius
int collapsedAvatarRadius: controls.avatar.size / 2
room:
real leftRoomOpacity: 0.65
@ -288,6 +291,9 @@ mainPane:
color subtitle: colors.dimText
color subtitleQuote: chat.message.quote
int avatarRadius: controls.avatar.radius
int collapsedAvatarRadius: controls.avatar.radius
bottomBar:
color background: colors.strongBackground
color settingsButtonBackground: "transparent"
@ -336,8 +342,12 @@ chat:
message:
int avatarSize: 58 * uiScale
int collapsedAvatarSize: 28 * uiScale
int avatarRadius: controls.avatar.radius
int radius: theme.radius
int horizontalSpacing: theme.spacing / 1.25
int verticalSpacing: theme.spacing / 1.75
color background: colors.mediumBackground
color ownBackground: colors.strongBackground