-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Optimize ContactsView & MembersTabPanel settings pages
- removed nested ListViews inside StackLayouts, in order to reduce the memory footprint and improve performance, and also to be able to better manage the scrolling - no more unrolled multiple listviews, which again hurt the performance; now the views instantiate the delegates dynamically on the fly - the tab bar and the search fields now stick to the top of the page, with the users list view scrolling independently - both views now uniformly use the common `ContactListItemDelegate` - the received/sent CRs are now combined into one `pendingContacts` model - factored out common search/filter criteria into a new, separate SFPM `UserFilterContainer` component - fix an issue where StatusContactVerificationIcons wasn't properly displaying the "blocked" state/icon - fix documentation comments, removed relative imports, and updated some Fixes #16612 Fixes #16958
- Loading branch information
Showing
31 changed files
with
735 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
import StatusQ 0.1 | ||
|
||
import Models 1.0 | ||
import Storybook 1.0 | ||
|
||
import SortFilterProxyModel 0.2 | ||
|
||
import utils 1.0 | ||
|
||
import shared.stores 1.0 as SharedStores | ||
import AppLayouts.Profile.views 1.0 | ||
import AppLayouts.Profile.stores 1.0 | ||
import mainui.adaptors 1.0 | ||
|
||
Item { | ||
id: root | ||
|
||
ContactsView { | ||
sectionTitle: "Contacts" | ||
anchors.fill: parent | ||
anchors.leftMargin: 64 | ||
anchors.topMargin: 16 | ||
contentWidth: 560 | ||
|
||
contactsStore: ContactsStore { | ||
function joinPrivateChat(pubKey) {} | ||
function acceptContactRequest(pubKey, contactRequestId) {} | ||
function dismissContactRequest(pubKey, contactRequestId) {} | ||
} | ||
utilsStore: SharedStores.UtilsStore { | ||
function getEmojiHash(publicKey) { | ||
if (publicKey === "") | ||
return "" | ||
|
||
return JSON.stringify(["👨🏻🍼", "🏃🏿♂️", "🌇", "🤶🏿", "🏮","🤷🏻♂️", "🤦🏻", "📣", "🤎", "👷🏽", "😺", "🥞", "🔃", "🧝🏽♂️"]) | ||
} | ||
} | ||
|
||
mutualContactsModel: adaptor.mutualContacts | ||
blockedContactsModel: adaptor.blockedContacts | ||
pendingContactsModel: adaptor.pendingContacts | ||
pendingReceivedContactsCount: adaptor.pendingReceivedRequestContacts.count | ||
} | ||
|
||
ContactsModelAdaptor { | ||
id: adaptor | ||
allContacts: SortFilterProxyModel { | ||
sourceModel: UsersModel {} | ||
proxyRoles: [ | ||
FastExpressionRole { | ||
function displayNameProxy(localNickname, ensName, displayName, aliasName) { | ||
return ProfileUtils.displayName(localNickname, ensName, displayName, aliasName) | ||
} | ||
|
||
name: "preferredDisplayName" | ||
expectedRoles: ["localNickname", "displayName", "ensName", "alias"] | ||
expression: displayNameProxy(model.localNickname, model.ensName, model.displayName, model.alias) | ||
} | ||
] | ||
} | ||
} | ||
} | ||
|
||
// category: Views | ||
// status: good |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.