Improve overall theme and pane colors

This commit is contained in:
miruka
2020-03-13 01:09:04 -04:00
parent 0068550410
commit 5cee0f6c8a
14 changed files with 300 additions and 269 deletions

View File

@@ -4,60 +4,67 @@ import QtQuick 2.12
import QtQuick.Layouts 1.12
import "../Base"
HRowLayout {
Rectangle {
// Hide filter field overflowing for a sec on size changes
clip: true
color: theme.mainPane.bottomBar.background
property AccountRoomsList mainPaneList
readonly property alias addAccountButton: addAccountButton
readonly property alias filterField: filterField
property alias roomFilter: filterField.text
HButton {
id: addAccountButton
icon.name: "add-account"
toolTip.text: qsTr("Add another account")
backgroundColor: theme.mainPane.settingsButton.background
onClicked: pageLoader.showPage("AddAccount/AddAccount")
Layout.fillHeight: true
}
HRowLayout {
anchors.fill: parent
HTextField {
id: filterField
saveName: "roomFilterField"
HButton {
id: addAccountButton
icon.name: "add-account"
toolTip.text: qsTr("Add another account")
backgroundColor: theme.mainPane.bottomBar.settingsButtonBackground
onClicked: pageLoader.showPage("AddAccount/AddAccount")
placeholderText: qsTr("Filter rooms")
backgroundColor: theme.mainPane.filterRooms.background
bordered: false
opacity: width >= 16 * theme.uiScale ? 1 : 0
Layout.fillWidth: true
Layout.fillHeight: true
Keys.onUpPressed: mainPaneList.previous(false) // do not activate
Keys.onDownPressed: mainPaneList.next(false)
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: {
if (event.modifiers & Qt.ShiftModifier) {
mainPaneList.toggleCollapseAccount()
return
}
if (window.settings.clearRoomFilterOnEnter) {
mainPaneList.setCollapseAccount(false)
text = ""
}
mainPaneList.requestActivate()
Layout.fillHeight: true
}
Keys.onEscapePressed: {
if (window.settings.clearRoomFilterOnEscape) text = ""
mainUI.pageLoader.forceActiveFocus()
}
HTextField {
id: filterField
saveName: "roomFilterField"
Behavior on opacity { HNumberAnimation {} }
placeholderText: qsTr("Filter rooms")
backgroundColor: theme.mainPane.bottomBar.filterFieldBackground
bordered: false
opacity: width >= 16 * theme.uiScale ? 1 : 0
Layout.fillWidth: true
Layout.fillHeight: true
Keys.onUpPressed: mainPaneList.previous(false) // do not activate
Keys.onDownPressed: mainPaneList.next(false)
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: {
if (event.modifiers & Qt.ShiftModifier) {
mainPaneList.toggleCollapseAccount()
return
}
if (window.settings.clearRoomFilterOnEnter) {
mainPaneList.setCollapseAccount(false)
text = ""
}
mainPaneList.requestActivate()
}
Keys.onEscapePressed: {
if (window.settings.clearRoomFilterOnEscape) text = ""
mainUI.pageLoader.forceActiveFocus()
}
Behavior on opacity { HNumberAnimation {} }
}
}
}