2016-10-22 22:56:38 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Morgan McMillian <gilag@monkeystew.com>
|
|
|
|
*
|
|
|
|
* This file is apart of the Goober application, a client for pnut.io
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-10-22 14:11:28 +00:00
|
|
|
import bb.cascades 1.4
|
|
|
|
|
|
|
|
Page {
|
|
|
|
id: settingsPage
|
|
|
|
|
|
|
|
titleBar: TitleBar {
|
|
|
|
title: qsTr("Settings")
|
|
|
|
}
|
2016-10-22 19:25:59 +00:00
|
|
|
|
|
|
|
signal reload()
|
|
|
|
|
2016-10-22 14:11:28 +00:00
|
|
|
ScrollView {
|
|
|
|
Container {
|
|
|
|
layout: StackLayout {}
|
|
|
|
Container {
|
2016-10-22 19:25:59 +00:00
|
|
|
topPadding: ui.sdu(2)
|
2016-10-22 14:11:28 +00:00
|
|
|
}
|
2018-04-14 20:19:51 +00:00
|
|
|
Container { // Unified home
|
2016-10-22 14:11:28 +00:00
|
|
|
layout: DockLayout {}
|
|
|
|
horizontalAlignment: HorizontalAlignment.Fill
|
|
|
|
verticalAlignment: VerticalAlignment.Fill
|
|
|
|
Container {
|
|
|
|
verticalAlignment: VerticalAlignment.Center
|
|
|
|
leftPadding: ui.sdu(3)
|
|
|
|
Label {
|
2016-10-22 19:25:59 +00:00
|
|
|
text: qsTr("Unified Home")
|
|
|
|
textStyle.fontSize: FontSize.Medium
|
|
|
|
textStyle.fontWeight: FontWeight.Bold
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: qsTr("Include mentions in home stream")
|
|
|
|
textStyle.fontSize: FontSize.Small
|
2016-10-22 14:11:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Container {
|
|
|
|
rightPadding: ui.sdu(3)
|
|
|
|
horizontalAlignment: HorizontalAlignment.Right
|
2016-10-22 19:25:59 +00:00
|
|
|
verticalAlignment: VerticalAlignment.Center
|
2016-10-22 14:11:28 +00:00
|
|
|
ToggleButton {
|
2016-10-22 19:25:59 +00:00
|
|
|
checked: _app.setting("unified")
|
2016-10-22 14:11:28 +00:00
|
|
|
onCheckedChanged: {
|
|
|
|
if (checked) {
|
2016-10-22 19:25:59 +00:00
|
|
|
_app.setSetting("unified", true)
|
|
|
|
reload()
|
2016-10-22 14:11:28 +00:00
|
|
|
} else {
|
2016-10-22 19:25:59 +00:00
|
|
|
_app.setSetting("unified", false)
|
|
|
|
reload()
|
2016-10-22 14:11:28 +00:00
|
|
|
}
|
|
|
|
}
|
2016-10-22 19:25:59 +00:00
|
|
|
accessibility.name: "unified"
|
2016-10-22 14:11:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Divider {}
|
2018-04-14 20:19:51 +00:00
|
|
|
Container { // CC setting
|
2016-11-04 21:16:03 +00:00
|
|
|
layout: DockLayout {}
|
|
|
|
horizontalAlignment: HorizontalAlignment.Fill
|
|
|
|
verticalAlignment: VerticalAlignment.Fill
|
|
|
|
Container {
|
|
|
|
verticalAlignment: VerticalAlignment.Center
|
|
|
|
leftPadding: ui.sdu(3)
|
|
|
|
Label {
|
|
|
|
text: qsTr("Use CC on Reply All")
|
|
|
|
textStyle.fontSize: FontSize.Medium
|
|
|
|
textStyle.fontWeight: FontWeight.Bold
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: qsTr("Additional mentions follow /")
|
|
|
|
textStyle.fontSize: FontSize.Small
|
|
|
|
multiline: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Container {
|
|
|
|
id: cctoggle
|
|
|
|
rightPadding: ui.sdu(3)
|
|
|
|
horizontalAlignment: HorizontalAlignment.Right
|
|
|
|
verticalAlignment: VerticalAlignment.Center
|
|
|
|
ToggleButton {
|
|
|
|
checked: _app.setting("cc")
|
|
|
|
onCheckedChanged: {
|
|
|
|
if (checked) {
|
|
|
|
_app.setSetting("cc", true)
|
|
|
|
reload()
|
|
|
|
} else {
|
|
|
|
_app.setSetting("cc", false)
|
|
|
|
reload()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
accessibility.name: "carboncopy"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Divider {}
|
2018-04-14 20:19:51 +00:00
|
|
|
Container { // Hide photos setting
|
2017-11-16 22:55:45 +00:00
|
|
|
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 {}
|
2018-04-14 20:19:51 +00:00
|
|
|
Container { // Hide avatar setting
|
2017-11-17 17:46:10 +00:00
|
|
|
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 {}
|
2018-04-14 20:19:51 +00:00
|
|
|
Container { // Hide longposts setting
|
|
|
|
layout: DockLayout {}
|
|
|
|
horizontalAlignment: HorizontalAlignment.Fill
|
|
|
|
verticalAlignment: VerticalAlignment.Fill
|
|
|
|
Container {
|
|
|
|
verticalAlignment: VerticalAlignment.Center
|
|
|
|
leftPadding: ui.sdu(3)
|
|
|
|
Label {
|
|
|
|
text: qsTr("Hide long posts")
|
|
|
|
textStyle.fontSize: FontSize.Medium
|
|
|
|
textStyle.fontWeight: FontWeight.Bold
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: qsTr("Hide long posts in timeline")
|
|
|
|
textStyle.fontSize: FontSize.Small
|
|
|
|
multiline: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Container {
|
|
|
|
id: longposttoggle
|
|
|
|
rightPadding: ui.sdu(3)
|
|
|
|
horizontalAlignment: HorizontalAlignment.Right
|
|
|
|
verticalAlignment: VerticalAlignment.Center
|
|
|
|
ToggleButton {
|
|
|
|
checked: _app.setting("hidelongp")
|
|
|
|
onCheckedChanged: {
|
|
|
|
if (checked) {
|
|
|
|
_app.setSetting("hidelongp", true)
|
|
|
|
reload()
|
|
|
|
} else {
|
|
|
|
_app.setSetting("hidelongp", false)
|
|
|
|
reload()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
accessibility.name: "longposts"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Divider {}
|
|
|
|
Container { // Theme Setting
|
2016-11-12 23:49:32 +00:00
|
|
|
leftPadding: ui.sdu(3)
|
|
|
|
rightPadding: ui.sdu(3)
|
|
|
|
DropDown {
|
|
|
|
title: qsTr("Theme")
|
|
|
|
Option {
|
|
|
|
text: qsTr("Bright")
|
|
|
|
value: VisualStyle.Bright
|
|
|
|
selected: Application.themeSupport.theme.colorTheme.style == VisualStyle.Bright
|
|
|
|
}
|
|
|
|
Option {
|
|
|
|
text: qsTr("Dark")
|
|
|
|
value: VisualStyle.Dark
|
|
|
|
selected: Application.themeSupport.theme.colorTheme.style == VisualStyle.Dark
|
|
|
|
}
|
|
|
|
onSelectedOptionChanged: {
|
|
|
|
_app.setSetting("theme", selectedValue)
|
|
|
|
Application.themeSupport.setVisualStyle(selectedValue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
Divider {}
|
2016-10-22 19:25:59 +00:00
|
|
|
// Container {
|
|
|
|
// layout: DockLayout {}
|
|
|
|
// horizontalAlignment: HorizontalAlignment.Fill
|
|
|
|
// Container {
|
|
|
|
// leftPadding: ui.sdu(3)
|
|
|
|
// rightPadding: ui.sdu(3)
|
|
|
|
// DropDown {
|
|
|
|
// title: "Dropdown"
|
|
|
|
// preferredWidth: 1440.0
|
|
|
|
// onSelectedIndexChanged: {
|
|
|
|
// modifySetting("sort", selectedValue)
|
|
|
|
// }
|
|
|
|
// Option {
|
|
|
|
// text: "Option Zero"
|
|
|
|
// value: 0
|
|
|
|
// selected: sort == 0
|
|
|
|
// }
|
|
|
|
// Option {
|
|
|
|
// text: "Option Three"
|
|
|
|
// value: 3
|
|
|
|
// selected: sort == 3
|
|
|
|
// }
|
|
|
|
// Option {
|
|
|
|
// text: "Option One"
|
|
|
|
// value: 1
|
|
|
|
// selected: sort == 1
|
|
|
|
// }
|
|
|
|
// Option {
|
|
|
|
// text: "Option Two"
|
|
|
|
// value: 2
|
|
|
|
// selected: sort == 2
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// Divider {}
|
|
|
|
// Container {
|
|
|
|
// layout: DockLayout {}
|
|
|
|
// horizontalAlignment: HorizontalAlignment.Fill
|
|
|
|
// leftPadding: 30.0
|
|
|
|
// rightPadding: 30.0
|
|
|
|
// Button {
|
|
|
|
// preferredWidth: 1440.0
|
|
|
|
// text: "Button"
|
|
|
|
// onClicked: {
|
|
|
|
// console.log("button")
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// Divider {}
|
2016-10-22 14:11:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|