Begin yet another model refactor
Use native ListModel which require a lot of changes, but should be much faster than the old way which exponentially slowed down to a crawl. Also fix some popup bugs (leave/forget). Not working yet: side pane keyboard controls, proper highlight, room & member filtering, local echo replacement
This commit is contained in:
@@ -3,29 +3,29 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import "../.."
|
||||
import "../../Base"
|
||||
|
||||
HPage {
|
||||
id: accountSettings
|
||||
hideHeaderUnderHeight: avatarPreferredSize
|
||||
headerLabel.text: qsTr("Account settings for %1").arg(
|
||||
utils.coloredNameHtml(headerName, userId)
|
||||
)
|
||||
|
||||
|
||||
property int avatarPreferredSize: 256 * theme.uiScale
|
||||
|
||||
property string userId: ""
|
||||
|
||||
readonly property bool ready:
|
||||
accountInfo !== "waiting" && Boolean(accountInfo.profile_updated)
|
||||
accountInfo !== null && accountInfo.profile_updated > new Date(1)
|
||||
|
||||
readonly property var accountInfo: utils.getItem(
|
||||
modelSources["Account"] || [], "user_id", userId
|
||||
) || "waiting"
|
||||
readonly property QtObject accountInfo:
|
||||
ModelStore.get("accounts").find(userId)
|
||||
|
||||
property string headerName: ready ? accountInfo.display_name : userId
|
||||
|
||||
hideHeaderUnderHeight: avatarPreferredSize
|
||||
headerLabel.text: qsTr("Account settings for %1").arg(
|
||||
utils.coloredNameHtml(headerName, userId)
|
||||
)
|
||||
|
||||
|
||||
HSpacer {}
|
||||
|
||||
|
Reference in New Issue
Block a user