Files
asteria-qt/src/qml/pages/SettingsPage.qml
T
2026-03-20 17:49:57 +01:00

179 lines
5.8 KiB
QML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import QtQuick
import QtQuick.Controls
import Asteria
Rectangle {
gradient: Gradient {
GradientStop { position: 0.0; color: Theme.gradientTop }
GradientStop { position: 1.0; color: Theme.gradientBottom }
}
ScrollView {
anchors.fill: parent
anchors.margins: 32
contentWidth: availableWidth
Column {
width: parent.width
spacing: 24
// Section header
Text {
text: "Reading"
font.pixelSize: 13
font.weight: Font.Medium
color: Theme.dimText
leftPadding: 4
}
// Horizontal margin slider
Column {
width: parent.width
spacing: 8
Item {
width: parent.width
height: Math.max(labelH.implicitHeight, valueH.implicitHeight)
Text {
id: labelH
text: "Horizontal margin"
font.pixelSize: 15
color: Theme.uiText
leftPadding: 4
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: valueH
text: appState.horizontalMargin + " px"
font.pixelSize: 13
color: Theme.dimText
anchors.right: parent.right
anchors.rightMargin: 4
anchors.verticalCenter: parent.verticalCenter
}
}
Slider {
width: parent.width
from: 0
to: 120
stepSize: 1
value: appState.horizontalMargin
onValueChanged: appState.horizontalMargin = value
}
}
// Vertical margin slider
Column {
width: parent.width
spacing: 8
Item {
width: parent.width
height: Math.max(labelV.implicitHeight, valueV.implicitHeight)
Text {
id: labelV
text: "Vertical margin"
font.pixelSize: 15
color: Theme.uiText
leftPadding: 4
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: valueV
text: appState.verticalMargin + " px"
font.pixelSize: 13
color: Theme.dimText
anchors.right: parent.right
anchors.rightMargin: 4
anchors.verticalCenter: parent.verticalCenter
}
}
Slider {
width: parent.width
from: 0
to: 80
stepSize: 1
value: appState.verticalMargin
onValueChanged: appState.verticalMargin = value
}
}
// Font size slider
Column {
width: parent.width
spacing: 8
Item {
width: parent.width
height: Math.max(labelF.implicitHeight, valueF.implicitHeight)
Text {
id: labelF
text: "Font size"
font.pixelSize: 15
color: Theme.uiText
leftPadding: 4
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: valueF
text: appState.fontSize + " px"
font.pixelSize: 13
color: Theme.dimText
anchors.right: parent.right
anchors.rightMargin: 4
anchors.verticalCenter: parent.verticalCenter
}
}
Slider {
width: parent.width
from: 10
to: 32
stepSize: 1
value: appState.fontSize
onValueChanged: appState.fontSize = value
}
}
// Line spacing slider
Column {
width: parent.width
spacing: 8
Item {
width: parent.width
height: Math.max(labelL.implicitHeight, valueL.implicitHeight)
Text {
id: labelL
text: "Line spacing"
font.pixelSize: 15
color: Theme.uiText
leftPadding: 4
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: valueL
text: appState.lineSpacing.toFixed(1) + "×"
font.pixelSize: 13
color: Theme.dimText
anchors.right: parent.right
anchors.rightMargin: 4
anchors.verticalCenter: parent.verticalCenter
}
}
Slider {
width: parent.width
from: 0.5
to: 3.0
stepSize: 0.1
value: appState.lineSpacing
onValueChanged: appState.lineSpacing = value
}
}
}
}
}