Added toggle to hide avatar images

This commit is contained in:
Morgan McMillian 2017-11-17 09:46:10 -08:00
parent d5c4d01412
commit ce0a6d8459
5 changed files with 71 additions and 8 deletions

View file

@ -54,7 +54,7 @@ Container {
attachedObjects: [ attachedObjects: [
NetImageTracker { NetImageTracker {
id: tracker id: tracker
source: (postitem.ListItem.view.hidePhoto()) ? "" : ListItemData.user.content.avatar_image.link source: (postitem.ListItem.view.hideAvatar()) ? "" : ListItemData.user.content.avatar_image.link
manager: postitem.ListItem.view.listImageManager manager: postitem.ListItem.view.listImageManager
} }
] ]

View file

@ -149,6 +149,45 @@ Page {
} }
} }
Divider {} Divider {}
Container {
layout: DockLayout {}
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
Container {
verticalAlignment: VerticalAlignment.Center
leftPadding: ui.sdu(3)
Label {
text: qsTr("Hide avatars")
textStyle.fontSize: FontSize.Medium
textStyle.fontWeight: FontWeight.Bold
}
Label {
text: qsTr("Hide avatar images in timeline")
textStyle.fontSize: FontSize.Small
multiline: true
}
}
Container {
id: avatartoggle
rightPadding: ui.sdu(3)
horizontalAlignment: HorizontalAlignment.Right
verticalAlignment: VerticalAlignment.Center
ToggleButton {
checked: _app.setting("hideavatar")
onCheckedChanged: {
if (checked) {
_app.setSetting("hideavatar", true)
reload()
} else {
_app.setSetting("hideavatar", false)
reload()
}
}
accessibility.name: "avatars"
}
}
}
Divider {}
Container { Container {
leftPadding: ui.sdu(3) leftPadding: ui.sdu(3)
rightPadding: ui.sdu(3) rightPadding: ui.sdu(3)

View file

@ -126,6 +126,13 @@ NavigationPane {
return false return false
} }
} }
function hideAvatar() {
if (_app.setting("hideavatar") === "true") {
return true
} else {
return false
}
}
function copyText(text) { function copyText(text) {
_app.copyText(text) _app.copyText(text)
} }

View file

@ -73,6 +73,13 @@ Page {
return false return false
} }
} }
function hideAvatar() {
if (_app.setting("hideavatar") === "true") {
return true
} else {
return false
}
}
function showImage(filename) { function showImage(filename) {
_app.showImage(filename) _app.showImage(filename)
} }

View file

@ -195,17 +195,27 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/SettingsPage.qml" line="156"/> <location filename="../assets/SettingsPage.qml" line="160"/>
<source>Hide avatars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/SettingsPage.qml" line="165"/>
<source>Hide avatar images in timeline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/SettingsPage.qml" line="195"/>
<source>Theme</source> <source>Theme</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/SettingsPage.qml" line="158"/> <location filename="../assets/SettingsPage.qml" line="197"/>
<source>Bright</source> <source>Bright</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/SettingsPage.qml" line="163"/> <location filename="../assets/SettingsPage.qml" line="202"/>
<source>Dark</source> <source>Dark</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -213,22 +223,22 @@
<context> <context>
<name>StreamTab</name> <name>StreamTab</name>
<message> <message>
<location filename="../assets/StreamTab.qml" line="162"/> <location filename="../assets/StreamTab.qml" line="169"/>
<source>New Post</source> <source>New Post</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="176"/> <location filename="../assets/StreamTab.qml" line="183"/>
<source>To Top</source> <source>To Top</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="204"/> <location filename="../assets/StreamTab.qml" line="211"/>
<source>To Bottom</source> <source>To Bottom</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="191"/> <location filename="../assets/StreamTab.qml" line="198"/>
<source>Reload</source> <source>Reload</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>