From 58e0fce8199a6349359dc6de44e49d0b295e4142 Mon Sep 17 00:00:00 2001 From: MishkaRogachev Date: Thu, 14 Jul 2022 14:03:36 +0300 Subject: [PATCH] feat(@desktop): Fix twitchy scrolling issues Close #6187 --- .../AppLayouts/Browser/panels/DownloadBar.qml | 7 +- .../Browser/panels/DownloadView.qml | 4 +- .../Browser/panels/FavoritesBar.qml | 14 ++- .../Chat/panels/ContactListPanel.qml | 84 ++++++++-------- .../AppLayouts/Chat/panels/GroupChatPanel.qml | 5 +- .../Chat/panels/SuggestionBoxPanel.qml | 9 +- .../Chat/panels/SuggestionFilterPanel.qml | 4 +- .../AppLayouts/Chat/panels/UserListPanel.qml | 24 ++--- .../CommunityEditSettingsPanel.qml | 2 +- .../CommunityMembersSettingsPanel.qml | 3 +- .../Chat/popups/ContactRequestsPopup.qml | 7 +- .../AppLayouts/Chat/popups/GroupInfoPopup.qml | 3 +- .../Chat/popups/PinnedMessagesPopup.qml | 8 +- .../popups/community/CommunitiesPopup.qml | 4 +- .../popups/community/CommunityDetailPopup.qml | 4 +- .../popups/community/CreateCategoryPopup.qml | 3 +- .../community/MembershipRequestsPopup.qml | 3 +- .../Chat/views/ChatMessagesView.qml | 12 +-- .../Chat/views/CommunityColumnView.qml | 4 +- .../Chat/views/CommunitySettingsView.qml | 2 +- .../Chat/views/ContactsColumnView.qml | 26 ++--- .../AppLayouts/Chat/views/CreateChatView.qml | 2 +- .../popups/CreateCommunityPopup.qml | 2 +- .../Onboarding/panels/AccountListPanel.qml | 6 +- .../Onboarding/views/InsertDetailsView.qml | 7 +- .../Profile/panels/CommunitiesListPanel.qml | 2 +- .../Profile/panels/ContactsListPanel.qml | 7 +- ui/app/AppLayouts/Profile/popups/ENSPopup.qml | 3 +- .../Profile/popups/MutedChatsModal.qml | 5 +- .../popups/backupseed/BackupSeedStepBase.qml | 2 +- .../AppLayouts/Profile/views/DevicesView.qml | 2 +- .../AppLayouts/Profile/views/EnsListView.qml | 26 ++--- .../Profile/views/NotificationsView.qml | 3 +- .../Profile/views/SettingsContentBase.qml | 45 ++++----- .../Wallet/popups/CryptoServicesModal.qml | 3 +- .../AppLayouts/Wallet/views/LeftTabView.qml | 99 +++++++++---------- .../Wallet/views/SavedAddressesView.qml | 15 +-- .../collectibles/CollectibleDetailView.qml | 5 +- ui/app/mainui/AppMain.qml | 2 +- ui/imports/shared/status/StatusChatInput.qml | 4 +- .../shared/status/StatusInputListPopup.qml | 6 +- .../shared/status/StatusSearchListPopup.qml | 3 +- .../shared/status/StatusStickersPopup.qml | 1 - ui/imports/shared/views/AssetsView.qml | 21 ++-- ui/imports/shared/views/ExistingContacts.qml | 58 +++++------ ui/imports/shared/views/HistoryView.qml | 9 +- .../shared/views/TabAddressSelectorView.qml | 14 +-- 47 files changed, 252 insertions(+), 332 deletions(-) diff --git a/ui/app/AppLayouts/Browser/panels/DownloadBar.qml b/ui/app/AppLayouts/Browser/panels/DownloadBar.qml index 33a89f28c9..492316b794 100644 --- a/ui/app/AppLayouts/Browser/panels/DownloadBar.qml +++ b/ui/app/AppLayouts/Browser/panels/DownloadBar.qml @@ -1,10 +1,11 @@ import QtQuick 2.1 import QtGraphicalEffects 1.13 -import utils 1.0 - +import StatusQ.Core 0.1 import StatusQ.Controls 0.1 +import utils 1.0 + import "../controls" Rectangle { @@ -35,7 +36,7 @@ Rectangle { height: listView.height clip: true - ListView { + StatusListView { id: listView orientation: ListView.Horizontal model: downloadsModel diff --git a/ui/app/AppLayouts/Browser/panels/DownloadView.qml b/ui/app/AppLayouts/Browser/panels/DownloadView.qml index f7f8db52de..4001a4cf94 100644 --- a/ui/app/AppLayouts/Browser/panels/DownloadView.qml +++ b/ui/app/AppLayouts/Browser/panels/DownloadView.qml @@ -1,5 +1,7 @@ import QtQuick 2.1 +import StatusQ.Core 0.1 + import utils 1.0 import "../controls" @@ -15,7 +17,7 @@ import "../controls" color: Style.current.background - ListView { + StatusListView { id: listView anchors { topMargin: Style.current.bigPadding diff --git a/ui/app/AppLayouts/Browser/panels/FavoritesBar.qml b/ui/app/AppLayouts/Browser/panels/FavoritesBar.qml index 46e20cc9f5..27df9ea106 100644 --- a/ui/app/AppLayouts/Browser/panels/FavoritesBar.qml +++ b/ui/app/AppLayouts/Browser/panels/FavoritesBar.qml @@ -1,10 +1,11 @@ import QtQuick 2.13 import QtQuick.Layouts 1.13 -import utils 1.0 - +import StatusQ.Core 0.1 import StatusQ.Controls 0.1 +import utils 1.0 + RowLayout { id: favoritesBar @@ -17,15 +18,12 @@ RowLayout { spacing: 0 height: 38 - ListView { + StatusListView { id: bookmarkList spacing: Style.current.halfPadding orientation : ListView.Horizontal - height: parent.height - clip: true - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - width: parent.width - boundsBehavior: Flickable.StopAtBounds + Layout.fillWidth: true + Layout.fillHeight: true delegate: StatusFlatButton { id: favoriteBtn height: 32 diff --git a/ui/app/AppLayouts/Chat/panels/ContactListPanel.qml b/ui/app/AppLayouts/Chat/panels/ContactListPanel.qml index a216ebb2ee..d66a9f28f3 100644 --- a/ui/app/AppLayouts/Chat/panels/ContactListPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/ContactListPanel.qml @@ -7,69 +7,63 @@ import StatusQ.Controls 0.1 import utils 1.0 -StatusScrollView { +StatusListView { id: contactListPanel - property alias model: groupMembers.model property string searchString property bool selectMode: true property var onItemChecked property var selectedPubKeys: [] + spacing: 0 + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: groupMembers.contentHeight > groupMembers.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - ListView { - id: groupMembers - anchors.fill: parent - spacing: 0 - clip: true - delegate: StatusListItem { - id: contactDelegate + delegate: StatusListItem { + id: contactDelegate - property bool isChecked: selectedPubKeys.indexOf(model.pubKey) !== -1 + property bool isChecked: selectedPubKeys.indexOf(model.pubKey) !== -1 - visible: { - if (selectMode) { - return !searchString || model.displayName.toLowerCase().includes(searchString) - } - return checkbox.checked + visible: { + if (selectMode) { + return !searchString || model.displayName.toLowerCase().includes(searchString) } + return checkbox.checked + } - title: !model.displayName.endsWith(".eth") && !!model.localNickname ? - model.localNickname : Utils.removeStatusEns(model.displayName) - image.source: Global.getProfileImage(model.pubKey) - ringSettings.ringSpecModel: Utils.getColorHashAsJson(model.pubKey) + title: !model.displayName.endsWith(".eth") && !!model.localNickname ? + model.localNickname : Utils.removeStatusEns(model.displayName) + image.source: Global.getProfileImage(model.pubKey) + ringSettings.ringSpecModel: Utils.getColorHashAsJson(model.pubKey) - height: visible ? implicitHeight : 0 + height: visible ? implicitHeight : 0 - function contactToggled(pubKey) { - if (contactListPanel.selectMode) { - let pubkeys = contactListPanel.selectedPubKeys - let idx = pubkeys.indexOf(pubKey) - if (idx === -1) { - pubkeys.push(pubKey) - } else if (idx > -1) { - pubkeys.splice(idx, 1); - } - contactListPanel.selectedPubKeys = pubkeys + function contactToggled(pubKey) { + if (contactListPanel.selectMode) { + let pubkeys = contactListPanel.selectedPubKeys + let idx = pubkeys.indexOf(pubKey) + if (idx === -1) { + pubkeys.push(pubKey) + } else if (idx > -1) { + pubkeys.splice(idx, 1); + } + contactListPanel.selectedPubKeys = pubkeys + } + } + + components: [ + StatusCheckBox { + id: checkbox + visible: contactListPanel.selectMode + checked: selectedPubKeys.indexOf(model.pubKey) !== -1 + onClicked: { + contactDelegate.contactToggled(model.pubKey) } } - - components: [ - StatusCheckBox { - id: checkbox - visible: contactListPanel.selectMode - checked: selectedPubKeys.indexOf(model.pubKey) !== -1 - onClicked: { - contactDelegate.contactToggled(model.pubKey) - } - } - ] - onClicked: { - contactDelegate.contactToggled(model.pubKey) - } + ] + onClicked: { + contactDelegate.contactToggled(model.pubKey) } } } diff --git a/ui/app/AppLayouts/Chat/panels/GroupChatPanel.qml b/ui/app/AppLayouts/Chat/panels/GroupChatPanel.qml index 7212a885b2..558ed78a85 100644 --- a/ui/app/AppLayouts/Chat/panels/GroupChatPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/GroupChatPanel.qml @@ -1,6 +1,7 @@ import QtQuick 2.13 import QtQuick.Layouts 1.13 +import StatusQ.Core 0.1 import StatusQ.Components 0.1 import StatusQ.Controls 0.1 @@ -43,7 +44,7 @@ RowLayout { } } - ListView { + StatusListView { id: groupUsersModelListView visible: false model: root.chatContentModule.usersModule.model @@ -55,7 +56,7 @@ RowLayout { } } - ListView { + StatusListView { id: contactsModelListView visible: false model: root.rootStore.contactsModel diff --git a/ui/app/AppLayouts/Chat/panels/SuggestionBoxPanel.qml b/ui/app/AppLayouts/Chat/panels/SuggestionBoxPanel.qml index 4a0f5203ef..44574825b1 100644 --- a/ui/app/AppLayouts/Chat/panels/SuggestionBoxPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/SuggestionBoxPanel.qml @@ -22,12 +22,12 @@ import QtQuick.Controls 2.13 import QtGraphicalEffects 1.13 import QtQml.Models 2.13 -import utils 1.0 -import shared.controls 1.0 - +import StatusQ.Core 0.1 import StatusQ.Components 0.1 +import utils 1.0 import shared 1.0 +import shared.controls 1.0 import shared.panels 1.0 import shared.controls.chat 1.0 @@ -117,7 +117,7 @@ Rectangle { cursorPosition: container.cursorPosition } - ListView { + StatusListView { id: listView model: mentionsListDelegate keyNavigationEnabled: true @@ -126,7 +126,6 @@ Rectangle { anchors.leftMargin: Style.current.halfPadding anchors.rightMargin: Style.current.halfPadding anchors.bottomMargin: Style.current.halfPadding - clip: true Keys.priority: Keys.AfterItem Keys.forwardTo: container.inputField Keys.onPressed: { diff --git a/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml b/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml index da12984014..0e2bf0ff70 100644 --- a/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml @@ -1,6 +1,8 @@ import QtQuick 2.13 import utils 1.0 +import StatusQ.Core 0.1 + Item { id: suggestionsPanelRoot property alias model: filterModel @@ -17,7 +19,7 @@ Item { onSourceModelChanged: invalidateFilter() Component.onCompleted: invalidateFilter() - ListView { + StatusListView { // This is a fake list (invisible), used just for the sake of accessing items of the `sourceModel` // without exposing explicit methods from the model which would return item detail. // In general the whole thing about preparing/displaying suggestion panel and list there should diff --git a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml index 13b386119d..f4dbfe9331 100644 --- a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml @@ -1,16 +1,16 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 -import StatusQ.Components 0.1 -import shared 1.0 -import shared.panels 1.0 -import shared.status 1.0 - -import utils 1.0 - -import "../controls" import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 +import StatusQ.Components 0.1 + +import shared 1.0 +import shared.panels 1.0 +import shared.status 1.0 +import utils 1.0 + +import "../controls" Item { id: root @@ -39,12 +39,8 @@ Item { text: root.label } - ListView { + StatusListView { id: userListView - clip: true - ScrollBar.vertical: ScrollBar { - policy: ScrollBar.AsNeeded - } anchors { top: titleText.bottom topMargin: Style.current.padding @@ -53,7 +49,7 @@ Item { bottom: parent.bottom bottomMargin: Style.current.bigPadding } - boundsBehavior: Flickable.StopAtBounds + model: usersModule.model section.property: "onlineStatus" section.delegate: (root.width > 58) ? sectionDelegateComponent : null diff --git a/ui/app/AppLayouts/Chat/panels/communities/CommunityEditSettingsPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/CommunityEditSettingsPanel.qml index 7d48e16b05..97529bb9b7 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/CommunityEditSettingsPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/CommunityEditSettingsPanel.qml @@ -51,7 +51,7 @@ StatusScrollView { ColumnLayout { id: layout - width: root.width + width: root.availableWidth spacing: 12 CommunityNameInput { diff --git a/ui/app/AppLayouts/Chat/panels/communities/CommunityMembersSettingsPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/CommunityMembersSettingsPanel.qml index f4ab65cc14..daf0d33af1 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/CommunityMembersSettingsPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/CommunityMembersSettingsPanel.qml @@ -78,14 +78,13 @@ SettingsPageLayout { color: Theme.palette.baseColor1 } - ListView { + StatusListView { id: memberList Layout.fillWidth: true Layout.fillHeight: true model: root.membersModel - clip: true // TODO: use StatusMemberListItem (it does not behave correctly right now) delegate: StatusListItem { diff --git a/ui/app/AppLayouts/Chat/popups/ContactRequestsPopup.qml b/ui/app/AppLayouts/Chat/popups/ContactRequestsPopup.qml index 52e79f9c6a..38949ba97d 100644 --- a/ui/app/AppLayouts/Chat/popups/ContactRequestsPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/ContactRequestsPopup.qml @@ -3,10 +3,10 @@ import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 import QtGraphicalEffects 1.13 -import utils 1.0 - +import StatusQ.Core 0.1 import StatusQ.Controls 0.1 +import utils 1.0 import shared.popups 1.0 import "../panels" @@ -19,7 +19,7 @@ ModalPopup { title: qsTr("Contact requests") - ListView { + StatusListView { id: contactList anchors.fill: parent @@ -27,7 +27,6 @@ ModalPopup { anchors.rightMargin: -Style.current.halfPadding model: popup.store.contactRequestsModel - clip: true delegate: ContactRequestPanel { contactPubKey: model.pubKey diff --git a/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml b/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml index 748b8ae34d..c4f2b00e58 100644 --- a/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml @@ -193,11 +193,10 @@ StatusModal { visible: pinnedMessagesBtn.visible } - ListView { + StatusListView { id: memberList Layout.fillWidth: true Layout.fillHeight: true - clip: true model: popup.chatContentModule.usersModule.model delegate: StatusListItem { id: contactRow diff --git a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml index 25c9a43b0d..d7da4e0682 100644 --- a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml @@ -1,6 +1,9 @@ import QtQuick 2.13 import QtQuick.Controls 2.3 +import StatusQ.Core 0.1 +import StatusQ.Controls 0.1 as StatusQControls + import utils 1.0 import shared 1.0 import shared.views 1.0 @@ -13,8 +16,6 @@ import "../panels" //TODO remove or make view? import "../views" -import StatusQ.Controls 0.1 as StatusQControls - // TODO: replace with StatusMOdal ModalPopup { id: popup @@ -83,7 +84,7 @@ ModalPopup { id: pinButtonGroup } - ListView { + StatusListView { id: pinnedMessageListView model: popup.pinnedMessagesModel height: parent.height @@ -94,7 +95,6 @@ ModalPopup { topMargin: Style.current.halfPadding anchors.top: parent.top anchors.topMargin: -Style.current.halfPadding - clip: true delegate: Item { id: messageDelegate diff --git a/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml index 0dcbbcfad2..77d06d53f6 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CommunitiesPopup.qml @@ -8,7 +8,6 @@ import StatusQ.Controls 0.1 import StatusQ.Components 0.1 import StatusQ.Popups 0.1 - import utils 1.0 import shared 1.0 @@ -76,11 +75,10 @@ StatusModal { bottomPadding: 8 height: 400 - ListView { + StatusListView { anchors.fill: parent model: communitiesDelegateModel spacing: 4 - clip: true id: communitiesList section.property: "name" diff --git a/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml index c415eee010..cc89736a45 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml @@ -8,7 +8,6 @@ import StatusQ.Components 0.1 import StatusQ.Controls 0.1 import StatusQ.Popups 0.1 - import utils 1.0 StatusModal { @@ -115,11 +114,10 @@ StatusModal { height: 300 ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ListView { + StatusListView { id: chatList anchors.fill: parent model: community.chats - boundsBehavior: Flickable.StopAtBounds delegate: StatusListItem { anchors.horizontalCenter: parent.horizontalCenter title: "#" + model.name diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml index 5cd51462b8..8c7b06aabd 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml @@ -106,7 +106,7 @@ StatusModal { } } - ListView { + StatusListView { id: communityChannelList anchors.top: channelsLabel.bottom @@ -114,7 +114,6 @@ StatusModal { width: parent.width model: isEdit ? root.store.chatCommunitySectionModule.editCategoryChannelsModel : root.store.chatCommunitySectionModule.model interactive: false - clip: true delegate: StatusListItem { anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml b/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml index 8ecefe3357..205df9e0ff 100644 --- a/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml @@ -7,7 +7,6 @@ import StatusQ.Controls 0.1 import StatusQ.Components 0.1 import StatusQ.Popups 0.1 - import utils 1.0 import shared 1.0 @@ -50,7 +49,7 @@ StatusModal { bottomPadding: 8 height: 300 - ListView { + StatusListView { id: membershipRequestList anchors.fill: parent model: popup.communityData.pendingRequestsToJoin diff --git a/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml b/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml index fc04c22ae4..7e607a282e 100644 --- a/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml @@ -6,6 +6,10 @@ import QtQml.Models 2.13 import QtGraphicalEffects 1.13 import QtQuick.Dialogs 1.3 +import StatusQ.Core 0.1 +import StatusQ.Controls 0.1 +import StatusQ.Components 0.1 + import utils 1.0 import shared 1.0 import shared.views 1.0 @@ -14,8 +18,6 @@ import shared.popups 1.0 import shared.status 1.0 import shared.controls 1.0 import shared.views.chat 1.0 -import StatusQ.Core 0.1 -import StatusQ.Components 0.1 import "../controls" @@ -93,15 +95,13 @@ Item { } } - ListView { + StatusListView { id: chatLogView anchors.top: loadingMessagesIndicator.bottom anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right spacing: 0 - boundsBehavior: Flickable.StopAtBounds - clip: true verticalLayoutDirection: ListView.BottomToTop // This header and Connections is to create an invisible padding so that the chat identifier is at the top @@ -124,7 +124,7 @@ Item { } } - ScrollBar.vertical: ScrollBar { + ScrollBar.vertical: StatusScrollBar { visible: chatLogView.visibleArea.heightRatio < 1 } diff --git a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml index 43e11c1291..eef5e8c58a 100644 --- a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml @@ -101,7 +101,7 @@ Item { } StatusScrollView { - id: chatGroupsContainer + id: scrollView anchors.top: membershipRequests.bottom anchors.topMargin: Style.current.padding anchors.bottom: createChatOrCommunity.top @@ -362,7 +362,7 @@ Item { Column { id: bannerColumn - width: parent.width + width: scrollView.availableWidth anchors.top: communityChatListAndCategories.bottom anchors.topMargin: Style.current.padding spacing: Style.current.bigPadding diff --git a/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml b/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml index 0543ddfa32..7b07426662 100644 --- a/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml +++ b/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml @@ -68,7 +68,7 @@ StatusAppTwoPanelLayout { text: qsTr("Settings") } - ListView { + StatusListView { id: listView Layout.fillWidth: true diff --git a/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml b/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml index 90a6cfa5ad..c90517f92d 100644 --- a/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml @@ -2,6 +2,11 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 +import StatusQ.Core 0.1 +import StatusQ.Core.Theme 0.1 +import StatusQ.Controls 0.1 +import StatusQ.Components 0.1 +import StatusQ.Popups 0.1 import utils 1.0 import shared 1.0 @@ -11,12 +16,6 @@ import "../panels" import "../popups" import "../popups/community" -import StatusQ.Core 0.1 -import StatusQ.Core.Theme 0.1 -import StatusQ.Controls 0.1 -import StatusQ.Components 0.1 -import StatusQ.Popups 0.1 - Item { id: root width: 304 @@ -139,15 +138,13 @@ Item { // chat list StatusScrollView { - id: scrollView + id: scroll Layout.fillWidth: true Layout.fillHeight: true - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - StatusChatList { id: channelList - width: scrollView.availableWidth + width: scroll.availableWidth model: root.chatSectionModule.model highlightItem: !root.store.openCreateChat onChatItemSelected: { @@ -234,15 +231,6 @@ Item { } } } - - EmptyViewPanel { - id: emptyViewAndSuggestions - visible: !localAccountSensitiveSettings.hideChannelSuggestions - anchors.top: channelList.bottom - anchors.topMargin: Style.current.padding - rootStore: root.store - onSuggestedMessageClicked: chatSectionModule.createPublicChat(channel) - } } } diff --git a/ui/app/AppLayouts/Chat/views/CreateChatView.qml b/ui/app/AppLayouts/Chat/views/CreateChatView.qml index 170959e5fa..70cd2ffd50 100644 --- a/ui/app/AppLayouts/Chat/views/CreateChatView.qml +++ b/ui/app/AppLayouts/Chat/views/CreateChatView.qml @@ -25,7 +25,7 @@ Page { root.rootStore.openCreateChat = false; } - ListView { + StatusListView { id: contactsModelListView anchors.left: parent.left anchors.right: parent.right diff --git a/ui/app/AppLayouts/CommunitiesPortal/popups/CreateCommunityPopup.qml b/ui/app/AppLayouts/CommunitiesPortal/popups/CreateCommunityPopup.qml index 1f9bd367d2..5d83694505 100644 --- a/ui/app/AppLayouts/CommunitiesPortal/popups/CreateCommunityPopup.qml +++ b/ui/app/AppLayouts/CommunitiesPortal/popups/CreateCommunityPopup.qml @@ -46,7 +46,7 @@ StatusStackModal { ColumnLayout { id: generalViewLayout - width: generalView.width + width: generalView.availableWidth spacing: 12 CommunityNameInput { diff --git a/ui/app/AppLayouts/Onboarding/panels/AccountListPanel.qml b/ui/app/AppLayouts/Onboarding/panels/AccountListPanel.qml index f88cba1311..e4e66df872 100644 --- a/ui/app/AppLayouts/Onboarding/panels/AccountListPanel.qml +++ b/ui/app/AppLayouts/Onboarding/panels/AccountListPanel.qml @@ -1,11 +1,13 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 -import "../controls" +import StatusQ.Core 0.1 import utils 1.0 -ListView { +import "../controls" + +StatusListView { id: accountsView property var isSelected: function () {} diff --git a/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml b/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml index fff596e40e..053b211289 100644 --- a/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml +++ b/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml @@ -9,13 +9,12 @@ import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 import StatusQ.Popups 0.1 - import shared.panels 1.0 import shared 1.0 import shared.popups 1.0 - -import utils 1.0 import shared.controls 1.0 +import utils 1.0 + import "../popups" import "../stores" import "../shared" @@ -40,7 +39,7 @@ Item { Loader { active: !OnboardingStore.onboardingModuleInst.importedAccountPubKey - sourceComponent: ListView { + sourceComponent: StatusListView { model: OnboardingStore.onboardingModuleInst.accountsModel delegate: Item { Component.onCompleted: { diff --git a/ui/app/AppLayouts/Profile/panels/CommunitiesListPanel.qml b/ui/app/AppLayouts/Profile/panels/CommunitiesListPanel.qml index 1e891c27fb..96255fac7e 100644 --- a/ui/app/AppLayouts/Profile/panels/CommunitiesListPanel.qml +++ b/ui/app/AppLayouts/Profile/panels/CommunitiesListPanel.qml @@ -9,7 +9,7 @@ import StatusQ.Popups 0.1 import utils 1.0 -ListView { +StatusListView { id: root property bool hasAddedContacts: false diff --git a/ui/app/AppLayouts/Profile/panels/ContactsListPanel.qml b/ui/app/AppLayouts/Profile/panels/ContactsListPanel.qml index c80f490b90..e5832bb16c 100644 --- a/ui/app/AppLayouts/Profile/panels/ContactsListPanel.qml +++ b/ui/app/AppLayouts/Profile/panels/ContactsListPanel.qml @@ -3,12 +3,14 @@ import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 import QtQml.Models 2.13 +import StatusQ.Core 0.1 + import utils 1.0 import shared 1.0 import shared.popups 1.0 import shared.panels 1.0 -import "../../Chat/popups" +import "../../Chat/popups" import "." Item { @@ -89,14 +91,13 @@ Item { delegate: contactPanelComponent } - ListView { + StatusListView { id: contactsList anchors.top: title.bottom anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom interactive: false - clip: true ScrollBar.vertical: ScrollBar { policy: contactListRoot.scrollbarOn ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded } diff --git a/ui/app/AppLayouts/Profile/popups/ENSPopup.qml b/ui/app/AppLayouts/Profile/popups/ENSPopup.qml index a33888f958..ed4c33de68 100644 --- a/ui/app/AppLayouts/Profile/popups/ENSPopup.qml +++ b/ui/app/AppLayouts/Profile/popups/ENSPopup.qml @@ -55,11 +55,10 @@ ModalPopup { ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.vertical.policy: ensNames.contentHeight > ensNames.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - ListView { + StatusListView { anchors.fill: parent model: root.ensUsernamesStore.ensUsernamesModel spacing: 0 - clip: true id: ensNames delegate: RadioDelegate { id: radioDelegate diff --git a/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml b/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml index ef4bf37b70..3295da43f8 100644 --- a/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml +++ b/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml @@ -3,13 +3,12 @@ import QtQuick.Controls 2.13 import QtGraphicalEffects 1.13 import QtQuick.Layouts 1.13 -import utils 1.0 - import StatusQ.Controls 0.1 import StatusQ.Components 0.1 import StatusQ.Core.Theme 0.1 import StatusQ.Core 0.1 +import utils 1.0 import shared 1.0 import shared.panels 1.0 import shared.popups 1.0 @@ -28,7 +27,7 @@ ModalPopup { root.destroy() } - ListView { + StatusListView { id: mutedChatsList anchors.fill: parent model: root.model diff --git a/ui/app/AppLayouts/Profile/popups/backupseed/BackupSeedStepBase.qml b/ui/app/AppLayouts/Profile/popups/backupseed/BackupSeedStepBase.qml index c2da6ec6cb..310dae8121 100644 --- a/ui/app/AppLayouts/Profile/popups/backupseed/BackupSeedStepBase.qml +++ b/ui/app/AppLayouts/Profile/popups/backupseed/BackupSeedStepBase.qml @@ -24,7 +24,7 @@ StatusScrollView { ColumnLayout { id: column - width: parent.width + width: root.availableWidth spacing: Style.current.padding StyledText { diff --git a/ui/app/AppLayouts/Profile/views/DevicesView.qml b/ui/app/AppLayouts/Profile/views/DevicesView.qml index 9aa1237e82..919d096dec 100644 --- a/ui/app/AppLayouts/Profile/views/DevicesView.qml +++ b/ui/app/AppLayouts/Profile/views/DevicesView.qml @@ -155,7 +155,7 @@ SettingsContentBase { color: Theme.palette.directColor1 } - ListView { + StatusListView { id: listView anchors.top: deviceListLbl.bottom anchors.topMargin: Style.current.padding diff --git a/ui/app/AppLayouts/Profile/views/EnsListView.qml b/ui/app/AppLayouts/Profile/views/EnsListView.qml index 2d04bf6661..93afd57b3d 100644 --- a/ui/app/AppLayouts/Profile/views/EnsListView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsListView.qml @@ -2,18 +2,18 @@ import QtQuick 2.14 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.14 -import utils 1.0 - import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 import StatusQ.Controls 0.1 -import "../popups" import shared 1.0 import shared.panels 1.0 import shared.views.chat 1.0 import shared.panels.chat 1.0 import shared.controls.chat 1.0 +import utils 1.0 + +import "../popups" Item { id: root @@ -186,27 +186,21 @@ Item { } Item { + id: ensList anchors.top: usernamesLabel.bottom anchors.topMargin: 10 anchors.left: parent.left anchors.right: parent.right height: 200 - id: ensList - StatusScrollView { + StatusListView { + id: lvEns anchors.fill: parent + model: root.ensUsernamesStore.ensUsernamesModel + spacing: 10 + delegate: ensDelegate - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: lvEns.contentHeight > lvEns.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - - ListView { - id: lvEns - anchors.fill: parent - model: root.ensUsernamesStore.ensUsernamesModel - spacing: 10 - clip: true - delegate: ensDelegate - } + ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded } } } diff --git a/ui/app/AppLayouts/Profile/views/NotificationsView.qml b/ui/app/AppLayouts/Profile/views/NotificationsView.qml index 1746ddec34..06dc4d1f62 100644 --- a/ui/app/AppLayouts/Profile/views/NotificationsView.qml +++ b/ui/app/AppLayouts/Profile/views/NotificationsView.qml @@ -535,11 +535,10 @@ SettingsContentBase { color: Theme.palette.baseColor1 } - ListView { + StatusListView { Layout.preferredWidth: root.contentWidth Layout.preferredHeight: 400 visible: root.notificationsStore.exemptionsModel.count > 0 - clip: true model: root.notificationsStore.exemptionsModel delegate: exemptionDelegateComponent diff --git a/ui/app/AppLayouts/Profile/views/SettingsContentBase.qml b/ui/app/AppLayouts/Profile/views/SettingsContentBase.qml index 88dcb0b8cc..6cef594a0f 100644 --- a/ui/app/AppLayouts/Profile/views/SettingsContentBase.qml +++ b/ui/app/AppLayouts/Profile/views/SettingsContentBase.qml @@ -105,37 +105,32 @@ Item { anchors.bottom: parent.bottom anchors.left: parent.left anchors.topMargin: Style.current.bigPadding + padding: 0 width: root.contentWidth - StatusScrollView { - id: contentFliackable - contentWidth: Math.max(contentLayout.implicitWidth, scrollView.width) - contentHeight: Math.max(contentLayout.implicitHeight, scrollView.height) + scrollView.anchors.topMargin + Column { + id: contentLayout + width: scrollView.availableWidth - Column { - id: contentLayout - anchors.fill: parent.contentItem + MouseArea { + onClicked: root.baseAreaClicked() + width: contentWrapper.implicitWidth + height: contentWrapper.implicitHeight - MouseArea { - onClicked: root.baseAreaClicked() - width: contentWrapper.implicitWidth - height: contentWrapper.implicitHeight - - Column { - id: contentWrapper - } + Column { + id: contentWrapper } + } - Item { - // This is a settingsDirtyToastMessage placeholder - width: settingsDirtyToastMessage.implicitWidth - height: settingsDirtyToastMessage.active ? settingsDirtyToastMessage.implicitHeight : 0 + Item { + // This is a settingsDirtyToastMessage placeholder + width: settingsDirtyToastMessage.implicitWidth + height: settingsDirtyToastMessage.active ? settingsDirtyToastMessage.implicitHeight : 0 - Behavior on implicitHeight { - NumberAnimation { - duration: 150 - easing.type: Easing.InOutQuad - } + Behavior on implicitHeight { + NumberAnimation { + duration: 150 + easing.type: Easing.InOutQuad } } } @@ -147,7 +142,7 @@ Item { anchors.bottom: scrollView.bottom anchors.horizontalCenter: scrollView.horizontalCenter active: root.dirty - flickable: contentFliackable + flickable: scrollView saveChangesButtonEnabled: root.saveChangesButtonEnabled onResetChangesClicked: root.resetChangesClicked() onSaveChangesClicked: root.saveChangesClicked() diff --git a/ui/app/AppLayouts/Wallet/popups/CryptoServicesModal.qml b/ui/app/AppLayouts/Wallet/popups/CryptoServicesModal.qml index 77e74dc234..383e7e4130 100644 --- a/ui/app/AppLayouts/Wallet/popups/CryptoServicesModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/CryptoServicesModal.qml @@ -40,7 +40,7 @@ StatusModal { text: qsTr("Choose a service you'd like to use to buy crypto") } - ListView { + StatusListView { anchors.top: note.bottom anchors.bottom: parent.bottom anchors.topMargin: Style.current.padding @@ -49,7 +49,6 @@ StatusModal { model: RootStore.cryptoRampServicesModel focus: true spacing: Style.current.padding - clip: true delegate: StatusListItem { width: parent.width diff --git a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml index c56fc63d7a..6b64b33b70 100644 --- a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml +++ b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml @@ -3,16 +3,16 @@ import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 import QtGraphicalEffects 1.13 +import StatusQ.Core 0.1 +import StatusQ.Core.Theme 0.1 +import StatusQ.Components 0.1 +import StatusQ.Controls 0.1 + import utils 1.0 import shared 1.0 import shared.panels 1.0 import shared.controls 1.0 -import StatusQ.Components 0.1 -import StatusQ.Core 0.1 -import StatusQ.Core.Theme 0.1 -import StatusQ.Controls 0.1 - import "../controls" import "../popups" import "../stores" @@ -79,62 +79,51 @@ Rectangle { } } - ScrollView { + StatusListView { + spacing: Style.current.smallPadding Layout.fillWidth: true Layout.fillHeight: true Layout.topMargin: Style.current.halfPadding + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: listView.contentHeight > listView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - clip: true - ListView { - id: listView - - spacing: Style.current.smallPadding - anchors.top: parent.top - width: parent.width - height: parent.height - boundsBehavior: Flickable.StopAtBounds - clip: true - - delegate: StatusListItem { - width: ListView.view.width - highlighted: RootStore.currentAccount.name === model.name - title: model.name - subTitle: Utils.toLocaleString(model.currencyBalance.toFixed(2), RootStore.locale, {"model.currency": true}) + " " + RootStore.currentCurrency.toUpperCase() - icon.emoji: !!model.emoji ? model.emoji: "" - icon.color: model.color - icon.name: !model.emoji ? "filled-account": "" - icon.letterSize: 14 - icon.isLetterIdenticon: !!model.emoji ? true : false - icon.background.color: Theme.palette.primaryColor3 - statusListItemTitle.font.weight: Font.Medium - color: sensor.containsMouse || highlighted ? Theme.palette.baseColor3 : "transparent" - onClicked: { - changeSelectedAccount(index) - showSavedAddresses(false) - } + delegate: StatusListItem { + width: ListView.view.width + highlighted: RootStore.currentAccount.name === model.name + title: model.name + subTitle: Utils.toLocaleString(model.currencyBalance.toFixed(2), RootStore.locale, {"model.currency": true}) + " " + RootStore.currentCurrency.toUpperCase() + icon.emoji: !!model.emoji ? model.emoji: "" + icon.color: model.color + icon.name: !model.emoji ? "filled-account": "" + icon.letterSize: 14 + icon.isLetterIdenticon: !!model.emoji ? true : false + icon.background.color: Theme.palette.primaryColor3 + statusListItemTitle.font.weight: Font.Medium + color: sensor.containsMouse || highlighted ? Theme.palette.baseColor3 : "transparent" + onClicked: { + changeSelectedAccount(index) + showSavedAddresses(false) } - - footer: Item { - width: ListView.view.width - height: addAccountBtn.height + Style.current.xlPadding - StatusButton { - id: addAccountBtn - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - anchors.margins: Style.current.bigPadding - font.pixelSize: 15 - font.weight: Font.Medium - icon.name: "add" - text: qsTr("Add account") - onClicked: addAccountModal.open() - } - } - - model: RootStore.accounts - // model: RootStore.exampleWalletModel } + + footer: Item { + width: ListView.view.width + height: addAccountBtn.height + Style.current.xlPadding + StatusButton { + id: addAccountBtn + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.margins: Style.current.bigPadding + font.pixelSize: 15 + font.weight: Font.Medium + icon.name: "add" + text: qsTr("Add account") + onClicked: addAccountModal.open() + } + } + + model: RootStore.accounts + // model: RootStore.exampleWalletModel } Item { Layout.fillHeight: true } @@ -151,4 +140,4 @@ Rectangle { onClicked: showSavedAddresses(true) } } -} +} \ No newline at end of file diff --git a/ui/app/AppLayouts/Wallet/views/SavedAddressesView.qml b/ui/app/AppLayouts/Wallet/views/SavedAddressesView.qml index 38c87460ce..235d8accc1 100644 --- a/ui/app/AppLayouts/Wallet/views/SavedAddressesView.qml +++ b/ui/app/AppLayouts/Wallet/views/SavedAddressesView.qml @@ -225,7 +225,8 @@ Item { text: qsTr("No saved addresses") } - StatusScrollView { + StatusListView { + id: listView anchors.top: errorMessage.bottom anchors.topMargin: Style.current.padding anchors.bottom: parent.bottom @@ -233,14 +234,8 @@ Item { anchors.right: parent.right anchors.left: parent.left visible: listView.count > 0 - - ListView { - id: listView - model: RootStore.savedAddresses - spacing: 5 - width: parent.width - boundsBehavior: Flickable.StopAtBounds - delegate: delegateSavedAddress - } + spacing: 5 + model: RootStore.savedAddresses + delegate: delegateSavedAddress } } diff --git a/ui/app/AppLayouts/Wallet/views/collectibles/CollectibleDetailView.qml b/ui/app/AppLayouts/Wallet/views/collectibles/CollectibleDetailView.qml index 1aeb518a32..eca29734be 100644 --- a/ui/app/AppLayouts/Wallet/views/collectibles/CollectibleDetailView.qml +++ b/ui/app/AppLayouts/Wallet/views/collectibles/CollectibleDetailView.qml @@ -67,16 +67,13 @@ StackDetailBase { } } - ListView { + StatusListView { anchors.top: collectibleImageDetails.bottom anchors.topMargin: 32 anchors.bottom: parent.bottom anchors.bottomMargin: 20 anchors.horizontalCenter: parent.horizontalCenter width: parent.width - - clip: true - boundsBehavior: Flickable.StopAtBounds model: 3 delegate: StatusExpandableItem { width: parent.width diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index a7cd010f65..06fe7248e8 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -939,7 +939,7 @@ Item { } } - ListView { + StatusListView { id: toastArea anchors.top: parent.top anchors.topMargin: 60 diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 1b242d47ad..fc47713a76 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -402,7 +402,8 @@ Rectangle { property int copyTextStart: 0 property string copiedTextPlain: "" property string copiedTextFormatted: "" - ListView { + + StatusListView { id: dummyContactList model: control.usersStore ? control.usersStore.usersModel : [] delegate: Item { @@ -931,6 +932,7 @@ Rectangle { StatusScrollView { id: scrollView + padding: 0 anchors.top: parent.top anchors.bottom: parent.bottom anchors.left: profileImage.visible ? profileImage.right : parent.left diff --git a/ui/imports/shared/status/StatusInputListPopup.qml b/ui/imports/shared/status/StatusInputListPopup.qml index 604f2f4b70..cd5e83ce7d 100644 --- a/ui/imports/shared/status/StatusInputListPopup.qml +++ b/ui/imports/shared/status/StatusInputListPopup.qml @@ -4,6 +4,8 @@ import QtGraphicalEffects 1.12 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.13 +import StatusQ.Core 0.1 + import utils 1.0 import shared 1.0 import shared.panels 1.0 @@ -128,16 +130,14 @@ Popup { } } - ListView { + StatusListView { id: listView model: popup.modelList || [] keyNavigationEnabled: true - Layout.fillHeight: true width: parent.width anchors.top: searchBox.bottom anchors.topMargin: searchBox.visible ? Style.current.smallPadding : 0 anchors.bottom: parent.bottom - clip: true delegate: Rectangle { property variant myData: typeof modelData === "undefined" ? model : modelData diff --git a/ui/imports/shared/status/StatusSearchListPopup.qml b/ui/imports/shared/status/StatusSearchListPopup.qml index 8084bac324..cd7d4ff339 100644 --- a/ui/imports/shared/status/StatusSearchListPopup.qml +++ b/ui/imports/shared/status/StatusSearchListPopup.qml @@ -99,7 +99,7 @@ Popup { onTextChanged: if (text === "") listView.currentIndex = 0 } - ListView { + StatusListView { id: listView Layout.fillWidth: true @@ -107,7 +107,6 @@ Popup { property bool selectByHover: false - clip: true highlightMoveDuration: 200 delegate: Item { diff --git a/ui/imports/shared/status/StatusStickersPopup.qml b/ui/imports/shared/status/StatusStickersPopup.qml index 27e1b0292b..db0494f57a 100644 --- a/ui/imports/shared/status/StatusStickersPopup.qml +++ b/ui/imports/shared/status/StatusStickersPopup.qml @@ -233,7 +233,6 @@ Popup { id: installedStickersSV anchors.bottom: parent.bottom height: 32 - ScrollBar.vertical.policy: ScrollBar.AlwaysOff RowLayout { id: stickersRowLayout diff --git a/ui/imports/shared/views/AssetsView.qml b/ui/imports/shared/views/AssetsView.qml index 1d988e60b7..8fe9e11ace 100644 --- a/ui/imports/shared/views/AssetsView.qml +++ b/ui/imports/shared/views/AssetsView.qml @@ -15,22 +15,17 @@ Item { height: assetListView.height - StatusScrollView { + StatusListView { + id: assetListView anchors.fill: parent + model: account.assets + delegate: AssetDelegate { + locale: RootStore.locale + currency: RootStore.currentCurrency + } Layout.fillWidth: true Layout.fillHeight: true - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: assetListView.contentHeight > assetListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - ListView { - id: assetListView - anchors.fill: parent - model: account.assets - delegate: AssetDelegate { - locale: RootStore.locale - currency: RootStore.currentCurrency - } - boundsBehavior: Flickable.StopAtBounds - } + ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded } } } diff --git a/ui/imports/shared/views/ExistingContacts.qml b/ui/imports/shared/views/ExistingContacts.qml index a68b0d3f1d..3bc2e3a9f9 100644 --- a/ui/imports/shared/views/ExistingContacts.qml +++ b/ui/imports/shared/views/ExistingContacts.qml @@ -31,42 +31,36 @@ Item { return parts.some(p => p.startsWith(filter)) } - - StatusScrollView { + StatusListView { + id: contactListView anchors.fill: parent + spacing: 0 - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: contactListView.contentHeight > contactListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - - ListView { - anchors.fill: parent - spacing: 0 - clip: true - id: contactListView - model: root.contactsStore.myContactsModel - delegate: Contact { - showCheckbox: root.showCheckbox - isChecked: root.pubKeys.indexOf(model.pubKey) > -1 - pubKey: model.pubKey - isContact: model.isContact - isUser: false - name: model.displayName - image: model.icon - isVisible: { - return model.isContact && !model.isBlocked && (root.filterText === "" || - root.matchesAlias(model.alias.toLowerCase(), root.filterText.toLowerCase()) || - model.displayName.toLowerCase().includes(root.filterText.toLowerCase()) || - model.ensName.toLowerCase().includes(root.filterText.toLowerCase()) || - model.localNickname.toLowerCase().includes(root.filterText.toLowerCase()) || - model.pubKey.toLowerCase().includes(root.filterText.toLowerCase())) && - (!root.hideCommunityMembers || - !root.community.hasMember(model.pubKey)) - } - onContactClicked: function () { - root.contactClicked(model) - } + model: root.contactsStore.myContactsModel + delegate: Contact { + showCheckbox: root.showCheckbox + isChecked: root.pubKeys.indexOf(model.pubKey) > -1 + pubKey: model.pubKey + isContact: model.isContact + isUser: false + name: model.displayName + image: model.icon + isVisible: { + return model.isContact && !model.isBlocked && (root.filterText === "" || + root.matchesAlias(model.alias.toLowerCase(), root.filterText.toLowerCase()) || + model.displayName.toLowerCase().includes(root.filterText.toLowerCase()) || + model.ensName.toLowerCase().includes(root.filterText.toLowerCase()) || + model.localNickname.toLowerCase().includes(root.filterText.toLowerCase()) || + model.pubKey.toLowerCase().includes(root.filterText.toLowerCase())) && + (!root.hideCommunityMembers || + !root.community.hasMember(model.pubKey)) + } + onContactClicked: function () { + root.contactClicked(model) } } + + ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded } } } diff --git a/ui/imports/shared/views/HistoryView.qml b/ui/imports/shared/views/HistoryView.qml index 105b1f58aa..736dea9ef0 100644 --- a/ui/imports/shared/views/HistoryView.qml +++ b/ui/imports/shared/views/HistoryView.qml @@ -2,11 +2,12 @@ import QtQuick 2.13 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 -import utils 1.0 - +import StatusQ.Core 0.1 import StatusQ.Components 0.1 import StatusQ.Controls 0.1 +import utils 1.0 + import "../panels" import "../popups" import "../stores" @@ -68,15 +69,13 @@ Item { font.pixelSize: Style.current.primaryTextFontSize } - ListView { + StatusListView { id: transactionListRoot anchors.top: noTxs.bottom anchors.topMargin: Style.current.padding anchors.bottom: loadMoreButton.top anchors.bottomMargin: Style.current.padding width: parent.width - clip: true - boundsBehavior: Flickable.StopAtBounds model: RootStore.historyTransactions delegate: TransactionDelegate { tokens: RootStore.tokens diff --git a/ui/imports/shared/views/TabAddressSelectorView.qml b/ui/imports/shared/views/TabAddressSelectorView.qml index ab3d4759ab..6d9e9f872b 100644 --- a/ui/imports/shared/views/TabAddressSelectorView.qml +++ b/ui/imports/shared/views/TabAddressSelectorView.qml @@ -62,7 +62,7 @@ Item { color: "transparent" radius: 8 - ListView { + StatusListView { id: savedAddresses anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top @@ -70,10 +70,8 @@ Item { height: Math.min(288, savedAddresses.contentHeight) model: root.store.savedAddressesModel - clip: true header: savedAddresses.count > 0 ? search : nothingInList headerPositioning: ListView.OverlayHeader - boundsBehavior: Flickable.StopAtBounds delegate: StatusListItem { width: visible ? parent.width: 0 height: visible ? 64 : 0 @@ -120,16 +118,13 @@ Item { color: "transparent" radius: 8 - ListView { + StatusListView { id: myAccounts anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top width: parent.width height: Math.min(288, myAccounts.contentHeight) - boundsBehavior: Flickable.StopAtBounds - clip: true - delegate: StatusListItem { width: visible ? parent.width: 0 height: visible ? 64 : 0 @@ -155,16 +150,13 @@ Item { color: "transparent" radius: 8 - ListView { + StatusListView { id: recents anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top width: parent.width height: Math.min(288, recents.contentHeight) - boundsBehavior: Flickable.StopAtBounds - clip: true - header: StatusBaseText { font.pixelSize: 15 color: Theme.palette.directColor1