status-desktop/ui/app/AppLayouts/Profile/views/BrowserView.qml

143 lines
5.2 KiB
QML
Raw Normal View History

import QtQuick 2.13
import QtQuick.Layouts 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import utils 1.0
import shared 1.0
import shared.panels 1.0
import shared.status 1.0
import "../popups"
Item {
id: root
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property var store
property int profileContentWidth
property Component dappListPopup: DappList {
store: root.store
onClosed: destroy()
}
property Component homePagePopup: HomepageModal {}
property Component searchEngineModal: SearchEngineModal {}
property Component ethereumExplorerModal: EthereumExplorerModal {}
2021-01-19 20:26:01 +00:00
Item {
anchors.top: parent.top
anchors.topMargin: 64
2021-01-19 20:26:01 +00:00
anchors.bottom: parent.bottom
width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter
2021-01-19 20:26:01 +00:00
Column {
id: generalColumn
width: parent.width
2021-01-19 20:26:01 +00:00
StatusSectionHeadline {
2021-02-18 16:36:05 +00:00
//% "General"
text: qsTrId("general")
2021-01-19 20:26:01 +00:00
bottomPadding: Style.current.bigPadding
}
// TODO: Replace with StatusQ StatusListItem component
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Homepage"
text: qsTrId("homepage")
//% "Default"
currentValue: localAccountSensitiveSettings.browserHomepage === "" ? qsTrId("default") : localAccountSensitiveSettings.browserHomepage
2021-01-19 20:26:01 +00:00
onClicked: homePagePopup.createObject(root).open()
}
// TODO: Replace with StatusQ StatusListItem component
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Show favorites bar"
text: qsTrId("show-favorites-bar")
2021-01-19 20:26:01 +00:00
isSwitch: true
switchChecked: localAccountSensitiveSettings.shouldShowFavoritesBar
2021-01-19 20:26:01 +00:00
onClicked: function (checked) {
localAccountSensitiveSettings.shouldShowFavoritesBar = checked
}
}
// TODO: Replace with StatusQ StatusListItem component
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Search engine used in the address bar"
text: qsTrId("search-engine-used-in-the-address-bar")
2021-01-19 20:26:01 +00:00
currentValue: {
switch (localAccountSensitiveSettings.shouldShowBrowserSearchEngine) {
2021-01-19 20:26:01 +00:00
case Constants.browserSearchEngineGoogle: return "Google"
case Constants.browserSearchEngineYahoo: return "Yahoo!"
case Constants.browserSearchEngineDuckDuckGo: return "DuckDuckGo"
case Constants.browserSearchEngineNone:
2021-02-18 16:36:05 +00:00
//% "None"
default: return qsTrId("none")
2021-01-19 20:26:01 +00:00
}
}
onClicked: searchEngineModal.createObject(root).open()
}
// TODO: Replace with StatusQ StatusListItem component
StatusSettingsLineButton {
id: ethereumExplorerBtn
2021-02-18 16:36:05 +00:00
//% "Ethereum explorer used in the address bar"
text: qsTrId("ethereum-explorer-used-in-the-address-bar")
currentValue: {
switch (localAccountSensitiveSettings.useBrowserEthereumExplorer) {
case Constants.browserEthereumExplorerEtherscan: return "etherscan.io"
case Constants.browserEthereumExplorerEthplorer: return "ethplorer.io"
case Constants.browserEthereumExplorerBlockchair: return "blockchair.com"
case Constants.browserSearchEngineNone:
2021-02-18 16:36:05 +00:00
//% "None"
default: return qsTrId("none")
}
}
onClicked: ethereumExplorerModal.createObject(root).open()
}
StatusBaseText {
2021-02-18 16:36:05 +00:00
//% "Open an ethereum explorer after a transaction hash or an address is entered"
text: qsTrId("open-an-ethereum-explorer-after-a-transaction-hash-or-an-address-is-entered")
font.pixelSize: 15
color: Theme.palette.baseColor1
2021-01-19 20:26:01 +00:00
width: parent.width - 150
wrapMode: Text.WordWrap
2021-01-19 20:26:01 +00:00
bottomPadding: Style.current.bigPadding
}
2021-01-19 20:26:01 +00:00
Separator {
id: separator1
anchors.topMargin: Style.current.bigPadding
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
}
2021-01-19 20:26:01 +00:00
StatusSectionHeadline {
2021-02-18 16:36:05 +00:00
//% "Privacy"
text: qsTrId("privacy")
2021-01-19 20:26:01 +00:00
topPadding: Style.current.bigPadding
bottomPadding: Style.current.padding
}
// TODO: Replace with StatusQ StatusListItem component
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Set DApp access permissions"
text: qsTrId("set-dapp-access-permissions")
2021-01-19 20:26:01 +00:00
isSwitch: false
onClicked: {
dappListPopup.createObject(root).open()
}
}
}
}
}