Add setting to hide photos in the timeline

This commit is contained in:
Morgan McMillian 2017-11-16 14:55:45 -08:00
parent b5bfd3e09e
commit cf0919d06a
5 changed files with 73 additions and 8 deletions

View file

@ -169,7 +169,7 @@ Container {
} }
return isphoto return isphoto
} }
defaultImage: ptracker.image defaultImage: (postitem.ListItem.view.hidePhoto()) ? "" : ptracker.image
onClicked: { onClicked: {
postitem.ListItem.view.showImage(ptracker.imageSource) postitem.ListItem.view.showImage(ptracker.imageSource)
} }

View file

@ -110,6 +110,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 photos")
textStyle.fontSize: FontSize.Medium
textStyle.fontWeight: FontWeight.Bold
}
Label {
text: qsTr("Hide embeded photos in timeline")
textStyle.fontSize: FontSize.Small
multiline: true
}
}
Container {
id: imgtoggle
rightPadding: ui.sdu(3)
horizontalAlignment: HorizontalAlignment.Right
verticalAlignment: VerticalAlignment.Center
ToggleButton {
checked: _app.setting("hidephoto")
onCheckedChanged: {
if (checked) {
_app.setSetting("hidephoto", true)
reload()
} else {
_app.setSetting("hidephoto", false)
reload()
}
}
accessibility.name: "inlineimages"
}
}
}
Divider {}
Container { Container {
leftPadding: ui.sdu(3) leftPadding: ui.sdu(3)
rightPadding: ui.sdu(3) rightPadding: ui.sdu(3)

View file

@ -119,6 +119,15 @@ NavigationPane {
return false return false
} }
} }
function hidePhoto() {
if (_app.setting("hidephoto") === "true") {
console.log("HIDE IT!")
return true
} else {
console.log("show me da photos")
return false
}
}
function copyText(text) { function copyText(text) {
_app.copyText(text) _app.copyText(text)
} }

View file

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

View file

@ -185,17 +185,27 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/SettingsPage.qml" line="117"/> <location filename="../assets/SettingsPage.qml" line="121"/>
<source>Hide photos</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/SettingsPage.qml" line="126"/>
<source>Hide embeded photos in timeline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/SettingsPage.qml" line="156"/>
<source>Theme</source> <source>Theme</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/SettingsPage.qml" line="119"/> <location filename="../assets/SettingsPage.qml" line="158"/>
<source>Bright</source> <source>Bright</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/SettingsPage.qml" line="124"/> <location filename="../assets/SettingsPage.qml" line="163"/>
<source>Dark</source> <source>Dark</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -203,22 +213,22 @@
<context> <context>
<name>StreamTab</name> <name>StreamTab</name>
<message> <message>
<location filename="../assets/StreamTab.qml" line="155"/> <location filename="../assets/StreamTab.qml" line="164"/>
<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="169"/> <location filename="../assets/StreamTab.qml" line="178"/>
<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="197"/> <location filename="../assets/StreamTab.qml" line="206"/>
<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="184"/> <location filename="../assets/StreamTab.qml" line="193"/>
<source>Reload</source> <source>Reload</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>