formatter
This commit is contained in:
@@ -2,24 +2,28 @@ import QtQuick
|
||||
import QtQuick.Shapes
|
||||
import qs.Components
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
ShapePath {
|
||||
id: root
|
||||
|
||||
required property Wrapper wrapper
|
||||
readonly property real rounding: 8
|
||||
readonly property bool flatten: wrapper.height < rounding * 2
|
||||
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
|
||||
|
||||
strokeWidth: -1
|
||||
readonly property bool flatten: wrapper.height < rounding * 2
|
||||
readonly property real rounding: 8
|
||||
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
|
||||
required property Wrapper wrapper
|
||||
|
||||
fillColor: DynamicColors.palette.m3surface
|
||||
strokeWidth: -1
|
||||
|
||||
Behavior on fillColor {
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
|
||||
PathArc {
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min(root.roundingY, root.wrapper.height)
|
||||
relativeX: root.rounding
|
||||
relativeY: root.roundingY
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min( root.roundingY, root.wrapper.height )
|
||||
}
|
||||
|
||||
PathLine {
|
||||
@@ -28,11 +32,11 @@ ShapePath {
|
||||
}
|
||||
|
||||
PathArc {
|
||||
relativeX: root.rounding
|
||||
relativeY: root.roundingY
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min( root.rounding, root.wrapper.height )
|
||||
direction: PathArc.Counterclockwise
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min(root.rounding, root.wrapper.height)
|
||||
relativeX: root.rounding
|
||||
relativeY: root.roundingY
|
||||
}
|
||||
|
||||
PathLine {
|
||||
@@ -41,26 +45,22 @@ ShapePath {
|
||||
}
|
||||
|
||||
PathArc {
|
||||
relativeX: root.rounding
|
||||
relativeY: - root.roundingY
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min( root.rounding, root.wrapper.height )
|
||||
direction: PathArc.Counterclockwise
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min(root.rounding, root.wrapper.height)
|
||||
relativeX: root.rounding
|
||||
relativeY: -root.roundingY
|
||||
}
|
||||
|
||||
PathLine {
|
||||
relativeX: 0
|
||||
relativeY: - ( root.wrapper.height - root.roundingY * 2 )
|
||||
relativeY: -(root.wrapper.height - root.roundingY * 2)
|
||||
}
|
||||
|
||||
PathArc {
|
||||
relativeX: root.rounding
|
||||
relativeY: - root.roundingY
|
||||
radiusX: root.rounding
|
||||
radiusY: Math.min( root.rounding, root.wrapper.height )
|
||||
}
|
||||
|
||||
Behavior on fillColor {
|
||||
CAnim {}
|
||||
radiusY: Math.min(root.rounding, root.wrapper.height)
|
||||
relativeX: root.rounding
|
||||
relativeY: -root.roundingY
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,105 +12,105 @@ import qs.Helpers
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property Item content
|
||||
|
||||
implicitHeight: clayout.contentHeight + Appearance.padding.smaller * 2
|
||||
implicitWidth: clayout.contentWidth + Appearance.padding.smaller * 2
|
||||
|
||||
ListModel {
|
||||
id: listModel
|
||||
|
||||
ListElement {
|
||||
name: "General"
|
||||
icon: "settings"
|
||||
name: "General"
|
||||
}
|
||||
|
||||
|
||||
ListElement {
|
||||
name: "Wallpaper"
|
||||
icon: "wallpaper"
|
||||
name: "Wallpaper"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Bar"
|
||||
icon: "settop_component"
|
||||
name: "Bar"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Lockscreen"
|
||||
icon: "lock"
|
||||
name: "Lockscreen"
|
||||
}
|
||||
|
||||
|
||||
ListElement {
|
||||
name: "Services"
|
||||
icon: "build_circle"
|
||||
name: "Services"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Notifications"
|
||||
icon: "notifications"
|
||||
name: "Notifications"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Sidebar"
|
||||
icon: "view_sidebar"
|
||||
name: "Sidebar"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Utilities"
|
||||
icon: "handyman"
|
||||
name: "Utilities"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Dashboard"
|
||||
icon: "dashboard"
|
||||
name: "Dashboard"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
icon: "colors"
|
||||
name: "Appearance"
|
||||
icon: "colors"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "On screen display"
|
||||
icon: "display_settings"
|
||||
name: "On screen display"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Launcher"
|
||||
icon: "rocket_launch"
|
||||
name: "Launcher"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Colors"
|
||||
icon: "colors"
|
||||
name: "Colors"
|
||||
}
|
||||
}
|
||||
|
||||
required property Item content
|
||||
|
||||
implicitWidth: clayout.contentWidth + Appearance.padding.smaller * 2
|
||||
implicitHeight: clayout.contentHeight + Appearance.padding.smaller * 2
|
||||
|
||||
CustomRect {
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
radius: 4
|
||||
|
||||
CustomListView {
|
||||
id: clayout
|
||||
|
||||
anchors.centerIn: parent
|
||||
model: listModel
|
||||
|
||||
contentWidth: contentItem.childrenRect.width
|
||||
contentHeight: contentItem.childrenRect.height
|
||||
implicitWidth: contentItem.childrenRect.width
|
||||
contentWidth: contentItem.childrenRect.width
|
||||
highlightFollowsCurrentItem: false
|
||||
implicitHeight: contentItem.childrenRect.height
|
||||
|
||||
implicitWidth: contentItem.childrenRect.width
|
||||
model: listModel
|
||||
spacing: 5
|
||||
|
||||
delegate: Category {
|
||||
}
|
||||
highlight: CustomRect {
|
||||
color: DynamicColors.palette.m3primary
|
||||
radius: 4
|
||||
|
||||
y: clayout.currentItem?.y ?? 0
|
||||
implicitWidth: clayout.width
|
||||
implicitHeight: clayout.currentItem?.implicitHeight ?? 0
|
||||
implicitWidth: clayout.width
|
||||
radius: 4
|
||||
y: clayout.currentItem?.y ?? 0
|
||||
|
||||
Behavior on y {
|
||||
Anim {
|
||||
@@ -119,53 +119,49 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
highlightFollowsCurrentItem: false
|
||||
|
||||
delegate: Category {}
|
||||
}
|
||||
}
|
||||
|
||||
component Category: CustomRect {
|
||||
id: categoryItem
|
||||
|
||||
required property string name
|
||||
required property string icon
|
||||
required property int index
|
||||
required property string name
|
||||
|
||||
implicitWidth: 200
|
||||
implicitHeight: 42
|
||||
implicitWidth: 200
|
||||
radius: 4
|
||||
|
||||
RowLayout {
|
||||
id: layout
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
|
||||
|
||||
MaterialIcon {
|
||||
id: icon
|
||||
|
||||
text: categoryItem.icon
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: icon.contentWidth
|
||||
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
|
||||
font.pointSize: 22
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
||||
Layout.preferredWidth: icon.contentWidth
|
||||
Layout.fillHeight: true
|
||||
text: categoryItem.icon
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
text: categoryItem.name
|
||||
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Appearance.spacing.normal
|
||||
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
|
||||
text: categoryItem.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,23 +13,21 @@ CustomRect {
|
||||
|
||||
ColumnLayout {
|
||||
id: clayout
|
||||
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
CustomRect {
|
||||
|
||||
Layout.preferredHeight: colorLayout.implicitHeight
|
||||
Layout.fillWidth: true
|
||||
|
||||
Layout.preferredHeight: colorLayout.implicitHeight
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
id: colorLayout
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.right: parent.right
|
||||
|
||||
Settings {
|
||||
name: "smth"
|
||||
@@ -49,20 +47,19 @@ CustomRect {
|
||||
|
||||
required property string name
|
||||
|
||||
Layout.preferredWidth: 200
|
||||
Layout.preferredHeight: 42
|
||||
Layout.preferredWidth: 200
|
||||
radius: 4
|
||||
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
|
||||
text: settingsItem.name
|
||||
font.pointSize: 32
|
||||
anchors.right: parent.right
|
||||
font.bold: true
|
||||
font.pointSize: 32
|
||||
text: settingsItem.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ import qs.Helpers
|
||||
|
||||
CustomRect {
|
||||
id: root
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ CustomRect {
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,26 +28,26 @@ CustomRect {
|
||||
|
||||
required property string name
|
||||
|
||||
implicitWidth: 200
|
||||
implicitHeight: 42
|
||||
implicitWidth: 200
|
||||
radius: 4
|
||||
|
||||
RowLayout {
|
||||
id: layout
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
text: settingsItem.name
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Appearance.spacing.normal
|
||||
text: settingsItem.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,71 +11,69 @@ import qs.Helpers
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property PersistentProperties visibilities
|
||||
readonly property real nonAnimWidth: view.implicitWidth + 500 + viewWrapper.anchors.margins * 2
|
||||
readonly property real nonAnimHeight: view.implicitHeight + viewWrapper.anchors.margins * 2
|
||||
property string currentCategory: "general"
|
||||
readonly property real nonAnimHeight: view.implicitHeight + viewWrapper.anchors.margins * 2
|
||||
readonly property real nonAnimWidth: view.implicitWidth + 500 + viewWrapper.anchors.margins * 2
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
implicitWidth: nonAnimWidth
|
||||
implicitHeight: nonAnimHeight
|
||||
implicitWidth: nonAnimWidth
|
||||
|
||||
Connections {
|
||||
target: root
|
||||
|
||||
function onCurrentCategoryChanged() {
|
||||
stack.pop();
|
||||
if ( currentCategory === "general" ) {
|
||||
if (currentCategory === "general") {
|
||||
stack.push(general);
|
||||
} else if ( currentCategory === "wallpaper" ) {
|
||||
} else if (currentCategory === "wallpaper") {
|
||||
stack.push(background);
|
||||
} else if ( currentCategory === "appearance" ) {
|
||||
} else if (currentCategory === "appearance") {
|
||||
stack.push(appearance);
|
||||
}
|
||||
}
|
||||
|
||||
target: root
|
||||
}
|
||||
|
||||
ClippingRectangle {
|
||||
id: viewWrapper
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
color: "transparent"
|
||||
|
||||
Item {
|
||||
id: view
|
||||
anchors.top: parent.top
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
implicitWidth: layout.implicitWidth
|
||||
anchors.top: parent.top
|
||||
implicitHeight: layout.implicitHeight
|
||||
|
||||
implicitWidth: layout.implicitWidth
|
||||
|
||||
Categories {
|
||||
id: layout
|
||||
|
||||
content: root
|
||||
|
||||
anchors.fill: parent
|
||||
content: root
|
||||
}
|
||||
}
|
||||
|
||||
CustomClippingRect {
|
||||
id: categoryContent
|
||||
|
||||
anchors.top: parent.top
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.left: view.right
|
||||
anchors.leftMargin: Appearance.spacing.smaller
|
||||
|
||||
radius: 4
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
radius: 4
|
||||
|
||||
StackView {
|
||||
id: stack
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
|
||||
initialItem: general
|
||||
}
|
||||
}
|
||||
@@ -84,18 +82,21 @@ Item {
|
||||
Component {
|
||||
id: general
|
||||
|
||||
Cat.General {}
|
||||
Cat.General {
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: background
|
||||
|
||||
Cat.Background {}
|
||||
Cat.Background {
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: appearance
|
||||
|
||||
Cat.Appearance {}
|
||||
Cat.Appearance {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,33 @@
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Modules as Modules
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
required property string name
|
||||
required property var object
|
||||
required property string setting
|
||||
required property string name
|
||||
|
||||
Layout.preferredHeight: 42
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
Layout.preferredHeight: 42
|
||||
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
text: root.name
|
||||
font.pointSize: 16
|
||||
Layout.fillWidth: true
|
||||
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
Layout.fillWidth: true
|
||||
font.pointSize: 16
|
||||
text: root.name
|
||||
}
|
||||
|
||||
CustomSwitch {
|
||||
id: cswitch
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
checked: root.object[root.setting]
|
||||
|
||||
onToggled: {
|
||||
root.object[root.setting] = checked;
|
||||
Config.save();
|
||||
|
||||
@@ -8,5 +8,4 @@ import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
Item {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,56 +7,52 @@ import qs.Helpers
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property PersistentProperties visibilities
|
||||
required property var panels
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
implicitWidth: content.implicitWidth
|
||||
implicitHeight: 0
|
||||
|
||||
implicitWidth: content.implicitWidth
|
||||
visible: height > 0
|
||||
|
||||
states: State {
|
||||
name: "visible"
|
||||
|
||||
when: root.visibilities.settings
|
||||
|
||||
PropertyChanges {
|
||||
root.implicitHeight: content.implicitHeight
|
||||
}
|
||||
}
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: ""
|
||||
to: "visible"
|
||||
|
||||
Anim {
|
||||
target: root
|
||||
property: "implicitHeight"
|
||||
duration: MaterialEasing.expressiveEffectsTime
|
||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||
property: "implicitHeight"
|
||||
target: root
|
||||
}
|
||||
},
|
||||
|
||||
Transition {
|
||||
from: "visible"
|
||||
to: ""
|
||||
|
||||
Anim {
|
||||
target: root
|
||||
property: "implicitHeight"
|
||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||
property: "implicitHeight"
|
||||
target: root
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Loader {
|
||||
id: content
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
visible: true
|
||||
active: true
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: true
|
||||
|
||||
sourceComponent: Content {
|
||||
visibilities: root.visibilities
|
||||
|
||||
Reference in New Issue
Block a user