Add settings dialog

pull/2/head
reionwong 4 years ago
parent 6b436ed42a
commit 9566bb1e98

@ -26,6 +26,6 @@ Settings {
property int fontPointSize: 10 property int fontPointSize: 10
property bool blinkingCursor: true property bool blinkingCursor: true
property real opacity: 0.8 property real opacity: 1.0
property bool blur: true property bool blur: false
} }

@ -0,0 +1,102 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import FishUI 1.0 as FishUI
FishUI.Window {
id: control
width: 400
height: 400
maximumHeight: 400
maximumWidth: 400
minimumWidth: 400
minimumHeight: 400
visible: false
ColumnLayout {
id: _mainLayout
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing
Item {
Layout.fillWidth: true
Layout.preferredHeight: 45
Rectangle {
anchors.fill: parent
color: FishUI.Theme.secondBackgroundColor
radius: FishUI.Theme.smallRadius
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
Label {
text: qsTr("Transparency")
}
Item {
width: FishUI.Units.largeSpacing
}
Slider {
id: transparencySlider
Layout.fillHeight: true
Layout.fillWidth: true
from: 0.1
to: 1.0
stepSize: 0.05
Component.onCompleted: {
transparencySlider.value = settings.opacity
}
onValueChanged: settings.opacity = transparencySlider.value
}
}
}
Item {
Layout.fillWidth: true
Layout.preferredHeight: 45
Rectangle {
anchors.fill: parent
color: FishUI.Theme.secondBackgroundColor
radius: FishUI.Theme.smallRadius
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.smallSpacing
Label {
text: qsTr("Window Blur")
}
Item {
Layout.fillWidth: true
}
Switch {
Layout.fillHeight: true
checked: settings.blur
onCheckedChanged: settings.blur = checked
}
}
}
Item {
Layout.fillHeight: true
}
}
}

@ -208,6 +208,14 @@ Page {
text: qsTr("Open File Manager") text: qsTr("Open File Manager")
onTriggered: Process.openFileManager(_session.currentDir) onTriggered: Process.openFileManager(_session.currentDir)
} }
MenuItem {
text: qsTr("Open Settings")
onTriggered: {
settingsDialog.show()
settingsDialog.raise()
}
}
} }
ScrollBar { ScrollBar {

@ -50,6 +50,10 @@ FishUI.Window {
onOkBtnClicked: Qt.quit() onOkBtnClicked: Qt.quit()
} }
SettingsDialog {
id: settingsDialog
}
FishUI.WindowBlur { FishUI.WindowBlur {
view: root view: root
geometry: Qt.rect(root.x, root.y, root.width, root.height) geometry: Qt.rect(root.x, root.y, root.width, root.height)

@ -9,5 +9,6 @@
<file>images/dark/close.svg</file> <file>images/dark/close.svg</file>
<file>qml/ImageButton.qml</file> <file>qml/ImageButton.qml</file>
<file>qml/ExitPromptDialog.qml</file> <file>qml/ExitPromptDialog.qml</file>
<file>qml/SettingsDialog.qml</file>
</qresource> </qresource>
</RCC> </RCC>

Loading…
Cancel
Save