New pane theming

This commit is contained in:
miruka
2020-04-27 23:49:36 -04:00
parent 93c7fadeed
commit 9b3127b7c3
8 changed files with 57 additions and 41 deletions

View File

@@ -9,7 +9,7 @@ import "../Base/HTile"
HTile {
id: account
implicitHeight: theme.baseElementsHeight
backgroundColor: theme.mainPane.listView.account.background
backgroundColor: theme.accountView.account.background
padded: false
contentItem: ContentRow {
@@ -28,7 +28,7 @@ HTile {
color:
hovered ?
utils.nameColor(model.display_name || model.id.substring(1)) :
theme.mainPane.listView.account.name
theme.accountView.account.name
Behavior on color { HColorAnimation {} }
}

View File

@@ -52,7 +52,7 @@ HSwipeView {
placeholderText: qsTr("Filter rooms")
backgroundColor:
theme.mainPane.bottomBar.filterFieldBackground
theme.accountView.bottomBar.filterFieldBackground
bordered: false
opacity: width >= 16 * theme.uiScale ? 1 : 0

View File

@@ -13,7 +13,7 @@ HColumnLayout {
HButton {
id: settingsButton
backgroundColor: "transparent"
backgroundColor: theme.accountsBar.settingsButtonBackground
icon.name: "settings"
toolTip.text: qsTr("Open config folder")
@@ -30,7 +30,7 @@ HColumnLayout {
delegate: HTileDelegate {
id: tile
width: accountList.width
backgroundColor: theme.mainPane.listView.account.background
backgroundColor: theme.accountsBar.accountList.account.background
leftPadding: 0
rightPadding: leftPadding
@@ -45,7 +45,7 @@ HColumnLayout {
mxc: model.avatar_url
// compact: account.compact
radius: theme.mainPane.listView.account.avatarRadius
radius: theme.accountsBar.accountList.account.avatarRadius
}
}
@@ -64,13 +64,19 @@ HColumnLayout {
sequences: window.settings.keys.goToNextAccount
onActivated: accountView.incrementWrapIndex()
}
Rectangle {
anchors.fill: parent
z: -100
color: theme.accountsBar.accountList.background
}
}
HButton {
id: addAccountButton
icon.name: "add-account"
toolTip.text: qsTr("Add another account")
backgroundColor: theme.mainPane.bottomBar.settingsButtonBackground
backgroundColor: theme.accountsBar.addAccountButtonBackground
onClicked: pageLoader.showPage("AddAccount/AddAccount")
Layout.preferredHeight: theme.baseElementsHeight

View File

@@ -7,7 +7,7 @@ import "../Base"
HDrawer {
id: mainPane
saveName: "mainPane"
color: theme.mainPane.background
background: null
// minimumSize: bottomBar.addAccountButton.width
// property alias filter: bottomBar.roomFilter

View File

@@ -9,13 +9,9 @@ import "../Base/HTile"
HTileDelegate {
id: room
backgroundColor: theme.mainPane.listView.room.background
backgroundColor: theme.accountView.roomList.room.background
opacity:
model.left ? theme.mainPane.listView.room.leftRoomOpacity : 1
// topPadding: theme.spacing / (model.index === 0 ? 1 : 1.5)
// bottomPadding:
// theme.spacing / (model.index === view.count - 1 ? 1 : 1.5)
model.left ? theme.accountView.roomList.room.leftRoomOpacity : 1
contentItem: ContentRow {
tile: room
@@ -29,8 +25,8 @@ HTileDelegate {
radius:
mainPane.small ?
theme.mainPane.listView.room.collapsedAvatarRadius :
theme.mainPane.listView.room.avatarRadius
theme.accountView.roomList.room.collapsedAvatarRadius :
theme.accountView.roomList.room.avatarRadius
Behavior on radius { HNumberAnimation {} }
}
@@ -41,7 +37,7 @@ HTileDelegate {
TitleLabel {
text: model.display_name || qsTr("Empty room")
color: theme.mainPane.listView.room.name
color: theme.accountView.roomList.room.name
}
HLabel {
@@ -63,7 +59,7 @@ HTileDelegate {
radius: theme.radius / 4
readonly property QtObject indicatorTheme:
theme.mainPane.listView.room.unreadIndicator
theme.accountView.roomList.room.unreadIndicator
Behavior on color { HColorAnimation {} }
}
@@ -84,7 +80,7 @@ HTileDelegate {
TitleRightInfoLabel {
tile: room
color: theme.mainPane.listView.room.lastEventDate
color: theme.accountView.roomList.room.lastEventDate
text: {
model.last_event_date < new Date(1) ?
"" :
@@ -106,7 +102,7 @@ HTileDelegate {
SubtitleLabel {
tile: room
color: theme.mainPane.listView.room.subtitle
color: theme.accountView.roomList.room.subtitle
textFormat: Text.StyledText
font.italic:
lastEvent && lastEvent.event_type === "RoomMessageEmote"
@@ -128,7 +124,8 @@ HTileDelegate {
lastEvent.sender_name, lastEvent.sender_id
) + ": " + lastEvent.inline_content
const subColor = theme.mainPane.listView.room.subtitleQuote
const subColor =
theme.accountView.roomList.room.subtitleQuote
return text.replace(
/< *span +class=['"]?quote['"]? *>(.+?)<\/ *span *>/g,

View File

@@ -75,4 +75,10 @@ HListView {
wheel.accepted = false
}
}
Rectangle {
anchors.fill: parent
z: -100
color: theme.accountView.roomList.background
}
}