From 7230cdf7c7ed4b74e1fb63eb921665b86ececaaa Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 15 Jan 2021 10:37:23 -0500 Subject: [PATCH] feat: only show profile pics for contacts by default But add a profile switch to show them for everyone --- .../Profile/Sections/PrivacyContainer.qml | 22 +++++++++++++++++++ ui/app/AppMain.qml | 7 ++++++ ui/main.qml | 2 ++ 3 files changed, 31 insertions(+) diff --git a/ui/app/AppLayouts/Profile/Sections/PrivacyContainer.qml b/ui/app/AppLayouts/Profile/Sections/PrivacyContainer.qml index 21ce407b07..f1a7eeaa4e 100644 --- a/ui/app/AppLayouts/Profile/Sections/PrivacyContainer.qml +++ b/ui/app/AppLayouts/Profile/Sections/PrivacyContainer.qml @@ -90,6 +90,28 @@ Item { //% "Privacy" text: qsTrId("privacy") } + + RowLayout { + spacing: Style.current.padding + width: parent.width + + StyledText { + text: qsTr("Display all profile pictures (not only contacts)") + font.pixelSize: 15 + font.weight: Font.Medium + Layout.fillWidth: true + } + + StatusSwitch { + id: showOnlyContactsPicsSwitch + Layout.rightMargin: 0 + checked: !appSettings.onlyShowContactsProfilePics + onCheckedChanged: function (value) { + appSettings.onlyShowContactsProfilePics = !this.checked + } + } + } + RowLayout { spacing: Style.current.padding width: parent.width diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 28e74eb8de..365ddfa5e5 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -25,6 +25,13 @@ RowLayout { return } + if (appSettings.onlyShowContactsProfilePics) { + const isContact = profileModel.contacts.list.rowData(index, "isContact") + if (isContact === "false") { + return + } + } + return profileModel.contacts.list.rowData(index, useLargeImage ? "largeImage" : "thumbnailImage") } diff --git a/ui/main.qml b/ui/main.qml index 04bb62c794..4376ebdbe6 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -112,6 +112,7 @@ ApplicationWindow { property bool neverAskAboutUnfurlingAgain: false property bool hideChannelSuggestions: false property bool hideSignPhraseModal: false + property bool onlyShowContactsProfilePics: true property int fontSize: Constants.fontSizeM @@ -160,6 +161,7 @@ ApplicationWindow { property bool hideChannelSuggestions: defaultAppSettings.hideChannelSuggestions property int fontSize: defaultAppSettings.fontSize property bool hideSignPhraseModal: defaultAppSettings.hideSignPhraseModal + property bool onlyShowContactsProfilePics: defaultAppSettings.onlyShowContactsProfilePics // Browser settings property bool showBrowserSelector: defaultAppSettings.showBrowserSelector