feat: add showFavoritesBar setting (placeholder for now)

This commit is contained in:
Jonathan Rainville 2020-12-29 10:31:26 -05:00 committed by Iuri Matias
parent 825097f007
commit 16f5c2fb1a
6 changed files with 93 additions and 48 deletions

View File

@ -1,5 +1,4 @@
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13 import QtQuick.Layouts 1.13
import "../../../../imports" import "../../../../imports"
import "../../../../shared" import "../../../../shared"
@ -10,23 +9,30 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
StyledText {
id: title
text: qsTr("Browser Settings")
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: parent.top
anchors.topMargin: 24
font.weight: Font.Bold
font.pixelSize: 20
}
Column { Column {
id: containerColumn
spacing: Style.current.padding spacing: Style.current.padding
anchors.top: title.bottom anchors.top: parent.top
anchors.topMargin: Style.current.padding anchors.topMargin: Style.current.padding
anchors.right: parent.right
anchors.rightMargin: contentMargin
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 24 anchors.leftMargin: contentMargin
anchors.bottom: parent.bottom
StatusSectionHeadline {
id: labelGeneral
text: qsTr("General")
}
StatusSettingsLineButton {
text: qsTr("Show favorites bar")
isSwitch: true
switchChecked: appSettings.showFavoritesBar
onClicked: function (checked) {
appSettings.showFavoritesBar = checked
}
}
RowLayout { RowLayout {
StyledText { StyledText {

View File

@ -86,40 +86,9 @@ Item {
Layout.topMargin: Style.current.bigPadding - containerColumn.spacing Layout.topMargin: Style.current.bigPadding - containerColumn.spacing
} }
Item { StatusSettingsLineButton {
id: dappPermissions text: qsTr("Set DApp access permissions")
height: dappPermissionsText.height onClicked: dappListPopup.createObject(privacyContainer).open()
width: parent.width
StyledText {
id: dappPermissionsText
text: qsTr("Set DApp access permissions")
font.pixelSize: 15
}
SVGImage {
id: caret2
anchors.right: parent.right
anchors.rightMargin: 0
anchors.verticalCenter: dappPermissionsText.verticalCenter
source: "../../../img/caret.svg"
width: 13
height: 7
rotation: -90
}
ColorOverlay {
anchors.fill: caret2
source: caret2
color: Style.current.darkGrey
rotation: -90
}
MouseArea {
anchors.fill: parent
onClicked: dappListPopup.createObject(privacyContainer).open()
cursorShape: Qt.PointingHandCursor
}
} }
Separator { Separator {

View File

@ -32,6 +32,7 @@ QtObject {
property color background property color background
property color border property color border
property color textColor property color textColor
property color secondaryText
property color currentUserTextColor property color currentUserTextColor
property color secondaryBackground property color secondaryBackground
property color modalBackground property color modalBackground

View File

@ -113,6 +113,7 @@ ApplicationWindow {
property int fontSize: Constants.fontSizeM property int fontSize: Constants.fontSizeM
// Browser settings // Browser settings
property bool showFavoritesBar: false
property bool autoLoadImages: true property bool autoLoadImages: true
property bool javaScriptEnabled: true property bool javaScriptEnabled: true
property bool errorPageEnabled: true property bool errorPageEnabled: true
@ -150,6 +151,7 @@ ApplicationWindow {
property bool hideSignPhraseModal: defaultAppSettings.hideSignPhraseModal property bool hideSignPhraseModal: defaultAppSettings.hideSignPhraseModal
// Browser settings // Browser settings
property bool showFavoritesBar: defaultAppSettings.showFavoritesBar
property bool autoLoadImages: defaultAppSettings.autoLoadImages property bool autoLoadImages: defaultAppSettings.autoLoadImages
property bool javaScriptEnabled: defaultAppSettings.javaScriptEnabled property bool javaScriptEnabled: defaultAppSettings.javaScriptEnabled
property bool errorPageEnabled: defaultAppSettings.errorPageEnabled property bool errorPageEnabled: defaultAppSettings.errorPageEnabled

View File

@ -406,4 +406,5 @@ DISTFILES += \
shared/qmldir \ shared/qmldir \
shared/status/StatusEmojiSuggestionPopup.qml \ shared/status/StatusEmojiSuggestionPopup.qml \
shared/status/StatusInputListPopup.qml \ shared/status/StatusInputListPopup.qml \
shared/status/StatusSettingsLineButton.qml \
sounds/ErrorSound.qml sounds/ErrorSound.qml

View File

@ -0,0 +1,66 @@
import QtQuick 2.13
import QtGraphicalEffects 1.12
import "../../imports"
import ".."
Item {
property string text
property bool isSwitch: false
property bool switchChecked: false
property string currentValue
signal clicked(bool checked)
id: root
height: textItem.height
width: parent.width
StyledText {
id: textItem
text: root.text
font.pixelSize: 15
}
StyledText {
id: valueText
visible: !!root.currentValue
text: root.currentValue
font.pixelSize: 15
color: Style.current.secondaryText
anchors.right: root.isSwitch ? switchItem.left : caret.left
anchors.rightMargin: Style.current.padding
anchors.verticalCenter: textItem.verticalCenter
}
StatusSwitch {
id: switchItem
visible: root.isSwitch
checked: root.switchChecked
anchors.right: parent.right
anchors.verticalCenter: textItem.verticalCenter
}
SVGImage {
id: caret
visible: !root.isSwitch
anchors.right: parent.right
anchors.verticalCenter: textItem.verticalCenter
source: "../../app/img/caret.svg"
width: 13
height: 7
rotation: -90
ColorOverlay {
anchors.fill: caret
source: caret
color: Style.current.darkGrey
}
}
MouseArea {
anchors.fill: parent
onClicked: {
root.clicked(!root.switchChecked)
}
cursorShape: Qt.PointingHandCursor
}
}