feat: add browser settings buttons and design (mostly placeholder)

This commit is contained in:
Jonathan Rainville 2021-01-04 15:26:56 -05:00 committed by Iuri Matias
parent 38654fe438
commit f1ea517dd6
2 changed files with 98 additions and 115 deletions

View File

@ -3,28 +3,39 @@ import QtQuick.Layouts 1.13
import "../../../../imports" import "../../../../imports"
import "../../../../shared" import "../../../../shared"
import "../../../../shared/status" import "../../../../shared/status"
import "Privileges/"
Item { Item {
id: root id: root
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
property Component dappListPopup: DappList {
onClosed: destroy()
}
Column { Column {
id: containerColumn id: generalColumn
spacing: Style.current.padding spacing: Style.current.bigPadding
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: Style.current.padding anchors.topMargin: Style.current.bigPadding
anchors.right: parent.right
anchors.rightMargin: contentMargin
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: contentMargin anchors.leftMargin: contentMargin
anchors.bottom: parent.bottom anchors.right: parent.right
anchors.rightMargin: contentMargin
StatusSectionHeadline { StatusSectionHeadline {
id: labelGeneral
text: qsTr("General") text: qsTr("General")
} }
StatusSettingsLineButton {
text: qsTr("Homepage")
currentValue: qsTr("Default")
onClicked: function () {
console.log('Change Homepage')
}
}
StatusSettingsLineButton { StatusSettingsLineButton {
text: qsTr("Show favorites bar") text: qsTr("Show favorites bar")
isSwitch: true isSwitch: true
@ -34,115 +45,98 @@ Item {
} }
} }
RowLayout { StatusSettingsLineButton {
StyledText { text: qsTr("Search engine used in the address bar")
text: qsTr("Autoload images") currentValue: qsTr("None")
onClicked: function () {
console.log('Change search engine')
} }
StatusSwitch { }
checked: appSettings.autoLoadImages
onCheckedChanged: function() { Item {
appSettings.autoLoadImages = this.checked width: parent.width
height: childrenRect.height
StatusSettingsLineButton {
id: ethereumExplorerBtn
text: qsTr("Ethereum explorer used in the address bar")
currentValue: qsTr("None")
onClicked: function () {
console.log('Change ethereum explorer')
}
}
StyledText {
text: qsTr("Open an ethereum explorer after a transaction hash or an address is entered")
font.pixelSize: 15
color: Style.current.secondaryText
anchors.top: ethereumExplorerBtn.bottom
anchors.topMargin: 2
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 150
wrapMode: Text.WordWrap
}
}
Separator {}
StatusSectionHeadline {
text: qsTr("Downloads")
}
Item {
height: textItem.height
width: parent.width
StyledText {
id: textItem
text: qsTr("Location")
font.pixelSize: 15
}
StyledText {
id: valueText
text: "path/to/downloads"
font.pixelSize: 15
color: Style.current.secondaryText
anchors.right: locationBtn.left
anchors.rightMargin: Style.current.halfPadding
anchors.verticalCenter: textItem.verticalCenter
}
StatusButton {
id: locationBtn
text: qsTr("Change")
anchors.right: parent.right
anchors.verticalCenter: textItem.verticalCenter
onClicked: {
console.log('change location')
} }
} }
} }
RowLayout { StatusSettingsLineButton {
StyledText { text: qsTr("Location")
text: qsTr("JavaScript On") currentValue: "path/to/downloads"
} onClicked: function () {
StatusSwitch { console.log('Change download')
checked: appSettings.javaScriptEnabled
onCheckedChanged: function() {
appSettings.javaScriptEnabled = this.checked
}
} }
} }
RowLayout { Separator {}
StyledText {
text: qsTr("Error Page On") StatusSectionHeadline {
} text: qsTr("Privacy")
StatusSwitch {
checked: appSettings.errorPageEnabled
onCheckedChanged: function() {
appSettings.errorPageEnabled = this.checked
}
}
} }
RowLayout { StatusSettingsLineButton {
StyledText { text: qsTr("Set DApp access permissions")
text: qsTr("Plugins On") onClicked: dappListPopup.createObject(root).open()
}
StatusSwitch {
checked: appSettings.pluginsEnabled
onCheckedChanged: function() {
appSettings.pluginsEnabled = this.checked
}
}
}
RowLayout {
StyledText {
text: qsTr("Icons On")
}
StatusSwitch {
checked: appSettings.autoLoadIconsForPage
onCheckedChanged: function() {
appSettings.autoLoadIconsForPage = this.checked
}
}
}
RowLayout {
StyledText {
text: qsTr("Touch Icons On")
}
StatusSwitch {
checked: appSettings.touchIconsEnabled
onCheckedChanged: function() {
appSettings.touchIconsEnabled = this.checked
}
}
}
RowLayout {
StyledText {
text: qsTr("WebRTC Public Interfaces Only")
}
StatusSwitch {
checked: appSettings.webRTCPublicInterfacesOnly
onCheckedChanged: function() {
appSettings.webRTCPublicInterfacesOnly = this.checked
}
}
}
RowLayout {
StyledText {
text: qsTr("PDF viewer enabled")
}
StatusSwitch {
checked: appSettings.pdfViewerEnabled
onCheckedChanged: function() {
appSettings.pdfViewerEnabled = this.checked
}
}
} }
} }
// TODO find what to do with this one
// MenuItem {
// id: httpDiskCacheEnabled
// text: "HTTP Disk Cache"
// checkable: currentWebView && !currentWebView.profile.offTheRecord
// checked: currentWebView && (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache)
// onToggled: function(checked) {
// if (currentWebView) {
// currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache;
// }
// }
// }
} }
/*##^## /*##^##

View File

@ -5,7 +5,6 @@ import QtGraphicalEffects 1.13
import "../../../../imports" import "../../../../imports"
import "../../../../shared" import "../../../../shared"
import "../../../../shared/status" import "../../../../shared/status"
import "Privileges/"
Item { Item {
id: privacyContainer id: privacyContainer
@ -16,11 +15,6 @@ Item {
id: previewableSites id: previewableSites
} }
property Component dappListPopup: DappList {
onClosed: destroy()
}
Column { Column {
id: containerColumn id: containerColumn
spacing: Style.current.padding spacing: Style.current.padding
@ -86,11 +80,6 @@ Item {
Layout.topMargin: Style.current.bigPadding - containerColumn.spacing Layout.topMargin: Style.current.bigPadding - containerColumn.spacing
} }
StatusSettingsLineButton {
text: qsTr("Set DApp access permissions")
onClicked: dappListPopup.createObject(privacyContainer).open()
}
Separator { Separator {
id: separator2 id: separator2
Layout.topMargin: Style.current.bigPadding - containerColumn.spacing Layout.topMargin: Style.current.bigPadding - containerColumn.spacing