Rename SidePane components

This commit is contained in:
miruka 2019-08-30 11:05:11 -04:00
parent 244fc12465
commit 8276e800be
6 changed files with 28 additions and 28 deletions

View File

@ -43,32 +43,32 @@ HShortcutHandler {
HShortcut {
enabled: mainUI.accountsPresent
sequences: settings.keys.clearRoomFilter
onPressed: mainUI.sidePane.paneToolBar.roomFilter = ""
onPressed: mainUI.sidePane.toolBar.roomFilter = ""
}
HShortcut {
enabled: mainUI.accountsPresent
sequences: settings.keys.addNewAccount
onPressed: mainUI.sidePane.paneToolBar.addAccountButton.clicked()
onPressed: mainUI.sidePane.toolBar.addAccountButton.clicked()
}
HShortcut {
enabled: mainUI.accountsPresent
sequences: settings.keys.goToPreviousRoom
onPressed: mainUI.sidePane.accountRoomList.previous()
onPressed: mainUI.sidePane.sidePaneList.previous()
onHeld: pressed(event)
}
HShortcut {
enabled: mainUI.accountsPresent
sequences: settings.keys.goToNextRoom
onPressed: mainUI.sidePane.accountRoomList.next()
onPressed: mainUI.sidePane.sidePaneList.next()
onHeld: pressed(event)
}
HShortcut {
enabled: mainUI.accountsPresent
sequences: settings.keys.toggleCollapseAccount
onPressed: mainUI.sidePane.accountRoomList.toggleCollapseAccount()
onPressed: mainUI.sidePane.sidePaneList.toggleCollapseAccount()
}
}

View File

@ -16,18 +16,18 @@ HTileDelegate {
window.uiState.pageProperties.userId == model.data.user_id
setCurrentTimer.running:
! accountRoomList.activateLimiter.running && ! sidePane.hasFocus
! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
Behavior on opacity { HNumberAnimation {} }
property bool disconnecting: false
readonly property bool forceExpand: Boolean(accountRoomList.filter)
readonly property bool forceExpand: Boolean(sidePaneList.filter)
// Hide harmless error when a filter matches nothing
readonly property bool collapsed: try {
return accountRoomList.collapseAccounts[model.data.user_id] || false
return sidePaneList.collapseAccounts[model.data.user_id] || false
} catch (err) {}

View File

@ -15,7 +15,7 @@ HTileDelegate {
window.uiState.pageProperties.roomId == model.data.room_id
setCurrentTimer.running:
! accountRoomList.activateLimiter.running && ! sidePane.hasFocus
! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
Behavior on opacity { HNumberAnimation {} }

View File

@ -11,9 +11,9 @@ Rectangle {
color: theme.sidePane.background
property bool hasFocus: paneToolBar.filterField.activeFocus
property alias accountRoomList: accountRoomList
property alias paneToolBar: paneToolBar
property bool hasFocus: toolbar.filterField.activeFocus
property alias sidePaneList: sidePaneList
property alias toolbar: toolbar
property real autoWidthRatio: theme.sidePane.autoWidthRatio
property bool manuallyResizing: false
@ -28,7 +28,7 @@ Rectangle {
}
}
onFocusChanged: if (focus) paneToolBar.filterField.forceActiveFocus()
onFocusChanged: if (focus) toolbar.filterField.forceActiveFocus()
onManualWidthChanged: {
window.uiState.sidePaneManualWidth = manualWidth
@ -83,29 +83,29 @@ Rectangle {
Keys.enabled: sidePane.hasFocus
Keys.onUpPressed: accountRoomList.previous(false) // do not activate
Keys.onDownPressed: accountRoomList.next(false)
Keys.onUpPressed: sidePaneList.previous(false) // do not activate
Keys.onDownPressed: sidePaneList.next(false)
Keys.onEnterPressed: Keys.onReturnPressed(event)
Keys.onReturnPressed: if (event.modifiers & Qt.ShiftModifier) {
accountRoomList.toggleCollapseAccount()
sidePaneList.toggleCollapseAccount()
} else {
accountRoomList.activate()
sidePaneList.activate()
}
HColumnLayout {
anchors.fill: parent
AccountRoomList {
id: accountRoomList
SidePaneList {
id: sidePaneList
clip: true
Layout.fillWidth: true
Layout.fillHeight: true
}
PaneToolBar {
id: paneToolBar
SidePaneToolBar {
id: toolbar
}
}
}

View File

@ -4,12 +4,12 @@ import "../Base"
import "../utils.js" as Utils
HListView {
id: accountRoomList
id: sidePaneList
readonly property var originSource: window.sidePaneModelSource
readonly property var collapseAccounts: window.uiState.collapseAccounts
readonly property string filter: paneToolBar.roomFilter
readonly property string filter: toolbar.roomFilter
readonly property alias activateLimiter: activateLimiter
onOriginSourceChanged: filterLimiter.restart()
@ -20,7 +20,7 @@ HListView {
function filterSource() {
let show = []
// Hide a harmless error when activating a DelegateRoom
// Hide a harmless error when activating a RoomDelegate
try { window.sidePaneModelSource } catch (err) { return }
for (let i = 0; i < window.sidePaneModelSource.length; i++) {
@ -99,11 +99,11 @@ HListView {
}
delegate: Loader {
width: accountRoomList.width
width: sidePaneList.width
Component.onCompleted: setSource(
model.type == "Account" ?
"DelegateAccount.qml" : "DelegateRoom.qml",
{view: accountRoomList}
"AccountDelegate.qml" : "RoomDelegate.qml",
{view: sidePaneList}
)
}

View File

@ -40,7 +40,7 @@ HRowLayout {
Connections {
target: window
// Keep multiple instances of PaneToolBar in sync.
// Keep multiple instances of SidePaneToolBar in sync.
// This also sets the text on startup.
onUiStateChanged: filterField.text = uiState.sidePaneFilter
}