From 8276e800beecc68ce3995c346c8aa27a7ec990be Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 30 Aug 2019 11:05:11 -0400 Subject: [PATCH] Rename SidePane components --- src/qml/Shortcuts.qml | 10 ++++---- ...elegateAccount.qml => AccountDelegate.qml} | 6 ++--- .../{DelegateRoom.qml => RoomDelegate.qml} | 2 +- src/qml/SidePane/SidePane.qml | 24 +++++++++---------- .../{AccountRoomList.qml => SidePaneList.qml} | 12 +++++----- .../{PaneToolBar.qml => SidePaneToolBar.qml} | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) rename src/qml/SidePane/{DelegateAccount.qml => AccountDelegate.qml} (93%) rename src/qml/SidePane/{DelegateRoom.qml => RoomDelegate.qml} (97%) rename src/qml/SidePane/{AccountRoomList.qml => SidePaneList.qml} (92%) rename src/qml/SidePane/{PaneToolBar.qml => SidePaneToolBar.qml} (95%) diff --git a/src/qml/Shortcuts.qml b/src/qml/Shortcuts.qml index 8b954cd7..5723b1ff 100644 --- a/src/qml/Shortcuts.qml +++ b/src/qml/Shortcuts.qml @@ -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() } } diff --git a/src/qml/SidePane/DelegateAccount.qml b/src/qml/SidePane/AccountDelegate.qml similarity index 93% rename from src/qml/SidePane/DelegateAccount.qml rename to src/qml/SidePane/AccountDelegate.qml index 9877bb41..d694860a 100644 --- a/src/qml/SidePane/DelegateAccount.qml +++ b/src/qml/SidePane/AccountDelegate.qml @@ -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) {} diff --git a/src/qml/SidePane/DelegateRoom.qml b/src/qml/SidePane/RoomDelegate.qml similarity index 97% rename from src/qml/SidePane/DelegateRoom.qml rename to src/qml/SidePane/RoomDelegate.qml index e66f4bb4..fa96fab7 100644 --- a/src/qml/SidePane/DelegateRoom.qml +++ b/src/qml/SidePane/RoomDelegate.qml @@ -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 {} } diff --git a/src/qml/SidePane/SidePane.qml b/src/qml/SidePane/SidePane.qml index 5e7dd57e..04ba1d59 100644 --- a/src/qml/SidePane/SidePane.qml +++ b/src/qml/SidePane/SidePane.qml @@ -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 } } } diff --git a/src/qml/SidePane/AccountRoomList.qml b/src/qml/SidePane/SidePaneList.qml similarity index 92% rename from src/qml/SidePane/AccountRoomList.qml rename to src/qml/SidePane/SidePaneList.qml index 1ce1e920..93daf3de 100644 --- a/src/qml/SidePane/AccountRoomList.qml +++ b/src/qml/SidePane/SidePaneList.qml @@ -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} ) } diff --git a/src/qml/SidePane/PaneToolBar.qml b/src/qml/SidePane/SidePaneToolBar.qml similarity index 95% rename from src/qml/SidePane/PaneToolBar.qml rename to src/qml/SidePane/SidePaneToolBar.qml index d58dfdd8..a6eb9319 100644 --- a/src/qml/SidePane/PaneToolBar.qml +++ b/src/qml/SidePane/SidePaneToolBar.qml @@ -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 }