remove old Settings, rename new
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 18s
Python / test (pull_request) Successful in 46s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m39s
C++ / build (pull_request) Successful in 2m26s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 18s
Python / test (pull_request) Successful in 46s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m39s
C++ / build (pull_request) Successful in 2m26s
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Modules.Settings
|
||||
import qs.Components
|
||||
import qs.Config
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
readonly property int cappedWidth: Math.min(800, width)
|
||||
default property Item contentChild
|
||||
readonly property alias flickable: flickable
|
||||
property bool isSubPage
|
||||
required property SettingsState sState
|
||||
required property string title
|
||||
|
||||
spacing: Appearance.spacing.large
|
||||
|
||||
MouseArea { // Prevent clicks from reaching flickable
|
||||
Layout.bottomMargin: -flickable.topMargin // Extra height to block clicks on flickable top margin
|
||||
|
||||
implicitHeight: header.implicitHeight - Layout.bottomMargin
|
||||
implicitWidth: header.implicitWidth
|
||||
z: 1
|
||||
|
||||
onClicked: focus = true
|
||||
|
||||
RowLayout {
|
||||
id: header
|
||||
|
||||
spacing: Appearance.spacing.large
|
||||
|
||||
Loader {
|
||||
active: root.isSubPage
|
||||
asynchronous: true
|
||||
visible: active
|
||||
|
||||
sourceComponent: IconButton {
|
||||
icon: "arrow_back"
|
||||
inactiveColor: DynamicColors.tPalette.m3surfaceContainerHigh
|
||||
inactiveOnColor: DynamicColors.palette.m3onSurfaceVariant
|
||||
isRound: true
|
||||
type: IconButton.Tonal
|
||||
|
||||
onClicked: root.sState.closeSubPage()
|
||||
}
|
||||
}
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.large
|
||||
text: root.title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VerticalFadeFlickable {
|
||||
id: flickable
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -topMargin
|
||||
bottomMargin: Appearance.padding.extraLarge
|
||||
contentHeight: root.contentChild?.implicitHeight ?? 0
|
||||
contentItem.children: [root.contentChild]
|
||||
fadeAmount: 0.1
|
||||
topMargin: Appearance.padding.large
|
||||
|
||||
TapHandler {
|
||||
onTapped: flickable.focus = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user