fix: fix lists in browser settings

This commit is contained in:
Jonathan Rainville 2021-01-19 15:26:01 -05:00 committed by Iuri Matias
parent 7fef440a97
commit c26e91ab35
1 changed files with 55 additions and 85 deletions

View File

@ -18,52 +18,52 @@ Item {
property Component searchEngineModal: SearchEngineModal {} property Component searchEngineModal: SearchEngineModal {}
property Component ethereumExplorerModal: EthereumExplorerModal {} property Component ethereumExplorerModal: EthereumExplorerModal {}
Column { Item {
id: generalColumn
spacing: Style.current.bigPadding
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 46 anchors.topMargin: 46
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: contentMargin anchors.leftMargin: contentMargin
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: contentMargin anchors.rightMargin: contentMargin
anchors.bottom: parent.bottom
StatusSectionHeadline { Column {
text: qsTr("General") id: generalColumn
} width: parent.width
StatusSettingsLineButton { StatusSectionHeadline {
text: qsTr("Homepage") text: qsTr("General")
currentValue: appSettings.browserHomepage === "" ? qsTr("Default") : appSettings.browserHomepage bottomPadding: Style.current.bigPadding
onClicked: homePagePopup.createObject(root).open()
}
StatusSettingsLineButton {
text: qsTr("Show favorites bar")
isSwitch: true
switchChecked: appSettings.showFavoritesBar
onClicked: function (checked) {
appSettings.showFavoritesBar = checked
} }
}
StatusSettingsLineButton { StatusSettingsLineButton {
text: qsTr("Search engine used in the address bar") text: qsTr("Homepage")
currentValue: { currentValue: appSettings.browserHomepage === "" ? qsTr("Default") : appSettings.browserHomepage
switch (appSettings.browserSearchEngine) { onClicked: homePagePopup.createObject(root).open()
case Constants.browserSearchEngineGoogle: return "Google" }
case Constants.browserSearchEngineYahoo: return "Yahoo!"
case Constants.browserSearchEngineDuckDuckGo: return "DuckDuckGo" StatusSettingsLineButton {
case Constants.browserSearchEngineNone: text: qsTr("Show favorites bar")
default: return qsTr("None") isSwitch: true
switchChecked: appSettings.showFavoritesBar
onClicked: function (checked) {
appSettings.showFavoritesBar = checked
} }
} }
onClicked: searchEngineModal.createObject(root).open()
}
Item { StatusSettingsLineButton {
width: parent.width text: qsTr("Search engine used in the address bar")
height: childrenRect.height currentValue: {
switch (appSettings.browserSearchEngine) {
case Constants.browserSearchEngineGoogle: return "Google"
case Constants.browserSearchEngineYahoo: return "Yahoo!"
case Constants.browserSearchEngineDuckDuckGo: return "DuckDuckGo"
case Constants.browserSearchEngineNone:
default: return qsTr("None")
}
}
onClicked: searchEngineModal.createObject(root).open()
}
StatusSettingsLineButton { StatusSettingsLineButton {
id: ethereumExplorerBtn id: ethereumExplorerBtn
@ -83,63 +83,33 @@ Item {
text: qsTr("Open an ethereum explorer after a transaction hash or an address is entered") text: qsTr("Open an ethereum explorer after a transaction hash or an address is entered")
font.pixelSize: 15 font.pixelSize: 15
color: Style.current.secondaryText color: Style.current.secondaryText
anchors.top: ethereumExplorerBtn.bottom width: parent.width - 150
anchors.topMargin: 2
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 150
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
bottomPadding: Style.current.bigPadding
} }
}
// TODO redd this when we figure out how to set the download path for the browser Separator {
// 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
}
// StatusSectionHeadline { StatusSectionHeadline {
// text: qsTr("Downloads") text: qsTr("Privacy")
// } topPadding: Style.current.bigPadding
bottomPadding: Style.current.padding
}
StatusSettingsLineButton {
// Item { text: qsTr("Set DApp access permissions")
// height: textItem.height isSwitch: false
// width: parent.width onClicked: {
dappListPopup.createObject(root).open()
// 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')
// }
// }
// }
Separator {}
StatusSectionHeadline {
text: qsTr("Privacy")
}
StatusSettingsLineButton {
text: qsTr("Set DApp access permissions")
onClicked: dappListPopup.createObject(root).open()
} }
} }
} }