config moved to c++ plugin, removed old qml + fileview implementation
This commit is contained in:
@@ -4,8 +4,9 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Components
|
||||
import qs.Config
|
||||
import ZShell.Config
|
||||
import qs.Modules.Settings
|
||||
import qs.Services
|
||||
|
||||
VerticalFadeFlickable {
|
||||
id: root
|
||||
@@ -38,10 +39,10 @@ VerticalFadeFlickable {
|
||||
readonly property string search: sState.searchText
|
||||
readonly property bool searching: search.length > 0
|
||||
|
||||
bottomMargin: Appearance.padding.large
|
||||
bottomMargin: Tokens.padding.large
|
||||
contentHeight: content.implicitHeight
|
||||
fadeAmount: 0.1
|
||||
topMargin: Appearance.padding.large
|
||||
topMargin: Tokens.padding.large
|
||||
|
||||
TapHandler {
|
||||
onTapped: root.focus = true
|
||||
@@ -52,7 +53,7 @@ VerticalFadeFlickable {
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: Appearance.spacing.extraSmall
|
||||
spacing: Tokens.spacing.extraSmall
|
||||
|
||||
Repeater {
|
||||
id: list
|
||||
@@ -69,16 +70,16 @@ VerticalFadeFlickable {
|
||||
required property var modelData
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: index !== 0 && isCategoryStart ? Appearance.spacing.small : 0
|
||||
bottomLeftRadius: stateLayer.pressed ? Appearance.rounding.medium : isCurrentPage ? Appearance.rounding.large : isCategoryEnd ? Appearance.rounding.normal : Appearance.rounding.extraSmall
|
||||
bottomRightRadius: stateLayer.pressed ? Appearance.rounding.medium : isCurrentPage ? Appearance.rounding.large : isCategoryEnd ? Appearance.rounding.normal : Appearance.rounding.extraSmall
|
||||
color: isCurrentPage ? DynamicColors.palette.m3secondaryContainer : DynamicColors.layer(DynamicColors.palette.m3surfaceContainerHigh, 2)
|
||||
Layout.topMargin: index !== 0 && isCategoryStart ? Tokens.spacing.small : 0
|
||||
bottomLeftRadius: stateLayer.pressed ? Tokens.rounding.medium : isCurrentPage ? Tokens.rounding.large : isCategoryEnd ? Tokens.rounding.normal : Tokens.rounding.extraSmall
|
||||
bottomRightRadius: stateLayer.pressed ? Tokens.rounding.medium : isCurrentPage ? Tokens.rounding.large : isCategoryEnd ? Tokens.rounding.normal : Tokens.rounding.extraSmall
|
||||
color: isCurrentPage ? Colors.palette.m3secondaryContainer : Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
||||
implicitHeight: {
|
||||
const h = layout.implicitHeight + layout.anchors.margins * 2;
|
||||
return h % 2 === 0 ? h : h + 1;
|
||||
}
|
||||
topLeftRadius: stateLayer.pressed ? Appearance.rounding.medium : isCurrentPage ? Appearance.rounding.large : isCategoryStart ? Appearance.rounding.normal : Appearance.rounding.extraSmall
|
||||
topRightRadius: stateLayer.pressed ? Appearance.rounding.medium : isCurrentPage ? Appearance.rounding.large : isCategoryStart ? Appearance.rounding.normal : Appearance.rounding.extraSmall
|
||||
topLeftRadius: stateLayer.pressed ? Tokens.rounding.medium : isCurrentPage ? Tokens.rounding.large : isCategoryStart ? Tokens.rounding.normal : Tokens.rounding.extraSmall
|
||||
topRightRadius: stateLayer.pressed ? Tokens.rounding.medium : isCurrentPage ? Tokens.rounding.large : isCategoryStart ? Tokens.rounding.normal : Tokens.rounding.extraSmall
|
||||
|
||||
RadiusBehavior on bottomLeftRadius {
|
||||
}
|
||||
@@ -105,23 +106,23 @@ VerticalFadeFlickable {
|
||||
id: layout
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Appearance.padding.large
|
||||
spacing: Appearance.spacing.small
|
||||
anchors.margins: Tokens.padding.large
|
||||
spacing: Tokens.spacing.small
|
||||
|
||||
CustomRect {
|
||||
Layout.bottomMargin: -1
|
||||
Layout.fillHeight: true
|
||||
Layout.topMargin: -1
|
||||
color: item.isCurrentPage ? DynamicColors.palette.m3primary : DynamicColors.palette.m3secondaryContainer
|
||||
color: item.isCurrentPage ? Colors.palette.m3primary : Colors.palette.m3secondaryContainer
|
||||
implicitWidth: height
|
||||
radius: Appearance.rounding.full
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
MaterialIcon {
|
||||
anchors.centerIn: parent
|
||||
anchors.verticalCenterOffset: 1
|
||||
color: item.isCurrentPage ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSecondaryContainer
|
||||
color: item.isCurrentPage ? Colors.palette.m3onPrimary : Colors.palette.m3onSecondaryContainer
|
||||
fill: item.modelData.noFill ? 0 : 1
|
||||
font.pointSize: Appearance.font.size.large
|
||||
font.pointSize: Tokens.font.size.large
|
||||
grade: 25
|
||||
text: item.modelData.icon
|
||||
}
|
||||
@@ -139,7 +140,7 @@ VerticalFadeFlickable {
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
color: DynamicColors.palette.m3onSurfaceVariant
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
elide: Text.ElideRight
|
||||
text: item.modelData.description
|
||||
}
|
||||
@@ -152,7 +153,7 @@ VerticalFadeFlickable {
|
||||
id: resultList
|
||||
|
||||
Layout.fillWidth: true
|
||||
spacing: Appearance.padding.large
|
||||
spacing: Tokens.padding.large
|
||||
|
||||
add: Transition {
|
||||
Anim {
|
||||
@@ -186,26 +187,26 @@ VerticalFadeFlickable {
|
||||
required property int index
|
||||
required property var modelData
|
||||
|
||||
spacing: Appearance.spacing.small
|
||||
spacing: Tokens.spacing.small
|
||||
width: resultList.width
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Appearance.padding.small
|
||||
spacing: Appearance.spacing.small
|
||||
Layout.leftMargin: Tokens.padding.small
|
||||
spacing: Tokens.spacing.small
|
||||
|
||||
MaterialIcon {
|
||||
color: DynamicColors.palette.m3primary
|
||||
color: Colors.palette.m3primary
|
||||
fill: 1
|
||||
font.pointSize: Appearance.font.size.large
|
||||
font.pointSize: Tokens.font.size.large
|
||||
text: group.modelData.icon
|
||||
}
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
color: DynamicColors.palette.m3secondary
|
||||
color: Colors.palette.m3secondary
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.large
|
||||
font.pointSize: Tokens.font.size.large
|
||||
text: group.modelData.page
|
||||
}
|
||||
}
|
||||
@@ -214,7 +215,7 @@ VerticalFadeFlickable {
|
||||
id: cardList
|
||||
|
||||
Layout.fillWidth: true
|
||||
spacing: Appearance.spacing.extraSmall / 2
|
||||
spacing: Tokens.spacing.extraSmall / 2
|
||||
|
||||
add: Transition {
|
||||
Anim {
|
||||
@@ -250,15 +251,15 @@ VerticalFadeFlickable {
|
||||
readonly property bool isLast: index === group.modelData.entries.length - 1
|
||||
required property var modelData
|
||||
|
||||
bottomLeftRadius: layer.pressed ? Appearance.rounding.medium : isLast ? Appearance.rounding.large : Appearance.rounding.extraSmall
|
||||
bottomRightRadius: layer.pressed ? Appearance.rounding.medium : isLast ? Appearance.rounding.large : Appearance.rounding.extraSmall
|
||||
color: DynamicColors.layer(DynamicColors.palette.m3surfaceContainerHigh, 2)
|
||||
bottomLeftRadius: layer.pressed ? Tokens.rounding.medium : isLast ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
bottomRightRadius: layer.pressed ? Tokens.rounding.medium : isLast ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
||||
implicitHeight: {
|
||||
const h = resultLayout.implicitHeight + resultLayout.anchors.margins * 2;
|
||||
return h % 2 === 0 ? h : h + 1;
|
||||
}
|
||||
topLeftRadius: layer.pressed ? Appearance.rounding.medium : isFirst ? Appearance.rounding.large : Appearance.rounding.extraSmall
|
||||
topRightRadius: layer.pressed ? Appearance.rounding.medium : isFirst ? Appearance.rounding.large : Appearance.rounding.extraSmall
|
||||
topLeftRadius: layer.pressed ? Tokens.rounding.medium : isFirst ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
topRightRadius: layer.pressed ? Tokens.rounding.medium : isFirst ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
width: cardList.width
|
||||
|
||||
RadiusBehavior on bottomLeftRadius {
|
||||
@@ -274,15 +275,15 @@ VerticalFadeFlickable {
|
||||
id: resultLayout
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.rightMargin: result.modelData.togglePath ? toggle.width + Appearance.padding.large * 2 : Appearance.padding.large
|
||||
spacing: Appearance.spacing.small / 2
|
||||
anchors.margins: Tokens.padding.large
|
||||
anchors.rightMargin: result.modelData.togglePath ? toggle.width + Tokens.padding.large * 2 : Tokens.padding.large
|
||||
spacing: Tokens.spacing.small / 2
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
color: DynamicColors.palette.m3onSurfaceVariant
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.small
|
||||
font.pointSize: Tokens.font.size.small
|
||||
text: {
|
||||
const labels = result.modelData.crumbLabels.slice(1);
|
||||
const section = result.modelData.section;
|
||||
@@ -294,19 +295,19 @@ VerticalFadeFlickable {
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
color: Colors.palette.m3onSurface
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.medium
|
||||
text: SettingsSearcher.highlight(result.modelData.title, root.search, DynamicColors.palette.m3primary)
|
||||
font.pointSize: Tokens.font.size.medium
|
||||
text: SettingsSearcher.highlight(result.modelData.title, root.search, Colors.palette.m3primary)
|
||||
textFormat: text.includes("<font") ? Text.StyledText : Text.PlainText
|
||||
}
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
color: DynamicColors.palette.m3outline
|
||||
color: Colors.palette.m3outline
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.small
|
||||
text: SettingsSearcher.highlight(result.modelData.subtext, root.search, DynamicColors.palette.m3primary)
|
||||
font.pointSize: Tokens.font.size.small
|
||||
text: SettingsSearcher.highlight(result.modelData.subtext, root.search, Colors.palette.m3primary)
|
||||
textFormat: text.includes("<font") ? Text.StyledText : Text.PlainText
|
||||
visible: result.modelData.subtext.length > 0
|
||||
}
|
||||
@@ -326,7 +327,7 @@ VerticalFadeFlickable {
|
||||
id: toggle
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Appearance.padding.large
|
||||
anchors.rightMargin: Tokens.padding.large
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
cLayer: 3
|
||||
checked: result.modelData.toggleValue
|
||||
@@ -346,9 +347,9 @@ VerticalFadeFlickable {
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Appearance.padding.large
|
||||
color: DynamicColors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Appearance.font.size.medium
|
||||
Layout.topMargin: Tokens.padding.large
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.medium
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: qsTr("No matching settings")
|
||||
visible: root.searching && root.results.length === 0
|
||||
|
||||
Reference in New Issue
Block a user