Compare commits
90
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c02ef0a934 | ||
|
|
5401cfbc0a | ||
|
|
e35c87b3f2 | ||
|
|
cbd4e6caa7 | ||
|
|
36cddc96c3 | ||
|
|
58c187dadf | ||
|
|
6781078467 | ||
|
|
d3345906b9 | ||
|
|
6391bc85c4 | ||
|
|
08d42e1f8a | ||
|
|
45aa6c9005 | ||
|
|
1763b03287 | ||
|
|
72ff6ad42a | ||
|
|
2a45740020 | ||
|
|
0a503bc27c | ||
|
|
1fe8a3a959 | ||
|
|
ae25f33fc8
|
||
|
|
02267ec9a6
|
||
|
|
4b8d74a7e5
|
||
|
|
1fa3c84a56
|
||
|
|
fc81be922f | ||
|
|
8d54e1ce6f | ||
|
|
bee8cd061b | ||
|
|
b9e818faa9 | ||
|
|
2cabd72fc0 | ||
|
|
255db9e533 | ||
|
|
a4f6aa1d4a | ||
|
|
3883917228 | ||
|
|
bf6a7027e4 | ||
|
|
873b2eb01b | ||
|
|
d70fb61e4a | ||
|
|
4c410d638c | ||
|
|
aef7cd5918 | ||
|
|
a13fa8442b | ||
|
|
4d75b317cd | ||
|
|
76823eff79 | ||
|
|
909b5113fb | ||
|
|
c06cbea854 | ||
|
|
376595cd0b | ||
|
|
a00bbe50f2 | ||
|
|
11e94fbb4b | ||
|
|
9f5e62f9c7 | ||
|
|
b91befa9f7 | ||
|
|
f90e9bb1a0 | ||
|
|
99fdfbc465 | ||
|
|
2c88b7abcb | ||
|
|
e148a0f843 | ||
|
|
f1918172c3 | ||
|
|
5507b99fdc | ||
|
|
506b69165d | ||
|
|
dc99d6677c | ||
|
|
add3beed59 | ||
|
|
fc672924d1 | ||
|
|
4b67cc1d88 | ||
|
|
765b84a19c | ||
|
|
d1a045787e | ||
|
|
7c55d9627a | ||
|
|
5fd2720f00 | ||
|
|
74261f0a49 | ||
|
|
e76350fa7f | ||
|
|
015c1fb27d | ||
|
|
f6cb7e44c2 | ||
|
|
5a8939bc1e | ||
|
|
6071223009 | ||
|
|
2d40ce33d1 | ||
|
|
954dc10fbb | ||
|
|
15ccfd24c6 | ||
|
|
33b08523e9 | ||
|
|
742bece30b | ||
|
|
a64eadd14a | ||
|
|
f9eeb793db | ||
|
|
6bb193c78c | ||
|
|
aadecbfe44 | ||
|
|
53f0aa80ae | ||
|
|
d9856c9409 | ||
|
|
8dc9753e2b | ||
|
|
2a4bd3dfdd | ||
|
|
f75f51ef50 | ||
|
|
e0873304d1 | ||
|
|
99a0155c17 | ||
|
|
f309debea5 | ||
|
|
0979fd014d | ||
|
|
656bd0a54d | ||
|
|
f01001dcfa | ||
|
|
bc6b0d50ab | ||
|
|
f27c9afc25 | ||
|
|
5962fc8354 | ||
|
|
1adcb9841c | ||
|
|
0e0f8555ed | ||
|
|
1d63e67554 |
@@ -0,0 +1,5 @@
|
|||||||
|
CompileFlags:
|
||||||
|
Remove:
|
||||||
|
# GCC-only flags from the system's default spec that clang/clangd cannot
|
||||||
|
# parse. They appear in compile_commands.json but are not set by the project.
|
||||||
|
- -mno-direct-extern-access
|
||||||
@@ -38,7 +38,6 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: OS
|
label: OS
|
||||||
options:
|
options:
|
||||||
- NixOS
|
|
||||||
- Arch
|
- Arch
|
||||||
- Debian / Ubuntu
|
- Debian / Ubuntu
|
||||||
- Fedora
|
- Fedora
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ body:
|
|||||||
- Refactor / style
|
- Refactor / style
|
||||||
- CI / build / tooling
|
- CI / build / tooling
|
||||||
- Documentation
|
- Documentation
|
||||||
|
- Other (Describe in description box with header "Issue type")
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
|||||||
+11
-2
@@ -61,10 +61,12 @@ set(CMAKE_INSTALL_MESSAGE NEVER)
|
|||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wall -Wextra -Wpedantic -Wshadow -Wconversion
|
-Wall -Wextra -Wpedantic -Wshadow -Wconversion
|
||||||
-Wold-style-cast -Wnull-dereference -Wdouble-promotion
|
-Wnull-dereference -Wdouble-promotion
|
||||||
-Wformat=2 -Wfloat-equal -Woverloaded-virtual
|
-Wformat=2 -Wfloat-equal
|
||||||
-Wsign-conversion -Wredundant-decls -Wswitch
|
-Wsign-conversion -Wredundant-decls -Wswitch
|
||||||
-Wunreachable-code
|
-Wunreachable-code
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -188,4 +190,11 @@ if("m3shapes" IN_LIST ENABLE_MODULES)
|
|||||||
if(TARGET m3shapesplugin)
|
if(TARGET m3shapesplugin)
|
||||||
set_target_properties(m3shapesplugin PROPERTIES INSTALL_RPATH "$ORIGIN")
|
set_target_properties(m3shapesplugin PROPERTIES INSTALL_RPATH "$ORIGIN")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Silence warnings that come from m3shapes files we do not manage.
|
||||||
|
foreach(m3shapes_target m3shapes_core m3shapes_morph m3shapes_shapes m3shapes m3shapesplugin)
|
||||||
|
if(TARGET ${m3shapes_target})
|
||||||
|
target_compile_options(${m3shapes_target} PRIVATE -Wno-shadow -Wno-float-equal)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ CustomRect {
|
|||||||
property color activeOnColor
|
property color activeOnColor
|
||||||
property bool checked
|
property bool checked
|
||||||
property real checkedRadius: Tokens.rounding.medium
|
property real checkedRadius: Tokens.rounding.medium
|
||||||
property real defaultRadius: Tokens.rounding.large
|
property real defaultRadius: Math.min(width, height) / 2
|
||||||
property color disabledColor: Qt.alpha(Colors.palette.m3onSurface, 0.1)
|
property color disabledColor: Qt.alpha(Colors.palette.m3onSurface, 0.1)
|
||||||
property color disabledOnColor: Qt.alpha(Colors.palette.m3onSurface, 0.38)
|
property color disabledOnColor: Qt.alpha(Colors.palette.m3onSurface, 0.38)
|
||||||
property bool fillWidth
|
property bool fillWidth
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ BusyIndicator {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
bgColor: root.bgColor
|
bgColor: root.bgColor
|
||||||
fgColor: root.fgColor
|
fgColor: root.fgColor
|
||||||
|
hasEndIndicator: false
|
||||||
padding: root.padding
|
padding: root.padding
|
||||||
rotation: manager.rotation
|
rotation: manager.rotation
|
||||||
startAngle: manager.startFraction * 360
|
startAngle: manager.startFraction * 360
|
||||||
@@ -53,6 +54,7 @@ BusyIndicator {
|
|||||||
Anim {
|
Anim {
|
||||||
duration: manager.completeEndDuration * Tokens.anim.durations.scale
|
duration: manager.completeEndDuration * Tokens.anim.durations.scale
|
||||||
properties: "opacity,internalStrokeWidth"
|
properties: "opacity,internalStrokeWidth"
|
||||||
|
type: Anim.DefaultEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import QtQuick
|
||||||
|
import ZShell.Components
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property real radius
|
||||||
|
property real topLeftRadius: radius
|
||||||
|
property real topRightRadius: radius
|
||||||
|
property real bottomRightRadius: radius
|
||||||
|
property real bottomLeftRadius: radius
|
||||||
|
property color color: "transparent"
|
||||||
|
default property alias contentData: contentItem.data
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: contentItem
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderEffectSource {
|
||||||
|
id: source
|
||||||
|
|
||||||
|
hideSource: true
|
||||||
|
sourceItem: contentItem
|
||||||
|
}
|
||||||
|
|
||||||
|
RoundedMask {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: source
|
||||||
|
topLeftRadius: root.topLeftRadius
|
||||||
|
topRightRadius: root.topRightRadius
|
||||||
|
bottomRightRadius: root.bottomRightRadius
|
||||||
|
bottomLeftRadius: root.bottomLeftRadius
|
||||||
|
color: root.color
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
CAnim {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,11 +16,12 @@ Text {
|
|||||||
color: Colors.palette.m3onSurface
|
color: Colors.palette.m3onSurface
|
||||||
font: Tokens.font.body.small
|
font: Tokens.font.body.small
|
||||||
linkColor: Colors.palette.m3onPrimaryFixedVariant
|
linkColor: Colors.palette.m3onPrimaryFixedVariant
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.QtRendering
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
CAnim {}
|
CAnim {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Behavior on text {
|
Behavior on text {
|
||||||
enabled: root.animate
|
enabled: root.animate
|
||||||
@@ -32,7 +33,8 @@ Text {
|
|||||||
type: Anim.FastEffects
|
type: Anim.FastEffects
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyAction {}
|
PropertyAction {
|
||||||
|
}
|
||||||
|
|
||||||
TAnim {
|
TAnim {
|
||||||
target: root
|
target: root
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ TextFieldBase {
|
|||||||
|
|
||||||
sourceComponent: MaterialIcon {
|
sourceComponent: MaterialIcon {
|
||||||
color: Colors.palette.m3onSurfaceVariant
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
|
font.pointSize: Tokens.font.size.larger
|
||||||
text: root.leadingIcon
|
text: root.leadingIcon
|
||||||
fontStyle: Tokens.font.icon.builders.medium.scale(0.9).build()
|
fontStyle: Tokens.font.icon.builders.medium.scale(0.9).build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,55 +2,57 @@ import QtQuick
|
|||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
Item {
|
||||||
id: track
|
id: track
|
||||||
|
|
||||||
required property var scrollBar
|
required property var scrollBar
|
||||||
required property var mouseArea
|
required property var mouseArea
|
||||||
|
|
||||||
anchors.left: parent.left
|
ClipRect {
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
implicitHeight: handle.implicitHeight
|
|
||||||
radius: Tokens.rounding.full
|
|
||||||
|
|
||||||
CustomRect {
|
|
||||||
id: handle
|
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
color: Colors.palette.m3secondary
|
|
||||||
implicitWidth: track.scrollBar.width * track.scrollBar.effectiveSize
|
|
||||||
implicitHeight: track.mouseArea.pressed || track.mouseArea.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
|
||||||
opacity: {
|
|
||||||
if (!track.scrollBar.enabled)
|
|
||||||
return 0;
|
|
||||||
if (track.scrollBar.size === 1)
|
|
||||||
return 0;
|
|
||||||
if (track.mouseArea.pressed)
|
|
||||||
return 1;
|
|
||||||
if (track.mouseArea.containsMouse)
|
|
||||||
return 0.8;
|
|
||||||
if (track.scrollBar.policy === CustomScrollBar.AlwaysOn || track.scrollBar.shouldBeActive)
|
|
||||||
return 0.6;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
x: track.scrollBar.reversed ? track.scrollBar.width * (1 + track.scrollBar.nonAnimY) * track.scrollBar.travelScale : track.scrollBar.width * track.scrollBar.nonAnimY * track.scrollBar.travelScale
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
implicitHeight: handle.implicitHeight
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
CustomRect {
|
||||||
Anim {}
|
id: handle
|
||||||
}
|
|
||||||
Behavior on opacity {
|
anchors.bottom: parent.bottom
|
||||||
Anim {
|
color: Colors.palette.m3secondary
|
||||||
type: Anim.DefaultEffects
|
implicitWidth: track.scrollBar.width * track.scrollBar.effectiveSize
|
||||||
|
implicitHeight: track.mouseArea.pressed || track.mouseArea.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
||||||
|
opacity: {
|
||||||
|
if (!track.scrollBar.enabled)
|
||||||
|
return 0;
|
||||||
|
if (track.scrollBar.size === 1)
|
||||||
|
return 0;
|
||||||
|
if (track.mouseArea.pressed)
|
||||||
|
return 1;
|
||||||
|
if (track.mouseArea.containsMouse)
|
||||||
|
return 0.8;
|
||||||
|
if (track.scrollBar.policy === CustomScrollBar.AlwaysOn || track.scrollBar.shouldBeActive)
|
||||||
|
return 0.6;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
radius: Tokens.rounding.full
|
||||||
|
x: track.scrollBar.reversed ? track.scrollBar.width * (1 + track.scrollBar.nonAnimY) * track.scrollBar.travelScale : track.scrollBar.width * track.scrollBar.nonAnimY * track.scrollBar.travelScale
|
||||||
|
|
||||||
MouseArea {
|
Behavior on implicitHeight {
|
||||||
acceptedButtons: Qt.NoButton
|
Anim {}
|
||||||
anchors.fill: parent
|
}
|
||||||
cursorShape: Qt.PointingHandCursor
|
Behavior on opacity {
|
||||||
hoverEnabled: true
|
Anim {
|
||||||
|
type: Anim.DefaultEffects
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ CustomText {
|
|||||||
property int grade: Colors.light ? 0 : -25
|
property int grade: Colors.light ? 0 : -25
|
||||||
property font fontStyle: Tokens.font.icon.small
|
property font fontStyle: Tokens.font.icon.small
|
||||||
|
|
||||||
|
renderType: Text.NativeRendering
|
||||||
font: Tokens.font.icon.size(fontStyle.pointSize).weight(fontStyle.weight).vaxes(fontStyle.variableAxes).fill(fill.toFixed(1)).grade(grade).build()
|
font: Tokens.font.icon.size(fontStyle.pointSize).weight(fontStyle.weight).vaxes(fontStyle.variableAxes).fill(fill.toFixed(1)).grade(grade).build()
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-12
@@ -124,7 +124,7 @@ MouseArea {
|
|||||||
model: root.items
|
model: root.items
|
||||||
|
|
||||||
CustomRect {
|
CustomRect {
|
||||||
id: item
|
id: menuItem
|
||||||
|
|
||||||
readonly property bool active: modelData === root?.active
|
readonly property bool active: modelData === root?.active
|
||||||
required property int index
|
required property int index
|
||||||
@@ -142,13 +142,13 @@ MouseArea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
color: item.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurface
|
color: menuItem.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurface
|
||||||
enabled: root.expanded
|
enabled: root.expanded
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.itemSelected(item.modelData);
|
root.itemSelected(menuItem.modelData);
|
||||||
root.active = item.modelData;
|
root.active = menuItem.modelData;
|
||||||
item.modelData.clicked();
|
menuItem.modelData.clicked();
|
||||||
root.expanded = false;
|
root.expanded = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,26 +162,27 @@ MouseArea {
|
|||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
color: item.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurfaceVariant
|
color: menuItem.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurfaceVariant
|
||||||
text: item.modelData?.icon ?? ""
|
text: menuItem.modelData?.icon ?? ""
|
||||||
|
visible: text !== ""
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: item.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurface
|
color: menuItem.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurface
|
||||||
text: item.modelData?.text ?? ""
|
text: menuItem.modelData?.text ?? ""
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
active: item.modelData?.trailingIcon.length > 0
|
active: menuItem.modelData?.trailingIcon.length > 0
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
visible: active
|
visible: active
|
||||||
|
|
||||||
sourceComponent: MaterialIcon {
|
sourceComponent: MaterialIcon {
|
||||||
color: item.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurfaceVariant
|
color: menuItem.active ? Colors.palette.m3onTertiaryContainer : Colors.palette.m3onSurfaceVariant
|
||||||
text: item.modelData.trailingIcon
|
text: menuItem.modelData.trailingIcon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,4 +34,7 @@ PersistentProperties {
|
|||||||
// Drawing state
|
// Drawing state
|
||||||
property color penColor: "white"
|
property color penColor: "white"
|
||||||
property int penWidth: 4
|
property int penWidth: 4
|
||||||
|
|
||||||
|
// Screenshot state
|
||||||
|
property bool screenshot
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ TextField {
|
|||||||
implicitHeight: contentHeight + topPadding + bottomPadding
|
implicitHeight: contentHeight + topPadding + bottomPadding
|
||||||
implicitWidth: contentWidth + leftPadding + rightPadding
|
implicitWidth: contentWidth + leftPadding + rightPadding
|
||||||
placeholderTextColor: Colors.palette.m3onSurfaceVariant // No anim cause placeholder is custom
|
placeholderTextColor: Colors.palette.m3onSurfaceVariant // No anim cause placeholder is custom
|
||||||
renderType: echoMode === TextField.Password ? TextField.QtRendering : TextField.NativeRendering
|
renderType: TextField.QtRendering
|
||||||
selectedTextColor: color
|
selectedTextColor: color
|
||||||
selectionColor: Qt.alpha(Colors.palette.m3primary, 0.4)
|
selectionColor: Qt.alpha(Colors.palette.m3primary, 0.4)
|
||||||
verticalAlignment: TextInput.AlignVCenter
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
import qs.Effects
|
import qs.Effects
|
||||||
|
|
||||||
CustomFlickable {
|
CustomFlickable {
|
||||||
@@ -9,6 +10,7 @@ CustomFlickable {
|
|||||||
property real bottomFadeOpacity: fadeShouldBeActive(false) ? 0 : 1
|
property real bottomFadeOpacity: fadeShouldBeActive(false) ? 0 : 1
|
||||||
property real fadeAmount: 0.1
|
property real fadeAmount: 0.1
|
||||||
property real topFadeOpacity: fadeShouldBeActive(true) ? 0 : 1
|
property real topFadeOpacity: fadeShouldBeActive(true) ? 0 : 1
|
||||||
|
readonly property real dpr: Math.ceil((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1)
|
||||||
|
|
||||||
function fadeShouldBeActive(isStart: bool): bool {
|
function fadeShouldBeActive(isStart: bool): bool {
|
||||||
// When content is smaller than flickable size, hide fade when rebound starts
|
// When content is smaller than flickable size, hide fade when rebound starts
|
||||||
@@ -28,6 +30,7 @@ CustomFlickable {
|
|||||||
type: Anim.SlowEffects
|
type: Anim.SlowEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
layer.textureSize: Qt.size(width * dpr, height * dpr)
|
||||||
layer.effect: Mask {
|
layer.effect: Mask {
|
||||||
maskSource: mask
|
maskSource: mask
|
||||||
|
|
||||||
|
|||||||
@@ -2,55 +2,57 @@ import QtQuick
|
|||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
Item {
|
||||||
id: track
|
id: track
|
||||||
|
|
||||||
required property var scrollBar
|
required property var scrollBar
|
||||||
required property var mouseArea
|
required property var mouseArea
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
ClipRect {
|
||||||
anchors.right: parent.right
|
anchors.bottom: parent.bottom
|
||||||
anchors.top: parent.top
|
|
||||||
implicitWidth: handle.implicitWidth
|
|
||||||
radius: Tokens.rounding.full
|
|
||||||
|
|
||||||
CustomRect {
|
|
||||||
id: handle
|
|
||||||
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
color: Colors.palette.m3secondary
|
anchors.top: parent.top
|
||||||
implicitHeight: track.scrollBar.height * track.scrollBar.effectiveSize
|
|
||||||
implicitWidth: track.mouseArea.pressed || track.mouseArea.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
|
||||||
opacity: {
|
|
||||||
if (!track.scrollBar.enabled)
|
|
||||||
return 0;
|
|
||||||
if (track.scrollBar.size === 1)
|
|
||||||
return 0;
|
|
||||||
if (track.mouseArea.pressed)
|
|
||||||
return 1;
|
|
||||||
if (track.mouseArea.containsMouse)
|
|
||||||
return 0.8;
|
|
||||||
if (track.scrollBar.policy === CustomScrollBar.AlwaysOn || track.scrollBar.shouldBeActive)
|
|
||||||
return 0.6;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
y: track.scrollBar.reversed ? track.scrollBar.height * (1 + track.scrollBar.nonAnimY) * track.scrollBar.travelScale : track.scrollBar.height * track.scrollBar.nonAnimY * track.scrollBar.travelScale
|
implicitWidth: handle.implicitWidth
|
||||||
|
|
||||||
Behavior on implicitWidth {
|
CustomRect {
|
||||||
Anim {}
|
id: handle
|
||||||
}
|
|
||||||
Behavior on opacity {
|
anchors.right: parent.right
|
||||||
Anim {
|
color: Colors.palette.m3secondary
|
||||||
type: Anim.DefaultEffects
|
implicitHeight: track.scrollBar.height * track.scrollBar.effectiveSize
|
||||||
|
implicitWidth: track.mouseArea.pressed || track.mouseArea.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
||||||
|
opacity: {
|
||||||
|
if (!track.scrollBar.enabled)
|
||||||
|
return 0;
|
||||||
|
if (track.scrollBar.size === 1)
|
||||||
|
return 0;
|
||||||
|
if (track.mouseArea.pressed)
|
||||||
|
return 1;
|
||||||
|
if (track.mouseArea.containsMouse)
|
||||||
|
return 0.8;
|
||||||
|
if (track.scrollBar.policy === CustomScrollBar.AlwaysOn || track.scrollBar.shouldBeActive)
|
||||||
|
return 0.6;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
radius: Tokens.rounding.full
|
||||||
|
y: track.scrollBar.reversed ? track.scrollBar.height * (1 + track.scrollBar.nonAnimY) * track.scrollBar.travelScale : track.scrollBar.height * track.scrollBar.nonAnimY * track.scrollBar.travelScale
|
||||||
|
|
||||||
MouseArea {
|
Behavior on implicitWidth {
|
||||||
acceptedButtons: Qt.NoButton
|
Anim {}
|
||||||
anchors.fill: parent
|
}
|
||||||
cursorShape: Qt.PointingHandCursor
|
Behavior on opacity {
|
||||||
hoverEnabled: true
|
Anim {
|
||||||
|
type: Anim.DefaultEffects
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ Scope {
|
|||||||
name: "Bar-Exclusion"
|
name: "Bar-Exclusion"
|
||||||
screen: root.screen
|
screen: root.screen
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-39
@@ -11,19 +11,18 @@ CustomMouseArea {
|
|||||||
|
|
||||||
required property Item bar
|
required property Item bar
|
||||||
required property real borderThickness
|
required property real borderThickness
|
||||||
required property ScreenState screenState
|
property bool dashboardShortcutActive
|
||||||
|
property point dragStart
|
||||||
required property Drawing drawing
|
required property Drawing drawing
|
||||||
required property EdgeGeometry geometry
|
required property EdgeGeometry geometry
|
||||||
|
property bool osdShortcutActive
|
||||||
required property Panels panels
|
required property Panels panels
|
||||||
required property Wrapper popouts
|
required property Wrapper popouts
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
|
required property ScreenState screenState
|
||||||
property bool dashboardShortcutActive
|
property bool setInitialPoint: false
|
||||||
property bool osdShortcutActive
|
|
||||||
property bool singleGestureTriggered: false
|
property bool singleGestureTriggered: false
|
||||||
property bool utilitiesShortcutActive
|
property bool utilitiesShortcutActive
|
||||||
property bool setInitialPoint: false
|
|
||||||
property point dragStart
|
|
||||||
|
|
||||||
function inBottomPanel(panel: Item, x: real, y: real): bool {
|
function inBottomPanel(panel: Item, x: real, y: real): bool {
|
||||||
const panelHeight = panel.height * (1 - (panel.offsetScale ?? 0));
|
const panelHeight = panel.height * (1 - (panel.offsetScale ?? 0));
|
||||||
@@ -60,39 +59,10 @@ CustomMouseArea {
|
|||||||
return x >= panelX && x <= panelX + panel.width;
|
return x >= panelX && x <= panelX + panel.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: bar.fullscreen ? Qt.NoButton : Qt.AllButtons
|
acceptedButtons: bar.fullscreen ? Qt.NoButton : Qt.AllButtons
|
||||||
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
onPressed: event => {
|
|
||||||
dragStart = Qt.point(event.x, event.y);
|
|
||||||
|
|
||||||
if (screenState.isDrawing) {
|
|
||||||
if (event.button & Qt.RightButton) {
|
|
||||||
drawing.content.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!inLeftPanel(panels.drawing, mouseX, mouseY))
|
|
||||||
drawing.content.beginStroke(event.x, event.y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onPressedChanged: {
|
|
||||||
if (!pressed) {
|
|
||||||
if (screenState.isDrawing) {
|
|
||||||
setInitialPoint = false;
|
|
||||||
drawing.content.endStroke();
|
|
||||||
if (!inLeftPanel(panels.drawing, mouseX, mouseY))
|
|
||||||
drawing.content.showHover(mouseX, mouseY);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (screenState.isDrawing) {
|
|
||||||
panels.drawing.collapse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onContainsMouseChanged: {
|
onContainsMouseChanged: {
|
||||||
if (!containsMouse) {
|
if (!containsMouse) {
|
||||||
if (!osdShortcutActive) {
|
if (!osdShortcutActive) {
|
||||||
@@ -111,7 +81,6 @@ CustomMouseArea {
|
|||||||
screenState.dashboard = false;
|
screenState.dashboard = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onPositionChanged: event => {
|
onPositionChanged: event => {
|
||||||
const x = event.x;
|
const x = event.x;
|
||||||
const y = event.y;
|
const y = event.y;
|
||||||
@@ -144,7 +113,8 @@ CustomMouseArea {
|
|||||||
if (pressed && dragStart.y >= screen.height - Config.bar.border && dragStart.x > screen.width / 5 && dragY < -Config.launcher.dragThreshold)
|
if (pressed && dragStart.y >= screen.height - Config.bar.border && dragStart.x > screen.width / 5 && dragY < -Config.launcher.dragThreshold)
|
||||||
screenState.launcher = true;
|
screenState.launcher = true;
|
||||||
|
|
||||||
const showDashboard = Config.dashboard.showOnHover && inTopPanel(panels.dashboardWrapper, x, y);
|
const entryAt = bar.entryAt(geometry.axisPos(x, y));
|
||||||
|
const showDashboard = Config.dashboard.showOnHover && inTopPanel(panels.dashboardWrapper, x, y) && (!entryAt || entryAt === "activeWindow");
|
||||||
|
|
||||||
if (!dashboardShortcutActive) {
|
if (!dashboardShortcutActive) {
|
||||||
screenState.dashboard = showDashboard;
|
screenState.dashboard = showDashboard;
|
||||||
@@ -159,7 +129,7 @@ CustomMouseArea {
|
|||||||
screenState.dashboard = false;
|
screenState.dashboard = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pressed && geometry.insetTop(borderThickness) > dragStart.y && (Config.dashboard.showOnHover || !inTopPanel(panels.dashboardWrapper, dragStart.x, dragStart.y))) {
|
if (pressed && geometry.insetTop(borderThickness) > dragStart.y && !inTopPanel(panels.dashboardWrapper, dragStart.x, dragStart.y)) {
|
||||||
if (dragY > 20) {
|
if (dragY > 20) {
|
||||||
screenState.settings = true;
|
screenState.settings = true;
|
||||||
} else if (dragY < -20) {
|
} else if (dragY < -20) {
|
||||||
@@ -212,6 +182,33 @@ CustomMouseArea {
|
|||||||
if (geometry.barContains(x, y))
|
if (geometry.barContains(x, y))
|
||||||
bar.checkPopout(geometry.axisPos(x, y));
|
bar.checkPopout(geometry.axisPos(x, y));
|
||||||
}
|
}
|
||||||
|
onPressed: event => {
|
||||||
|
dragStart = Qt.point(event.x, event.y);
|
||||||
|
|
||||||
|
if (screenState.isDrawing) {
|
||||||
|
if (event.button & Qt.RightButton) {
|
||||||
|
drawing.content.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inLeftPanel(panels.drawing, mouseX, mouseY))
|
||||||
|
drawing.content.beginStroke(event.x, event.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onPressedChanged: {
|
||||||
|
if (!pressed) {
|
||||||
|
if (screenState.isDrawing) {
|
||||||
|
setInitialPoint = false;
|
||||||
|
drawing.content.endStroke();
|
||||||
|
if (!inLeftPanel(panels.drawing, mouseX, mouseY))
|
||||||
|
drawing.content.showHover(mouseX, mouseY);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (screenState.isDrawing) {
|
||||||
|
panels.drawing.collapse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: unhideTimer
|
id: unhideTimer
|
||||||
|
|||||||
+10
-9
@@ -3,8 +3,8 @@ import QtQuick
|
|||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Modules.Bar.Popouts as Popouts
|
import qs.Modules.Bar.Popouts as Popouts
|
||||||
import qs.Modules.Notifications as Notifications
|
import qs.Modules.Notifications as Notifications
|
||||||
import qs.Modules.Notifications.Sidebar as Sidebar
|
import qs.Modules.Sidebar as Sidebar
|
||||||
import qs.Modules.Notifications.Sidebar.Utils as Utils
|
import qs.Modules.Sidebar.Utils as Utils
|
||||||
import qs.Modules.Dashboard as Dashboard
|
import qs.Modules.Dashboard as Dashboard
|
||||||
import qs.Modules.Osd as Osd
|
import qs.Modules.Osd as Osd
|
||||||
import qs.Components.Toast as Toasts
|
import qs.Components.Toast as Toasts
|
||||||
@@ -19,15 +19,11 @@ import ZShell.Config
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property Item bar
|
|
||||||
required property real borderThickness
|
|
||||||
readonly property alias clipboard: clipboard
|
readonly property alias clipboard: clipboard
|
||||||
readonly property alias dashboard: dashboard
|
readonly property alias dashboard: dashboard
|
||||||
readonly property alias dashboardWrapper: dashboardWrapper
|
readonly property alias dashboardWrapper: dashboardWrapper
|
||||||
readonly property alias dock: dock
|
readonly property alias dock: dock
|
||||||
readonly property alias drawing: drawing
|
readonly property alias drawing: drawing
|
||||||
required property var drawingItem
|
|
||||||
required property EdgeGeometry geometry
|
|
||||||
readonly property alias launcher: launcher
|
readonly property alias launcher: launcher
|
||||||
readonly property alias notifications: notifications
|
readonly property alias notifications: notifications
|
||||||
readonly property alias osd: osd
|
readonly property alias osd: osd
|
||||||
@@ -36,14 +32,19 @@ Item {
|
|||||||
readonly property alias popoutsWrapper: popouts
|
readonly property alias popoutsWrapper: popouts
|
||||||
readonly property alias resources: resources
|
readonly property alias resources: resources
|
||||||
readonly property alias resourcesWrapper: resourcesWrapper
|
readonly property alias resourcesWrapper: resourcesWrapper
|
||||||
required property ShellScreen screen
|
|
||||||
required property ScreenState screenState
|
|
||||||
readonly property alias settings: settings
|
readonly property alias settings: settings
|
||||||
readonly property alias settingsWrapper: settingsWrapper
|
readonly property alias settingsWrapper: settingsWrapper
|
||||||
readonly property alias sidebar: sidebar
|
readonly property alias sidebar: sidebar
|
||||||
readonly property alias toasts: toasts
|
readonly property alias toasts: toasts
|
||||||
readonly property alias utilities: utilities
|
readonly property alias utilities: utilities
|
||||||
|
|
||||||
|
required property Item bar
|
||||||
|
required property real borderThickness
|
||||||
|
required property var drawingItem
|
||||||
|
required property EdgeGeometry geometry
|
||||||
|
required property ShellScreen screen
|
||||||
|
required property ScreenState screenState
|
||||||
|
|
||||||
anchors.bottomMargin: geometry.insetBottom(borderThickness)
|
anchors.bottomMargin: geometry.insetBottom(borderThickness)
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: geometry.insetLeft(borderThickness)
|
anchors.leftMargin: geometry.insetLeft(borderThickness)
|
||||||
@@ -151,7 +152,7 @@ Item {
|
|||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
clip: true
|
clip: offsetScale > 0
|
||||||
implicitHeight: dashboard.implicitHeight * (1 - offsetScale)
|
implicitHeight: dashboard.implicitHeight * (1 - offsetScale)
|
||||||
implicitWidth: dashboard.implicitWidth
|
implicitWidth: dashboard.implicitWidth
|
||||||
|
|
||||||
|
|||||||
+44
-45
@@ -11,6 +11,7 @@ import ZShell.Blobs
|
|||||||
import qs.Daemons
|
import qs.Daemons
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Modules.Bar
|
import qs.Modules.Bar
|
||||||
|
import qs.Modules.Bar.Popouts.Network as N
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Drawers
|
import qs.Drawers
|
||||||
@@ -52,15 +53,14 @@ CustomWindow {
|
|||||||
property var root: Quickshell.shellDir
|
property var root: Quickshell.shellDir
|
||||||
readonly property ScreenState screenState: ShellState.forScreen(screen)
|
readonly property ScreenState screenState: ShellState.forScreen(screen)
|
||||||
readonly property real sdfBorderOffset: 2 * fsTransitionProg
|
readonly property real sdfBorderOffset: 2 * fsTransitionProg
|
||||||
readonly property real shadowOpacity: 0.7 * (1 - (bar.isHovered ? 0 : fsTransitionProg))
|
readonly property real shadowOpacity: 0.5 * (1 - (bar.isHovered ? 0 : fsTransitionProg))
|
||||||
property color surfaceColor: Colors.tPalette.m3surface
|
property color surfaceColor: Colors.tPalette.m3surface
|
||||||
|
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.keyboardFocus: screenState.launcher || screenState.settings || screenState.sidebar ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: screenState.screenshot ? WlrKeyboardFocus.Exclusive : screenState.launcher || screenState.settings || screenState.sidebar ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
WlrLayershell.layer: (fsTransitionProg > 0 && Config.general.showOverFullscreen) || (hasSpecialWorkspace && hasFullscreenOnNormalWs) ? WlrLayer.Overlay : WlrLayer.Top
|
WlrLayershell.layer: (fsTransitionProg > 0 && Config.general.showOverFullscreen) || (hasSpecialWorkspace && hasFullscreenOnNormalWs) ? WlrLayer.Overlay : WlrLayer.Top
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
contentItem.focus: true
|
mask: screenState.isDrawing || screenState.screenshot ? null : (hasFullscreen && !bar.isHovered ? emptyRegion : regions)
|
||||||
mask: screenState.isDrawing ? null : (hasFullscreen && !bar.isHovered ? emptyRegion : regions)
|
|
||||||
name: "Bar"
|
name: "Bar"
|
||||||
|
|
||||||
Behavior on fsTransitionProg {
|
Behavior on fsTransitionProg {
|
||||||
@@ -143,7 +143,6 @@ CustomWindow {
|
|||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
id: focusGrab
|
id: focusGrab
|
||||||
|
|
||||||
windows: [root]
|
|
||||||
active: {
|
active: {
|
||||||
const s = root.screenState;
|
const s = root.screenState;
|
||||||
const c = Config;
|
const c = Config;
|
||||||
@@ -160,6 +159,7 @@ CustomWindow {
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
windows: [root]
|
||||||
|
|
||||||
onCleared: {
|
onCleared: {
|
||||||
root.screenState.launcher = false;
|
root.screenState.launcher = false;
|
||||||
@@ -185,23 +185,19 @@ CustomWindow {
|
|||||||
id: surface
|
id: surface
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
layer.enabled: true
|
|
||||||
opacity: root.surfaceColor.a
|
opacity: root.surfaceColor.a
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
BlobGroup2 {
|
||||||
blurMax: 32
|
|
||||||
shadowColor: Qt.alpha(Colors.palette.m3shadow, Math.max(0, root.shadowOpacity))
|
|
||||||
shadowEnabled: true
|
|
||||||
}
|
|
||||||
|
|
||||||
BlobGroup {
|
|
||||||
id: blobGroup
|
id: blobGroup
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
color: root.surfaceColor
|
color: root.surfaceColor
|
||||||
|
shadowColor: Qt.alpha(Colors.palette.m3shadow, Math.max(0, root.shadowOpacity))
|
||||||
|
shadowRadius: 18
|
||||||
smoothing: Config.bar.smoothing
|
smoothing: Config.bar.smoothing
|
||||||
}
|
}
|
||||||
|
|
||||||
BlobInvertedRect {
|
BlobInvertedRect2 {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: -50
|
anchors.margins: -50
|
||||||
borderBottom: geometry.insetBottom(root.borderThickness) - anchors.margins - root.sdfBorderOffset
|
borderBottom: geometry.insetBottom(root.borderThickness) - anchors.margins - root.sdfBorderOffset
|
||||||
@@ -251,6 +247,7 @@ CustomWindow {
|
|||||||
PanelBg {
|
PanelBg {
|
||||||
id: osdBg
|
id: osdBg
|
||||||
|
|
||||||
|
atRestOverride: panels.osd.offsetScale < 0.99
|
||||||
deformAmount: 0.1
|
deformAmount: 0.1
|
||||||
implicitHeight: panels.osd.height
|
implicitHeight: panels.osd.height
|
||||||
implicitWidth: panels.osd.width
|
implicitWidth: panels.osd.width
|
||||||
@@ -262,6 +259,7 @@ CustomWindow {
|
|||||||
PanelBg {
|
PanelBg {
|
||||||
id: notifsBg
|
id: notifsBg
|
||||||
|
|
||||||
|
atRestOverride: panel.implicitHeight > 0
|
||||||
panel: panels.notifications
|
panel: panels.notifications
|
||||||
radius: Tokens.rounding.large
|
radius: Tokens.rounding.large
|
||||||
}
|
}
|
||||||
@@ -296,13 +294,16 @@ CustomWindow {
|
|||||||
PanelBg {
|
PanelBg {
|
||||||
id: resourcesBg
|
id: resourcesBg
|
||||||
|
|
||||||
|
property real extraExtent: 0.2
|
||||||
|
|
||||||
|
atRestOverride: panels.resources.offsetScale < 0.99
|
||||||
deformAmount: 0.05
|
deformAmount: 0.05
|
||||||
implicitHeight: panels.resources.height
|
implicitHeight: panels.resources.height * (1 + extraExtent)
|
||||||
implicitWidth: panels.resources.width
|
implicitWidth: panels.resources.width * (1 + extraExtent)
|
||||||
panel: panels.resourcesWrapper
|
panel: panels.resourcesWrapper
|
||||||
radius: Tokens.rounding.largeIncreased + Tokens.padding.small
|
radius: Tokens.rounding.largeIncreased + Tokens.padding.small
|
||||||
x: panels.resourcesWrapper.x + panels.resources.x + geometry.insetLeft(root.borderThickness)
|
x: panels.resourcesWrapper.x + panels.resources.x + geometry.insetLeft(root.borderThickness) - panels.resources.width * extraExtent
|
||||||
y: panels.resourcesWrapper.y + panels.resources.y + geometry.insetTop(root.borderThickness)
|
y: panels.resourcesWrapper.y + panels.resources.y + geometry.insetTop(root.borderThickness) - panels.resources.height * extraExtent
|
||||||
}
|
}
|
||||||
|
|
||||||
PanelBg {
|
PanelBg {
|
||||||
@@ -332,9 +333,15 @@ CustomWindow {
|
|||||||
PanelBg {
|
PanelBg {
|
||||||
id: clipboardBg
|
id: clipboardBg
|
||||||
|
|
||||||
|
property real extraExtent: 0.2
|
||||||
|
|
||||||
deformAmount: 0.03
|
deformAmount: 0.03
|
||||||
|
implicitHeight: panels.clipboard.height * (1 + extraExtent)
|
||||||
|
implicitWidth: panels.clipboard.width * (1 + extraExtent)
|
||||||
panel: panels.clipboard
|
panel: panels.clipboard
|
||||||
radius: 29
|
radius: 29
|
||||||
|
x: panels.clipboard.x + geometry.insetLeft(root.borderThickness) - panels.clipboard.width * extraExtent
|
||||||
|
y: panels.clipboard.y + geometry.insetTop(root.borderThickness)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,34 +349,8 @@ CustomWindow {
|
|||||||
id: drawing
|
id: drawing
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
layer.enabled: true
|
|
||||||
screenState: root.screenState
|
screenState: root.screenState
|
||||||
z: 2
|
z: 2
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
maskEnabled: true
|
|
||||||
maskInverted: true
|
|
||||||
maskSource: maskSource
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: maskSource
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
layer.enabled: true
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
CustomRect {
|
|
||||||
readonly property int extraWidth: radius
|
|
||||||
|
|
||||||
color: "white"
|
|
||||||
implicitHeight: panels.drawing.height
|
|
||||||
implicitWidth: panels.drawing.width + extraWidth
|
|
||||||
radius: drawingBg.radius
|
|
||||||
x: -extraWidth + root.borderThickness + panels.drawing.x
|
|
||||||
y: panels.drawing.y + bar.implicitHeight
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Interactions2 {
|
Interactions2 {
|
||||||
@@ -449,10 +430,28 @@ CustomWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
component PanelBg: BlobRect {
|
LazyLoader {
|
||||||
|
id: loader
|
||||||
|
|
||||||
|
property bool closing: !root.screenState.screenshot
|
||||||
|
|
||||||
|
onClosingChanged: if (!closing)
|
||||||
|
activeAsync = true
|
||||||
|
|
||||||
|
Picker {
|
||||||
|
loader: loader
|
||||||
|
parent: root.contentItem
|
||||||
|
screen: root.screen
|
||||||
|
screenState: root.screenState
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component PanelBg: BlobRect2 {
|
||||||
property real deformAmount: 0.15
|
property real deformAmount: 0.15
|
||||||
required property Item panel
|
required property Item panel
|
||||||
|
|
||||||
|
atRestOverride: panel?.offsetScale < 0.99 ?? false
|
||||||
|
damping: 28.3
|
||||||
deformScale: (deformAmount * Config.appearance.deform.scale) / 10000
|
deformScale: (deformAmount * Config.appearance.deform.scale) / 10000
|
||||||
group: blobGroup
|
group: blobGroup
|
||||||
implicitHeight: panel.height
|
implicitHeight: panel.height
|
||||||
|
|||||||
+12
-28
@@ -27,27 +27,21 @@ ColumnLayout {
|
|||||||
CustomText {
|
CustomText {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
color: Colors.palette.m3secondary
|
color: Colors.palette.m3secondary
|
||||||
font.bold: true
|
font: Tokens.font.headline.builders.large.scale(3 * root.centerScale).weight(Font.Bold).width(30).build()
|
||||||
font.family: Config.appearance.font.family.clock
|
|
||||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * 3 * root.centerScale)
|
|
||||||
text: Time.hourStr
|
text: Time.hourStr
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
color: Colors.palette.m3primary
|
color: Colors.palette.m3primary
|
||||||
font.bold: true
|
font: Tokens.font.headline.builders.large.scale(3 * root.centerScale).weight(Font.Bold).width(30).build()
|
||||||
font.family: Config.appearance.font.family.clock
|
|
||||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * 3 * root.centerScale)
|
|
||||||
text: ":"
|
text: ":"
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
color: Colors.palette.m3secondary
|
color: Colors.palette.m3secondary
|
||||||
font.bold: true
|
font: Tokens.font.headline.builders.large.scale(3 * root.centerScale).weight(Font.Bold).width(30).build()
|
||||||
font.family: Config.appearance.font.family.clock
|
|
||||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * 3 * root.centerScale)
|
|
||||||
text: Time.minuteStr
|
text: Time.minuteStr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,13 +50,11 @@ ColumnLayout {
|
|||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: -Tokens.padding.large * 2
|
Layout.topMargin: -Tokens.padding.large * 2
|
||||||
color: Colors.palette.m3tertiary
|
color: Colors.palette.m3tertiary
|
||||||
font.bold: true
|
font: Tokens.font.title.builders.medium.weight(Font.DemiBold).build()
|
||||||
font.family: Config.appearance.font.family.mono
|
|
||||||
font.pointSize: Math.floor(Tokens.font.size.extraLarge * root.centerScale)
|
|
||||||
text: Time.format("dddd, d MMMM yyyy")
|
text: Time.format("dddd, d MMMM yyyy")
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: Tokens.spacing.largeIncreased * 2
|
Layout.topMargin: Tokens.spacing.largeIncreased * 2
|
||||||
color: Colors.tPalette.m3surfaceContainer
|
color: Colors.tPalette.m3surfaceContainer
|
||||||
@@ -73,7 +65,7 @@ ColumnLayout {
|
|||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: Colors.palette.m3onSurfaceVariant
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Math.floor(root.centerWidth / 4)
|
fontStyle: Tokens.font.icon.size(root.centerWidth / 4).build()
|
||||||
text: "person"
|
text: "person"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,9 +80,7 @@ ColumnLayout {
|
|||||||
CustomText {
|
CustomText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: Colors.palette.m3onSurfaceVariant
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.body.large
|
||||||
font.pointSize: Tokens.font.size.normal
|
|
||||||
font.weight: 600
|
|
||||||
text: root.greeter.username
|
text: root.greeter.username
|
||||||
visible: text.length > 0
|
visible: text.length > 0
|
||||||
}
|
}
|
||||||
@@ -155,8 +145,7 @@ ColumnLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +180,6 @@ ColumnLayout {
|
|||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: root.greeter.buffer && !root.greeter.launching ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
color: root.greeter.buffer && !root.greeter.launching ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||||
font.weight: 500
|
|
||||||
text: root.greeter.launching ? "hourglass_top" : "arrow_forward"
|
text: root.greeter.launching ? "hourglass_top" : "arrow_forward"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,8 +192,7 @@ ColumnLayout {
|
|||||||
implicitHeight: Math.max(message.implicitHeight, stateMessage.implicitHeight)
|
implicitHeight: Math.max(message.implicitHeight, stateMessage.implicitHeight)
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
@@ -245,12 +232,10 @@ ColumnLayout {
|
|||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMsgChanged: {
|
onMsgChanged: {
|
||||||
@@ -292,8 +277,7 @@ ColumnLayout {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
color: isError ? Colors.palette.m3error : Colors.palette.m3primary
|
color: isError ? Colors.palette.m3error : Colors.palette.m3primary
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.mono.medium
|
||||||
font.pointSize: Tokens.font.size.small
|
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
opacity: 0
|
opacity: 0
|
||||||
scale: 0.7
|
scale: 0.7
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ BusyIndicator {
|
|||||||
property int animState
|
property int animState
|
||||||
property color bgColor: Colors.palette.m3secondaryContainer
|
property color bgColor: Colors.palette.m3secondaryContainer
|
||||||
property color fgColor: Colors.palette.m3primary
|
property color fgColor: Colors.palette.m3primary
|
||||||
property real implicitSize: Tokens.font.size.normal * 3
|
property real implicitSize: Tokens.font.body.medium.pointSize * 3
|
||||||
property real internalStrokeWidth: strokeWidth
|
property real internalStrokeWidth: strokeWidth
|
||||||
readonly property alias progress: manager.progress
|
readonly property alias progress: manager.progress
|
||||||
property real strokeWidth: Tokens.padding.extraSmall * 0.8
|
property real strokeWidth: Tokens.padding.extraSmall * 0.8
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import QtQuick
|
||||||
|
import ZShell.Components
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property real radius
|
||||||
|
property real topLeftRadius: radius
|
||||||
|
property real topRightRadius: radius
|
||||||
|
property real bottomRightRadius: radius
|
||||||
|
property real bottomLeftRadius: radius
|
||||||
|
property color color: "transparent"
|
||||||
|
default property alias contentData: contentItem.data
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: contentItem
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderEffectSource {
|
||||||
|
id: source
|
||||||
|
|
||||||
|
hideSource: true
|
||||||
|
sourceItem: contentItem
|
||||||
|
}
|
||||||
|
|
||||||
|
RoundedMask {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: source
|
||||||
|
topLeftRadius: root.topLeftRadius
|
||||||
|
topRightRadius: root.topRightRadius
|
||||||
|
bottomRightRadius: root.bottomRightRadius
|
||||||
|
bottomLeftRadius: root.bottomLeftRadius
|
||||||
|
color: root.color
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
CAnim {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,36 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import qs.Services
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property bool doneFakeFlick
|
||||||
|
|
||||||
|
interactive: !ShellState.forActive().isDrawing
|
||||||
maximumFlickVelocity: 3000
|
maximumFlickVelocity: 3000
|
||||||
|
|
||||||
rebound: Transition {
|
rebound: Transition {
|
||||||
|
onRunningChanged: {
|
||||||
|
if (!running && !root.doneFakeFlick) {
|
||||||
|
root.doneFakeFlick = true;
|
||||||
|
root.flick(1, 1);
|
||||||
|
root.flick(-1, -1);
|
||||||
|
Qt.callLater(() => root.cancelFlick());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Anim {
|
Anim {
|
||||||
properties: "x,y"
|
properties: "x,y"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 10
|
||||||
|
running: root.doneFakeFlick
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
root.doneFakeFlick = false;
|
||||||
|
root.returnToBounds();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,36 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import qs.Services
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property bool doneFakeFlick
|
||||||
|
|
||||||
|
interactive: !ShellState.forActive()?.isDrawing
|
||||||
maximumFlickVelocity: 3000
|
maximumFlickVelocity: 3000
|
||||||
|
|
||||||
rebound: Transition {
|
rebound: Transition {
|
||||||
|
// onRunningChanged: {
|
||||||
|
// if (!running && !root.doneFakeFlick) {
|
||||||
|
// root.doneFakeFlick = true;
|
||||||
|
// root.flick(1, 1);
|
||||||
|
// root.flick(-1, -1);
|
||||||
|
// Qt.callLater(() => root.cancelFlick());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
Anim {
|
Anim {
|
||||||
properties: "x,y"
|
properties: "x,y"
|
||||||
|
type: Anim.DefaultEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Timer {
|
||||||
|
// interval: 10
|
||||||
|
// running: root.doneFakeFlick
|
||||||
|
//
|
||||||
|
// onTriggered: {
|
||||||
|
// root.doneFakeFlick = false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ MouseArea {
|
|||||||
property int scrollAccumulatedY: 0
|
property int scrollAccumulatedY: 0
|
||||||
|
|
||||||
function onWheel(event: WheelEvent): void {
|
function onWheel(event: WheelEvent): void {
|
||||||
|
event.accepted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onWheel: event => {
|
onWheel: event => {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ Rectangle {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
CAnim {
|
CAnim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,9 @@ Text {
|
|||||||
property real animateTo: 1
|
property real animateTo: 1
|
||||||
|
|
||||||
color: Colors.palette.m3onSurface
|
color: Colors.palette.m3onSurface
|
||||||
font.family: Config.appearance.font.family.sans
|
font: Tokens.font.body.small
|
||||||
font.pointSize: Tokens.font.size.normal
|
|
||||||
linkColor: Colors.palette.m3onPrimaryFixedVariant
|
linkColor: Colors.palette.m3onPrimaryFixedVariant
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.QtRendering
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
@@ -28,22 +27,25 @@ Text {
|
|||||||
enabled: root.animate
|
enabled: root.animate
|
||||||
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
Anim {
|
TAnim {
|
||||||
|
target: root
|
||||||
to: root.animateFrom
|
to: root.animateFrom
|
||||||
|
type: Anim.FastEffects
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyAction {
|
PropertyAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
Anim {
|
TAnim {
|
||||||
|
target: root
|
||||||
to: root.animateTo
|
to: root.animateTo
|
||||||
|
type: Anim.DefaultEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
component Anim: NumberAnimation {
|
component TAnim: Anim {
|
||||||
duration: root.animateDuration / 2
|
duration: root.animateDuration / 2
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
properties: root.animateProp.split(",").length > 1 ? root.animateProp : ""
|
properties: root.animateProp.split(",").length > 1 ? root.animateProp : ""
|
||||||
property: root.animateProp.split(",").length === 1 ? root.animateProp : ""
|
property: root.animateProp.split(",").length === 1 ? root.animateProp : ""
|
||||||
target: root
|
target: root
|
||||||
|
|||||||
@@ -1,76 +1,305 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Shapes
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
TextField {
|
TextFieldBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
background: null
|
enum TextFieldType {
|
||||||
color: Colors.palette.m3onSurface
|
Outlined,
|
||||||
cursorVisible: !readOnly
|
Filled
|
||||||
font.family: Config.appearance.font.family.sans
|
}
|
||||||
font.pointSize: Tokens.font.size.smaller
|
|
||||||
placeholderTextColor: Colors.palette.m3outline
|
|
||||||
renderType: echoMode === TextField.Password ? TextField.QtRendering : TextField.NativeRendering
|
|
||||||
|
|
||||||
Behavior on color {
|
readonly property int clampedRadius: Math.min(horizontalPadding, Math.min(width, height) / 2, radius)
|
||||||
CAnim {
|
readonly property string effectiveSupportingText: isError && errorText ? errorText : supportingText
|
||||||
|
readonly property int filledOffset: type === CustomTextField.Filled ? Tokens.spacing.small : 0
|
||||||
|
readonly property int leadingOffset: leadingIcon ? leadingIconLoader.width + leadingIconLoader.anchors.leftMargin : 0
|
||||||
|
readonly property real smallFontScale: smallFontSize / font.pointSize
|
||||||
|
readonly property int supportingTextOffset: effectiveSupportingText ? supportingTextLoader.height + Tokens.spacing.extraSmall : 0
|
||||||
|
readonly property int trailingOffset: trailingIcon ? trailingIconLoader.width + trailingIconLoader.anchors.rightMargin : 0
|
||||||
|
readonly property bool valid: !validate || (!text && emptyIsValid) || (validate instanceof RegExp ? validate.test(text) : !!validate(text))
|
||||||
|
|
||||||
|
property int horizontalPadding: Tokens.padding.large
|
||||||
|
property int verticalPadding: Tokens.padding.large
|
||||||
|
|
||||||
|
property int radius: Tokens.rounding.small
|
||||||
|
|
||||||
|
property string supportingText
|
||||||
|
property string trailingIcon
|
||||||
|
property int smallFontSize: Tokens.font.label.small.pointSize
|
||||||
|
|
||||||
|
property int type: CustomTextField.Outlined
|
||||||
|
property var validate // Regex or function
|
||||||
|
property bool emptyIsValid: true
|
||||||
|
property string errorText
|
||||||
|
property bool isError
|
||||||
|
property string leadingIcon
|
||||||
|
|
||||||
|
bottomPadding: verticalPadding + supportingTextOffset - filledOffset
|
||||||
|
leftPadding: horizontalPadding + leadingOffset
|
||||||
|
rightPadding: horizontalPadding + trailingOffset
|
||||||
|
topPadding: verticalPadding + filledOffset
|
||||||
|
|
||||||
|
background: Loader {
|
||||||
|
anchors.bottomMargin: root.supportingTextOffset
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceComponent: root.type === CustomTextField.Filled ? filledComp : outlineComp
|
||||||
|
|
||||||
|
StateLayer {
|
||||||
|
id: stateLayer
|
||||||
|
|
||||||
|
cursorShape: Qt.IBeamCursor
|
||||||
|
enabled: !root.activeFocus
|
||||||
|
manualPressOverride: tapHandler.pressed
|
||||||
|
radius: root.type === CustomTextField.Outlined ? root.clampedRadius : 0
|
||||||
|
topLeftRadius: root.clampedRadius
|
||||||
|
topRightRadius: root.clampedRadius
|
||||||
|
|
||||||
|
onClicked: root.focus = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cursorDelegate: CustomRect {
|
|
||||||
id: cursor
|
|
||||||
|
|
||||||
property bool disableBlink
|
onEditingFinished: {
|
||||||
|
if (!valid)
|
||||||
|
isError = true;
|
||||||
|
}
|
||||||
|
onPressed: {
|
||||||
|
if (stateLayer.enabled)
|
||||||
|
stateLayer.press(stateLayer.mouseX, stateLayer.mouseY);
|
||||||
|
}
|
||||||
|
onTextEdited: {
|
||||||
|
if (isError)
|
||||||
|
isError = false;
|
||||||
|
}
|
||||||
|
|
||||||
color: Colors.palette.m3primary
|
Item {
|
||||||
implicitWidth: 2
|
id: contentWrapper
|
||||||
radius: Tokens.rounding.medium
|
|
||||||
|
|
||||||
Behavior on opacity {
|
anchors.bottomMargin: root.supportingTextOffset
|
||||||
Anim {
|
anchors.fill: parent
|
||||||
duration: Tokens.anim.durations.small
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
CustomText {
|
||||||
function onCursorPositionChanged(): void {
|
id: placeholder
|
||||||
if (root.activeFocus && root.cursorVisible) {
|
|
||||||
cursor.opacity = 1;
|
anchors.left: parent.left
|
||||||
cursor.disableBlink = true;
|
anchors.leftMargin: root.leftPadding
|
||||||
enableBlink.restart();
|
anchors.topMargin: Tokens.padding.extraSmall
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
color: root.isError ? Colors.palette.m3error : (root.activeFocus ? Colors.palette.m3primary : root.text ? Colors.palette.m3outline : root.placeholderTextColor)
|
||||||
|
font.family: root.font.family
|
||||||
|
font.pointSize: root.font.pointSize
|
||||||
|
font.variableAxes: root.font.variableAxes
|
||||||
|
font.weight: root.font.weight
|
||||||
|
renderType: Text.QtRendering
|
||||||
|
text: root.placeholderText
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "smallOutlined"
|
||||||
|
when: root.type === CustomTextField.Outlined && (root.activeFocus || root.text)
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
placeholder.anchors.leftMargin: -(1 - root.smallFontScale) * placeholder.width / 2 + root.horizontalPadding
|
||||||
|
placeholder.scale: root.smallFontScale
|
||||||
|
}
|
||||||
|
|
||||||
|
AnchorChanges {
|
||||||
|
anchors.verticalCenter: contentWrapper.top
|
||||||
|
target: placeholder
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "smallFilled"
|
||||||
|
when: root.type === CustomTextField.Filled && (root.activeFocus || root.text)
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
placeholder.anchors.leftMargin: -(1 - root.smallFontScale) * placeholder.width / 2 + root.horizontalPadding + root.leadingOffset
|
||||||
|
placeholder.scale: root.smallFontScale
|
||||||
|
}
|
||||||
|
|
||||||
|
AnchorChanges {
|
||||||
|
anchors.top: contentWrapper.top
|
||||||
|
anchors.verticalCenter: undefined
|
||||||
|
target: placeholder
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
transitions: Transition {
|
||||||
|
Anim {
|
||||||
|
properties: "scale,leftMargin"
|
||||||
|
type: Anim.DefaultEffects
|
||||||
|
}
|
||||||
|
|
||||||
|
AnchorAnim {
|
||||||
|
duration: Tokens.anim.durations.expressiveDefaultEffects
|
||||||
|
easing: Tokens.anim.expressiveDefaultEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target: root
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Loader {
|
||||||
id: enableBlink
|
id: leadingIconLoader
|
||||||
|
|
||||||
interval: 100
|
active: root.leadingIcon
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Tokens.padding.small
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
onTriggered: cursor.disableBlink = false
|
sourceComponent: MaterialIcon {
|
||||||
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
|
text: root.leadingIcon
|
||||||
|
fontStyle: Tokens.font.icon.builders.medium.scale(0.9).build()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Loader {
|
||||||
interval: 500
|
id: trailingIconLoader
|
||||||
repeat: true
|
|
||||||
running: root.activeFocus && root.cursorVisible && !cursor.disableBlink
|
|
||||||
triggeredOnStart: true
|
|
||||||
|
|
||||||
onTriggered: parent.opacity = parent.opacity === 1 ? 0 : 1
|
active: root.trailingIcon
|
||||||
}
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Tokens.padding.small
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
Binding {
|
sourceComponent: MaterialIcon {
|
||||||
cursor.opacity: 0
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
when: !root.activeFocus || !root.cursorVisible
|
text: root.trailingIcon
|
||||||
|
fontStyle: Tokens.font.icon.builders.medium.scale(0.9).build()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on placeholderTextColor {
|
|
||||||
CAnim {
|
Loader {
|
||||||
|
id: supportingTextLoader
|
||||||
|
|
||||||
|
active: root.effectiveSupportingText
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: root.horizontalPadding
|
||||||
|
|
||||||
|
sourceComponent: CustomText {
|
||||||
|
color: root.isError ? Colors.palette.m3error : Colors.palette.m3onSurfaceVariant
|
||||||
|
font: Tokens.font.label.small
|
||||||
|
text: root.effectiveSupportingText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
id: tapHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: outlineComp
|
||||||
|
|
||||||
|
Shape {
|
||||||
|
id: bg
|
||||||
|
|
||||||
|
asynchronous: true
|
||||||
|
preferredRendererType: Shape.CurveRenderer
|
||||||
|
|
||||||
|
ShapePath {
|
||||||
|
id: path
|
||||||
|
|
||||||
|
readonly property real inset: strokeWidth / 2
|
||||||
|
readonly property real outlineGap: placeholder.width * root.smallFontScale + Tokens.spacing.small * 2
|
||||||
|
property real outlineGapScale: root.activeFocus || root.text ? 1 : 0
|
||||||
|
|
||||||
|
capStyle: ShapePath.RoundCap
|
||||||
|
fillColor: "transparent"
|
||||||
|
startX: path.inset + root.horizontalPadding - root.clampedRadius + path.outlineGap * (1 - path.outlineGapScale) / 2 + path.outlineGap * path.outlineGapScale
|
||||||
|
startY: path.inset
|
||||||
|
strokeColor: root.isError ? Colors.palette.m3error : (root.activeFocus ? Colors.palette.m3primary : Colors.palette.m3outline)
|
||||||
|
strokeWidth: root.activeFocus ? 2 : 1
|
||||||
|
|
||||||
|
Behavior on outlineGapScale {
|
||||||
|
Anim {
|
||||||
|
type: Anim.DefaultEffects
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on strokeColor {
|
||||||
|
CAnim {}
|
||||||
|
}
|
||||||
|
Behavior on strokeWidth {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
|
|
||||||
|
PathLine {
|
||||||
|
x: bg.width - path.inset - root.clampedRadius
|
||||||
|
y: path.inset
|
||||||
|
}
|
||||||
|
|
||||||
|
PathArc {
|
||||||
|
radiusX: root.clampedRadius
|
||||||
|
radiusY: root.clampedRadius
|
||||||
|
x: bg.width - path.inset
|
||||||
|
y: path.inset + root.clampedRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
PathLine {
|
||||||
|
x: bg.width - path.inset
|
||||||
|
y: bg.height - path.inset - root.clampedRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
PathArc {
|
||||||
|
radiusX: root.clampedRadius
|
||||||
|
radiusY: root.clampedRadius
|
||||||
|
x: bg.width - path.inset - root.clampedRadius
|
||||||
|
y: bg.height - path.inset
|
||||||
|
}
|
||||||
|
|
||||||
|
PathLine {
|
||||||
|
x: path.inset + root.clampedRadius
|
||||||
|
y: bg.height - path.inset
|
||||||
|
}
|
||||||
|
|
||||||
|
PathArc {
|
||||||
|
radiusX: root.clampedRadius
|
||||||
|
radiusY: root.clampedRadius
|
||||||
|
x: path.inset
|
||||||
|
y: bg.height - path.inset - root.clampedRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
PathLine {
|
||||||
|
x: path.inset
|
||||||
|
y: path.inset + root.clampedRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
PathArc {
|
||||||
|
radiusX: root.clampedRadius
|
||||||
|
radiusY: root.clampedRadius
|
||||||
|
x: path.inset + root.clampedRadius
|
||||||
|
y: path.inset
|
||||||
|
}
|
||||||
|
|
||||||
|
PathLine {
|
||||||
|
x: path.inset + root.horizontalPadding - root.clampedRadius / 2 + path.outlineGap * (1 - path.outlineGapScale) / 2
|
||||||
|
y: path.inset
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: filledComp
|
||||||
|
|
||||||
|
CustomRect {
|
||||||
|
color: root.activeFocus ? Colors.tPalette.m3surfaceContainerHighest : Colors.tPalette.m3surfaceContainerHigh
|
||||||
|
topLeftRadius: root.clampedRadius
|
||||||
|
topRightRadius: root.clampedRadius
|
||||||
|
|
||||||
|
CustomRect {
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
color: root.isError ? Colors.palette.m3error : (root.activeFocus ? Colors.palette.m3primary : Colors.palette.m3outline)
|
||||||
|
implicitHeight: root.activeFocus ? 2 : 1
|
||||||
|
|
||||||
|
Behavior on implicitHeight {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
TextInput {
|
TextInput {
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
selectedTextColor: Colors.palette.m3onSecondaryContainer
|
selectedTextColor: Colors.palette.m3onSecondaryContainer
|
||||||
selectionColor: Colors.tPalette.m3onSecondaryContainer
|
selectionColor: Colors.tPalette.colSecondaryContainer
|
||||||
|
|
||||||
font {
|
font {
|
||||||
family: Config.appearance?.font.family.sans ?? "sans-serif"
|
family: Config.appearance?.font.family.sans ?? "sans-serif"
|
||||||
hintingPreference: Font.PreferFullHinting
|
hintingPreference: Font.PreferFullHinting
|
||||||
pixelSize: Tokens?.font.size.normal ?? 15
|
pixelSize: Config.appearance?.font.size.normal ?? 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import ZShell.Config
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property int fadeInAnim: Anim.DefaultEffects
|
||||||
|
property int fadeInLargeAnim: Anim.StandardLarge
|
||||||
|
property int fadeOutAnim: Anim.FastEffects
|
||||||
|
property bool fadingOut
|
||||||
|
property bool hadPrevious
|
||||||
|
property bool preventInit
|
||||||
|
|
||||||
|
function maybeStartInAnim(): void {
|
||||||
|
if (!preventInit && !opacityInAnim.running && status === Image.Ready) {
|
||||||
|
opacityInAnim.type = hadPrevious ? fadeInAnim : fadeInLargeAnim;
|
||||||
|
opacityInAnim.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
asynchronous: true
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
opacity: 0
|
||||||
|
retainWhileLoading: true
|
||||||
|
sourceSize: {
|
||||||
|
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
|
||||||
|
return Qt.size(width * dpr, height * dpr);
|
||||||
|
}
|
||||||
|
|
||||||
|
Anim on opacity {
|
||||||
|
id: opacityInAnim
|
||||||
|
|
||||||
|
running: false
|
||||||
|
to: 1
|
||||||
|
}
|
||||||
|
Behavior on source {
|
||||||
|
SequentialAnimation {
|
||||||
|
ScriptAction {
|
||||||
|
script: opacityInAnim.stop()
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyAction {
|
||||||
|
property: "fadingOut"
|
||||||
|
target: root
|
||||||
|
value: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Anim {
|
||||||
|
property: "opacity"
|
||||||
|
target: root
|
||||||
|
to: 0
|
||||||
|
type: root.fadeOutAnim
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyAction {
|
||||||
|
property: "fadingOut"
|
||||||
|
target: root
|
||||||
|
value: false
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyAction {
|
||||||
|
property: "hadPrevious"
|
||||||
|
target: root
|
||||||
|
value: root.source
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyAction {
|
||||||
|
}
|
||||||
|
|
||||||
|
ScriptAction {
|
||||||
|
script: root.maybeStartInAnim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onPreventInitChanged: maybeStartInAnim()
|
||||||
|
onStatusChanged: maybeStartInAnim()
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import M3Shapes
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
|
||||||
|
MaterialShape {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property bool animated: true
|
||||||
|
property real cRotation
|
||||||
|
property bool containsIcon
|
||||||
|
property real dampingRatio: 0.6
|
||||||
|
property real lRotation
|
||||||
|
property int morphAnimRotation: 60
|
||||||
|
property real morphScale: 0.14
|
||||||
|
property alias rotateAnimDuration: rotateAnim.duration
|
||||||
|
property int shapeIndex
|
||||||
|
property list<int> shapes: {
|
||||||
|
if (containsIcon)
|
||||||
|
return [MaterialShape.SoftBurst, MaterialShape.Cookie9Sided, MaterialShape.Pill, MaterialShape.Sunny, MaterialShape.Cookie4Sided, MaterialShape.Oval];
|
||||||
|
return [MaterialShape.SoftBurst, MaterialShape.Cookie9Sided, MaterialShape.Pentagon, MaterialShape.Pill, MaterialShape.Sunny, MaterialShape.Cookie4Sided, MaterialShape.Oval];
|
||||||
|
}
|
||||||
|
readonly property real springDuration: {
|
||||||
|
const wn = Math.sqrt(stiffness);
|
||||||
|
const r = -dampingRatio * wn;
|
||||||
|
const c = 1 / Math.sqrt(1 - dampingRatio * dampingRatio);
|
||||||
|
return Math.log(visibilityThreshold / c) / r;
|
||||||
|
}
|
||||||
|
readonly property real springMaxVelocity: {
|
||||||
|
const wn = Math.sqrt(stiffness);
|
||||||
|
const factor = Math.exp(-z * Math.acos(z) / Math.sqrt(1 - z * z));
|
||||||
|
return wn * factor;
|
||||||
|
}
|
||||||
|
property bool springSettled: true
|
||||||
|
property real stiffness: 180
|
||||||
|
property real thisLRotation
|
||||||
|
property real visibilityThreshold: 0.075
|
||||||
|
|
||||||
|
function spring(t: real): var {
|
||||||
|
const wn = Math.sqrt(stiffness);
|
||||||
|
const za = dampingRatio * wn;
|
||||||
|
|
||||||
|
const wd = wn * Math.sqrt(1 - dampingRatio * dampingRatio);
|
||||||
|
const r = za / wd;
|
||||||
|
const pos = 1 - Math.exp(-za * t) * (Math.cos(wd * t) + r * Math.sin(wd * t));
|
||||||
|
const vel = Math.exp(-za * t) * (wn * wn / wd) * Math.sin(wd * t);
|
||||||
|
|
||||||
|
return [pos, vel];
|
||||||
|
}
|
||||||
|
|
||||||
|
color: Colors.palette.m3primary
|
||||||
|
implicitSize: 38
|
||||||
|
toShape: shapes[0]
|
||||||
|
|
||||||
|
RotationAnimation on cRotation {
|
||||||
|
id: rotateAnim
|
||||||
|
|
||||||
|
duration: 4666
|
||||||
|
easing.type: Easing.Linear
|
||||||
|
from: 0
|
||||||
|
loops: Animation.Infinite
|
||||||
|
running: root.animated
|
||||||
|
to: 360
|
||||||
|
}
|
||||||
|
Behavior on color {
|
||||||
|
CAnim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ElapsedTimer {
|
||||||
|
id: timer
|
||||||
|
}
|
||||||
|
|
||||||
|
FrameAnimation {
|
||||||
|
running: root.animated && !root.springSettled
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
const t = timer.elapsed();
|
||||||
|
|
||||||
|
if (t >= root.springDuration) {
|
||||||
|
root.springSettled = true;
|
||||||
|
} else {
|
||||||
|
const [pos, vel] = root.spring(t);
|
||||||
|
root.morphProgress = Math.min(1, pos); // Overshooting the morph looks weird
|
||||||
|
root.thisLRotation = pos * root.morphAnimRotation;
|
||||||
|
root.scale = 1 + vel * root.morphScale / root.springMaxVelocity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 650
|
||||||
|
repeat: true
|
||||||
|
running: root.animated
|
||||||
|
triggeredOnStart: true
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
root.beginBatchUpdate();
|
||||||
|
root.fromShape = root.toShape;
|
||||||
|
root.shapeIndex = (root.shapeIndex + 1) % root.shapes.length;
|
||||||
|
root.toShape = root.shapes[root.shapeIndex];
|
||||||
|
root.morphProgress = 0;
|
||||||
|
|
||||||
|
root.rotation = root.rotation;
|
||||||
|
root.lRotation = (root.lRotation + root.thisLRotation) % 360;
|
||||||
|
root.thisLRotation = 0;
|
||||||
|
root.rotation = Qt.binding(() => root.cRotation + root.lRotation + root.thisLRotation);
|
||||||
|
|
||||||
|
root.springSettled = false;
|
||||||
|
timer.restart();
|
||||||
|
root.endBatchUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,14 @@
|
|||||||
|
import QtQuick
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
property real fill
|
id: root
|
||||||
property int grade: Colors.light ? 0 : -25
|
|
||||||
|
|
||||||
font.family: "Material Symbols Rounded"
|
property real fill: 0
|
||||||
font.pointSize: Tokens.font.size.larger
|
property int grade: Colors.light ? 0 : -25
|
||||||
font.variableAxes: ({
|
property font fontStyle: Tokens.font.icon.small
|
||||||
FILL: fill.toFixed(1),
|
|
||||||
GRAD: grade,
|
renderType: Text.NativeRendering
|
||||||
opsz: fontInfo.pixelSize,
|
font: Tokens.font.icon.size(fontStyle.pointSize).weight(fontStyle.weight).vaxes(fontStyle.variableAxes).fill(fill.toFixed(1)).grade(grade).build()
|
||||||
wght: fontInfo.weight
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Shapes
|
import QtQuick.Shapes
|
||||||
import ZShell
|
import ZShell
|
||||||
import ZShell.Components
|
|
||||||
import qs.Helpers
|
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
@@ -13,7 +11,6 @@ MouseArea {
|
|||||||
property alias bottomRightRadius: base.bottomRightRadius
|
property alias bottomRightRadius: base.bottomRightRadius
|
||||||
property real circleRadius
|
property real circleRadius
|
||||||
property alias color: base.color
|
property alias color: base.color
|
||||||
property bool disabled
|
|
||||||
readonly property real endRadius: {
|
readonly property real endRadius: {
|
||||||
const d1 = distSq(0, 0);
|
const d1 = distSq(0, 0);
|
||||||
const d2 = distSq(width, 0);
|
const d2 = distSq(width, 0);
|
||||||
@@ -22,6 +19,7 @@ MouseArea {
|
|||||||
return (Math.sqrt(Math.max(d1, d2, d3, d4)) + (shapeMorph ? 24 : 0)) * 1.3;
|
return (Math.sqrt(Math.max(d1, d2, d3, d4)) + (shapeMorph ? 24 : 0)) * 1.3;
|
||||||
}
|
}
|
||||||
property real endRadiusAtPress
|
property real endRadiusAtPress
|
||||||
|
property bool manualHoverOverride
|
||||||
property bool manualPressOverride
|
property bool manualPressOverride
|
||||||
property real pressX: width / 2
|
property real pressX: width / 2
|
||||||
property real pressY: height / 2
|
property real pressY: height / 2
|
||||||
@@ -29,7 +27,7 @@ MouseArea {
|
|||||||
readonly property alias rect: base
|
readonly property alias rect: base
|
||||||
property bool shapeMorph
|
property bool shapeMorph
|
||||||
property bool showHoverBackground: true
|
property bool showHoverBackground: true
|
||||||
property real stateOpacity: containsMouse ? 0.08 : 0
|
property real stateOpacity: containsMouse || manualHoverOverride ? 0.08 : 0
|
||||||
property alias topLeftRadius: base.topLeftRadius
|
property alias topLeftRadius: base.topLeftRadius
|
||||||
property alias topRightRadius: base.topRightRadius
|
property alias topRightRadius: base.topRightRadius
|
||||||
|
|
||||||
@@ -52,8 +50,8 @@ MouseArea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: disabled ? undefined : Qt.PointingHandCursor
|
cursorShape: !enabled ? undefined : Qt.PointingHandCursor
|
||||||
enabled: !disabled
|
enabled: parent.enabled
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
Behavior on stateOpacity {
|
Behavior on stateOpacity {
|
||||||
@@ -100,13 +98,13 @@ MouseArea {
|
|||||||
id: base
|
id: base
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
bottomLeftRadius: root.parent?.bottomLeftRadius ?? radius ?? 0
|
|
||||||
bottomRightRadius: root.parent?.bottomRightRadius ?? radius ?? 0
|
|
||||||
color: Colors.palette.m3onSurface
|
color: Colors.palette.m3onSurface
|
||||||
opacity: root.stateOpacity
|
opacity: root.stateOpacity
|
||||||
// Pick up radius from parent if it has one (parent can be anything with radius props)
|
// Pick up radius from parent if it has one (parent can be anything with radius props)
|
||||||
// qmllint disable missing-property
|
// qmllint disable missing-property
|
||||||
radius: root.parent?.radius ?? 0
|
radius: root.parent?.radius ?? 0
|
||||||
|
bottomLeftRadius: root.parent?.bottomLeftRadius ?? radius ?? 0
|
||||||
|
bottomRightRadius: root.parent?.bottomRightRadius ?? radius ?? 0
|
||||||
topLeftRadius: root.parent?.topLeftRadius ?? radius ?? 0
|
topLeftRadius: root.parent?.topLeftRadius ?? radius ?? 0
|
||||||
topRightRadius: root.parent?.topRightRadius ?? radius ?? 0
|
topRightRadius: root.parent?.topRightRadius ?? radius ?? 0
|
||||||
// qmllint enable missing-property
|
// qmllint enable missing-property
|
||||||
|
|||||||
+16
-39
@@ -13,34 +13,16 @@ RowLayout {
|
|||||||
|
|
||||||
spacing: Tokens.spacing.largeIncreased * 2
|
spacing: Tokens.spacing.largeIncreased * 2
|
||||||
|
|
||||||
ColumnLayout {
|
CustomRect {
|
||||||
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: Tokens.spacing.medium
|
topLeftRadius: Tokens.rounding.largeIncreased
|
||||||
|
bottomLeftRadius: Tokens.rounding.largeIncreased
|
||||||
|
color: Colors.tPalette.m3surfaceContainer
|
||||||
|
radius: Tokens.rounding.small
|
||||||
|
|
||||||
CustomRect {
|
UserDock {
|
||||||
Layout.fillWidth: true
|
greeter: root.greeter
|
||||||
color: Colors.tPalette.m3surfaceContainer
|
|
||||||
implicitHeight: weather.implicitHeight
|
|
||||||
radius: Tokens.rounding.small
|
|
||||||
topLeftRadius: Tokens.rounding.largeIncreased
|
|
||||||
|
|
||||||
WeatherInfo {
|
|
||||||
id: weather
|
|
||||||
|
|
||||||
rootHeight: root.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomClippingRect {
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
bottomLeftRadius: Tokens.rounding.largeIncreased
|
|
||||||
color: Colors.tPalette.m3surfaceContainer
|
|
||||||
radius: Tokens.rounding.small
|
|
||||||
|
|
||||||
UserDock {
|
|
||||||
greeter: root.greeter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,21 +31,16 @@ RowLayout {
|
|||||||
screenHeight: root.screenHeight
|
screenHeight: root.screenHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
CustomRect {
|
||||||
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: Tokens.spacing.medium
|
bottomRightRadius: Tokens.rounding.largeIncreased
|
||||||
|
color: Colors.tPalette.m3surfaceContainer
|
||||||
|
radius: Tokens.rounding.small
|
||||||
|
topRightRadius: Tokens.rounding.largeIncreased
|
||||||
|
|
||||||
CustomRect {
|
SessionDock {
|
||||||
Layout.fillHeight: true
|
greeter: root.greeter
|
||||||
Layout.fillWidth: true
|
|
||||||
bottomRightRadius: Tokens.rounding.largeIncreased
|
|
||||||
color: Colors.tPalette.m3surfaceContainer
|
|
||||||
radius: Tokens.rounding.small
|
|
||||||
topRightRadius: Tokens.rounding.largeIncreased
|
|
||||||
|
|
||||||
SessionDock {
|
|
||||||
greeter: root.greeter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,8 +134,7 @@ Scope {
|
|||||||
id: lockIcon
|
id: lockIcon
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.bold: true
|
fontStyle: Tokens.font.icon.builders.extraLarge.size(Tokens.font.icon.extraLarge.pointSize * 3).build()
|
||||||
font.pointSize: Tokens.font.size.extraLarge * 4
|
|
||||||
text: "lock"
|
text: "lock"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-15
@@ -39,8 +39,7 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
animate: true
|
animate: true
|
||||||
color: root.greeter.launching ? Colors.palette.m3secondary : Colors.palette.m3outline
|
color: root.greeter.launching ? Colors.palette.m3secondary : Colors.palette.m3outline
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.mono.medium
|
||||||
font.pointSize: Tokens.font.size.normal
|
|
||||||
opacity: root.buffer ? 0 : 1
|
opacity: root.buffer ? 0 : 1
|
||||||
text: {
|
text: {
|
||||||
if (root.greeter.launching)
|
if (root.greeter.launching)
|
||||||
@@ -51,8 +50,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,15 +62,13 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
color: Colors.palette.m3onSurface
|
color: Colors.palette.m3onSurface
|
||||||
elide: Text.ElideLeft
|
elide: Text.ElideLeft
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.mono.medium
|
||||||
font.pointSize: Tokens.font.size.normal
|
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
opacity: root.greeter.echoResponse && root.buffer ? 1 : 0
|
opacity: root.greeter.echoResponse && root.buffer ? 1 : 0
|
||||||
text: root.buffer
|
text: root.buffer
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +85,7 @@ Item {
|
|||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
anchors.horizontalCenterOffset: implicitWidth > root.width ? -(implicitWidth - root.width) / 2 : 0
|
anchors.horizontalCenterOffset: implicitWidth > root.width ? -(implicitWidth - root.width) / 2 : 0
|
||||||
implicitHeight: Tokens.font.size.normal
|
implicitHeight: Tokens.font.body.medium
|
||||||
implicitWidth: fullWidth
|
implicitWidth: fullWidth
|
||||||
interactive: false
|
interactive: false
|
||||||
opacity: root.greeter.echoResponse ? 0 : 1
|
opacity: root.greeter.echoResponse ? 0 : 1
|
||||||
@@ -107,8 +103,7 @@ Item {
|
|||||||
scale: 0
|
scale: 0
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -156,15 +151,13 @@ Item {
|
|||||||
Behavior on implicitWidth {
|
Behavior on implicitWidth {
|
||||||
id: imWidthBehavior
|
id: imWidthBehavior
|
||||||
|
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: root.buffer.split("")
|
values: root.buffer.split("")
|
||||||
}
|
}
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-17
@@ -13,22 +13,19 @@ ColumnLayout {
|
|||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Tokens.padding.large
|
anchors.margins: Tokens.padding.large
|
||||||
spacing: Tokens.spacing.small
|
spacing: Tokens.spacing.large
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: Colors.palette.m3outline
|
color: Colors.palette.m3outline
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.mono.builders.small.weight(Font.Medium).build()
|
||||||
font.weight: 500
|
|
||||||
text: root.greeter.sessions.length > 0 ? qsTr("%1 session%2").arg(root.greeter.sessions.length).arg(root.greeter.sessions.length === 1 ? "" : "s") : qsTr("Sessions")
|
text: root.greeter.sessions.length > 0 ? qsTr("%1 session%2").arg(root.greeter.sessions.length).arg(root.greeter.sessions.length === 1 ? "" : "s") : qsTr("Sessions")
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: "transparent"
|
|
||||||
radius: Tokens.rounding.small
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: opacity > 0
|
active: opacity > 0
|
||||||
@@ -46,16 +43,14 @@ ColumnLayout {
|
|||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: Colors.palette.m3outlineVariant
|
color: Colors.palette.m3outlineVariant
|
||||||
font.pointSize: Tokens.font.size.extraLarge * 2
|
fontStyle: Tokens.font.icon.large
|
||||||
text: "desktop_windows"
|
text: "desktop_windows"
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: Colors.palette.m3outlineVariant
|
color: Colors.palette.m3outlineVariant
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.headline.builders.small.width(90).build()
|
||||||
font.pointSize: Tokens.font.size.large
|
|
||||||
font.weight: 500
|
|
||||||
text: qsTr("No Sessions Found")
|
text: qsTr("No Sessions Found")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,6 +63,7 @@ ColumnLayout {
|
|||||||
clip: true
|
clip: true
|
||||||
currentIndex: root.greeter.sessionIndex
|
currentIndex: root.greeter.sessionIndex
|
||||||
highlightFollowsCurrentItem: false
|
highlightFollowsCurrentItem: false
|
||||||
|
boundsBehavior: ListView.StopAtBounds
|
||||||
model: root.greeter.sessions
|
model: root.greeter.sessions
|
||||||
spacing: Tokens.spacing.small
|
spacing: Tokens.spacing.small
|
||||||
|
|
||||||
@@ -80,7 +76,7 @@ ColumnLayout {
|
|||||||
anchors.left: parent?.left
|
anchors.left: parent?.left
|
||||||
anchors.right: parent?.right
|
anchors.right: parent?.right
|
||||||
implicitHeight: row.implicitHeight + Tokens.padding.small * 2
|
implicitHeight: row.implicitHeight + Tokens.padding.small * 2
|
||||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
radius: Tokens.rounding.large
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@@ -97,7 +93,7 @@ ColumnLayout {
|
|||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
color: session.index === sessions.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurfaceVariant
|
color: session.index === sessions.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Tokens.font.size.extraLarge
|
fontStyle: Tokens.font.icon.extraLarge
|
||||||
text: modelData.kind === "x11" ? "tv" : "desktop_windows"
|
text: modelData.kind === "x11" ? "tv" : "desktop_windows"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,8 +105,7 @@ ColumnLayout {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: session.index === sessions.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
color: session.index === sessions.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.pointSize: Tokens.font.size.normal
|
font: Tokens.font.body.builders.medium.weight(Font.Bold).build()
|
||||||
font.weight: 600
|
|
||||||
text: modelData.name
|
text: modelData.name
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +113,7 @@ ColumnLayout {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: session.index === sessions.currentIndex ? Colors.palette.m3onPrimaryFixedVariant : Colors.palette.m3onSurfaceVariant
|
color: session.index === sessions.currentIndex ? Colors.palette.m3onPrimaryFixedVariant : Colors.palette.m3onSurfaceVariant
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.mono.small
|
||||||
font.pointSize: Tokens.font.size.small
|
|
||||||
text: modelData.kind
|
text: modelData.kind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,7 +123,7 @@ ColumnLayout {
|
|||||||
color: Colors.palette.m3primary
|
color: Colors.palette.m3primary
|
||||||
implicitHeight: sessions.currentItem?.implicitHeight ?? 0
|
implicitHeight: sessions.currentItem?.implicitHeight ?? 0
|
||||||
implicitWidth: sessions.width
|
implicitWidth: sessions.width
|
||||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
radius: Tokens.rounding.large
|
||||||
y: sessions.currentItem?.y ?? 0
|
y: sessions.currentItem?.y ?? 0
|
||||||
|
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
|
|||||||
+11
-16
@@ -14,22 +14,19 @@ ColumnLayout {
|
|||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Tokens.padding.large
|
anchors.margins: Tokens.padding.large
|
||||||
spacing: Tokens.spacing.small
|
spacing: Tokens.spacing.large
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: Colors.palette.m3outline
|
color: Colors.palette.m3outline
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.mono.builders.small.weight(Font.Medium).build()
|
||||||
font.weight: 500
|
|
||||||
text: root.greeter.users.length > 0 ? qsTr("%1 user%2").arg(root.greeter.users.length).arg(root.greeter.users.length === 1 ? "" : "s") : qsTr("Users")
|
text: root.greeter.users.length > 0 ? qsTr("%1 user%2").arg(root.greeter.users.length).arg(root.greeter.users.length === 1 ? "" : "s") : qsTr("Users")
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: "transparent"
|
|
||||||
radius: Tokens.rounding.small
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: opacity > 0
|
active: opacity > 0
|
||||||
@@ -48,16 +45,14 @@ ColumnLayout {
|
|||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: Colors.palette.m3outlineVariant
|
color: Colors.palette.m3outlineVariant
|
||||||
fill: 1
|
fill: 1
|
||||||
font.pointSize: Tokens.font.size.extraLarge * 2
|
fontStyle: Tokens.font.icon.large
|
||||||
text: "account_circle"
|
text: "account_circle"
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: Colors.palette.m3outlineVariant
|
color: Colors.palette.m3outlineVariant
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.headline.builders.small.width(90).build()
|
||||||
font.pointSize: Tokens.font.size.large
|
|
||||||
font.weight: 500
|
|
||||||
text: qsTr("No Users Found")
|
text: qsTr("No Users Found")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,6 +65,7 @@ ColumnLayout {
|
|||||||
clip: true
|
clip: true
|
||||||
currentIndex: root.greeter.selectedUser ? root.greeter.users.indexOf(root.greeter.selectedUser) : -1
|
currentIndex: root.greeter.selectedUser ? root.greeter.users.indexOf(root.greeter.selectedUser) : -1
|
||||||
highlightFollowsCurrentItem: false
|
highlightFollowsCurrentItem: false
|
||||||
|
boundsBehavior: ListView.StopAtBounds
|
||||||
model: root.greeter.users
|
model: root.greeter.users
|
||||||
spacing: Tokens.spacing.small
|
spacing: Tokens.spacing.small
|
||||||
|
|
||||||
@@ -82,7 +78,7 @@ ColumnLayout {
|
|||||||
anchors.left: parent?.left
|
anchors.left: parent?.left
|
||||||
anchors.right: parent?.right
|
anchors.right: parent?.right
|
||||||
implicitHeight: row.implicitHeight + Tokens.padding.small * 2
|
implicitHeight: row.implicitHeight + Tokens.padding.small * 2
|
||||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
radius: Tokens.rounding.large
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@@ -97,7 +93,7 @@ ColumnLayout {
|
|||||||
anchors.margins: Tokens.padding.small
|
anchors.margins: Tokens.padding.small
|
||||||
spacing: Tokens.spacing.medium
|
spacing: Tokens.spacing.medium
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
Layout.preferredHeight: 50
|
Layout.preferredHeight: 50
|
||||||
Layout.preferredWidth: 50
|
Layout.preferredWidth: 50
|
||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
@@ -106,7 +102,7 @@ ColumnLayout {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: user.index === users.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurfaceVariant
|
color: user.index === users.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurfaceVariant
|
||||||
fill: 1
|
fill: 1
|
||||||
font.pointSize: Tokens.font.size.extraLarge
|
fontStyle: Tokens.font.icon.extraLarge
|
||||||
text: modelData.kind === "x11" ? "tv" : "account_circle"
|
text: modelData.kind === "x11" ? "tv" : "account_circle"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,8 +120,7 @@ ColumnLayout {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: user.index === users.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
color: user.index === users.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.pointSize: Tokens.font.size.normal
|
font: Tokens.font.body.builders.medium.weight(Font.Bold).build()
|
||||||
font.weight: 600
|
|
||||||
text: modelData.username
|
text: modelData.username
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,7 +130,7 @@ ColumnLayout {
|
|||||||
color: Colors.palette.m3primary
|
color: Colors.palette.m3primary
|
||||||
implicitHeight: users.currentItem?.implicitHeight ?? 0
|
implicitHeight: users.currentItem?.implicitHeight ?? 0
|
||||||
implicitWidth: users.width
|
implicitWidth: users.width
|
||||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
radius: Tokens.rounding.large
|
||||||
y: users.currentItem?.y ?? 0
|
y: users.currentItem?.y ?? 0
|
||||||
|
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
|
|||||||
@@ -1,171 +0,0 @@
|
|||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import ZShell.Config
|
|
||||||
import qs.Components
|
|
||||||
import qs.Helpers
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
required property int rootHeight
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.margins: Tokens.padding.large * 2
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
Layout.bottomMargin: -Tokens.padding.large
|
|
||||||
Layout.topMargin: Tokens.padding.large * 2
|
|
||||||
active: root.rootHeight > 610
|
|
||||||
visible: active
|
|
||||||
|
|
||||||
sourceComponent: CustomText {
|
|
||||||
color: Colors.palette.m3primary
|
|
||||||
font.pointSize: Tokens.font.size.extraLarge
|
|
||||||
font.weight: 500
|
|
||||||
text: qsTr("Weather")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: Tokens.spacing.largeIncreased
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
animate: true
|
|
||||||
color: Colors.palette.m3secondary
|
|
||||||
font.pointSize: Tokens.font.size.extraLarge * 2.5
|
|
||||||
text: Weather.icon
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
animate: true
|
|
||||||
color: Colors.palette.m3secondary
|
|
||||||
elide: Text.ElideRight
|
|
||||||
font.pointSize: Tokens.font.size.large
|
|
||||||
font.weight: 500
|
|
||||||
text: Weather.description
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
animate: true
|
|
||||||
color: Colors.palette.m3onSurfaceVariant
|
|
||||||
elide: Text.ElideRight
|
|
||||||
font.pointSize: Tokens.font.size.normal
|
|
||||||
text: qsTr("Humidity: %1%").arg(Weather.humidity)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
Layout.rightMargin: Tokens.padding.small
|
|
||||||
active: root.width > 400
|
|
||||||
visible: active
|
|
||||||
|
|
||||||
sourceComponent: ColumnLayout {
|
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
animate: true
|
|
||||||
color: Colors.palette.m3primary
|
|
||||||
elide: Text.ElideLeft
|
|
||||||
font.pointSize: Tokens.font.size.extraLarge
|
|
||||||
font.weight: 500
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
text: Weather.temp
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
animate: true
|
|
||||||
color: Colors.palette.m3outline
|
|
||||||
elide: Text.ElideLeft
|
|
||||||
font.pointSize: Tokens.font.size.smaller
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
text: qsTr("Feels like: %1").arg(Weather.feelsLike)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: forecastLoader
|
|
||||||
|
|
||||||
Layout.bottomMargin: Tokens.padding.large * 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: Tokens.spacing.small
|
|
||||||
active: root.rootHeight > 820
|
|
||||||
visible: active
|
|
||||||
|
|
||||||
sourceComponent: RowLayout {
|
|
||||||
spacing: Tokens.spacing.largeIncreased
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: {
|
|
||||||
const forecast = Weather.hourlyForecast;
|
|
||||||
const count = root.width < 320 ? 3 : root.width < 400 ? 4 : 5;
|
|
||||||
if (!forecast)
|
|
||||||
return Array.from({
|
|
||||||
length: count
|
|
||||||
}, () => null);
|
|
||||||
|
|
||||||
const start = Math.max(0, Weather.currentHourIndex);
|
|
||||||
return forecast.slice(start, start + count);
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: forecastHour
|
|
||||||
|
|
||||||
required property var modelData
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
color: Colors.palette.m3outline
|
|
||||||
font.pointSize: Tokens.font.size.larger
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
text: {
|
|
||||||
const hour = forecastHour.modelData?.hour ?? 0;
|
|
||||||
return hour > 12 ? `${(hour - 12).toString().padStart(2, "0")} PM` : `${hour.toString().padStart(2, "0")} AM`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
font.pointSize: Tokens.font.size.extraLarge * 1.5
|
|
||||||
font.weight: 500
|
|
||||||
text: forecastHour.modelData?.icon ?? "cloud_alert"
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
color: Colors.palette.m3secondary
|
|
||||||
font.pointSize: Tokens.font.size.larger
|
|
||||||
text: Config.services.useFahrenheit ? `${forecastHour.modelData?.tempF ?? 0}°F` : `${forecastHour.modelData?.tempC ?? 0}°C`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
interval: 900000 // 15 minutes
|
|
||||||
repeat: true
|
|
||||||
running: true
|
|
||||||
triggeredOnStart: true
|
|
||||||
|
|
||||||
onTriggered: Weather.reload()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Hyprland
|
|
||||||
import ZShell
|
|
||||||
import qs.Components
|
|
||||||
|
|
||||||
Scope {
|
|
||||||
LazyLoader {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool closing
|
|
||||||
property bool freeze
|
|
||||||
|
|
||||||
Variants {
|
|
||||||
model: Quickshell.screens
|
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: win
|
|
||||||
|
|
||||||
required property ShellScreen modelData
|
|
||||||
|
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
|
||||||
WlrLayershell.keyboardFocus: root.closing ? WlrKeyboardFocus.None : WlrKeyboardFocus.Exclusive
|
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
|
||||||
WlrLayershell.namespace: "areapicker"
|
|
||||||
color: "transparent"
|
|
||||||
mask: root.closing ? empty : null
|
|
||||||
screen: modelData
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
bottom: true
|
|
||||||
left: true
|
|
||||||
right: true
|
|
||||||
top: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Region {
|
|
||||||
id: empty
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Picker {
|
|
||||||
loader: root
|
|
||||||
screen: win.modelData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
function open(): void {
|
|
||||||
root.freeze = false;
|
|
||||||
root.closing = false;
|
|
||||||
root.activeAsync = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function openFreeze(): void {
|
|
||||||
root.freeze = true;
|
|
||||||
root.closing = false;
|
|
||||||
root.activeAsync = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "picker"
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomShortcut {
|
|
||||||
name: "screenshot"
|
|
||||||
|
|
||||||
onPressed: {
|
|
||||||
root.freeze = false;
|
|
||||||
root.closing = false;
|
|
||||||
root.activeAsync = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomShortcut {
|
|
||||||
name: "screenshotFreeze"
|
|
||||||
|
|
||||||
onPressed: {
|
|
||||||
root.freeze = true;
|
|
||||||
root.closing = false;
|
|
||||||
root.activeAsync = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -77,16 +77,6 @@ Singleton {
|
|||||||
"99": "thunderstorm"
|
"99": "thunderstorm"
|
||||||
})
|
})
|
||||||
|
|
||||||
function getAppCategoryIcon(name: string, fallback: string): string {
|
|
||||||
const categories = DesktopEntries.heuristicLookup(name)?.categories;
|
|
||||||
|
|
||||||
if (categories)
|
|
||||||
for (const [key, value] of Object.entries(categoryIcons))
|
|
||||||
if (categories.includes(key))
|
|
||||||
return value;
|
|
||||||
return fallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAppIcon(name: string, fallback: string): string {
|
function getAppIcon(name: string, fallback: string): string {
|
||||||
const icon = DesktopEntries.heuristicLookup(name)?.icon;
|
const icon = DesktopEntries.heuristicLookup(name)?.icon;
|
||||||
if (fallback !== "undefined")
|
if (fallback !== "undefined")
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Networking
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property bool active: false
|
||||||
|
readonly property list<Network> connectedNetworks: networks.filter(n => n.connected)
|
||||||
|
property Network connectingNetwork
|
||||||
|
readonly property list<NetworkDevice> devices: Networking.devices.values
|
||||||
|
property Network failedNetwork
|
||||||
|
readonly property list<Network> knownNetworks: networks.filter(n => n.known && !n.connected)
|
||||||
|
readonly property list<Network> networks: {
|
||||||
|
const list = [];
|
||||||
|
for (const d of wifiDevices) {
|
||||||
|
for (const n of d.networks.values) {
|
||||||
|
if (!list.includes(n))
|
||||||
|
list.push(n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
property bool scanning: false
|
||||||
|
readonly property list<Network> unknownNetworks: networks.filter(n => !n.known)
|
||||||
|
readonly property list<WifiDevice> wifiDevices: devices.filter(d => wifiDevice(d))
|
||||||
|
readonly property bool wifiEnabled: Networking.wifiEnabled
|
||||||
|
|
||||||
|
signal networkConnected
|
||||||
|
|
||||||
|
function forgetNetwork(target): void {
|
||||||
|
if (!target) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
target.forget();
|
||||||
|
}
|
||||||
|
|
||||||
|
function isSecure(security): bool {
|
||||||
|
return (security === WifiSecurityType.WpaPsk || security === WifiSecurityType.Wpa2Psk || security === WifiSecurityType.Sae);
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestConnect(network: Network, secret = undefined): void {
|
||||||
|
connectingNetwork = network;
|
||||||
|
if (secret === undefined || secret === "") {
|
||||||
|
network.connect();
|
||||||
|
} else {
|
||||||
|
(network as WifiNetwork).connectWithPsk(secret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setScan(value: bool): void {
|
||||||
|
for (const d of wifiDevices) {
|
||||||
|
d.scannerEnabled = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setWifi(value: bool): void {
|
||||||
|
Networking.wifiEnabled = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function wifiDevice(dev): bool {
|
||||||
|
return dev.type === DeviceType.Wifi;
|
||||||
|
}
|
||||||
|
|
||||||
|
onActiveChanged: {
|
||||||
|
for (const d of wifiDevices)
|
||||||
|
d.scannerEnabled = active;
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: flushFailed
|
||||||
|
|
||||||
|
interval: 5000
|
||||||
|
running: root.failedNetwork
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
root.failedNetwork = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: checkConnection
|
||||||
|
|
||||||
|
interval: 500
|
||||||
|
repeat: true
|
||||||
|
running: root.connectingNetwork
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
var completedNetwork;
|
||||||
|
|
||||||
|
switch (root.connectingNetwork.state) {
|
||||||
|
case ConnectionState.Connecting:
|
||||||
|
break;
|
||||||
|
case ConnectionState.Connected:
|
||||||
|
completedNetwork = root.connectingNetwork;
|
||||||
|
root.networkConnected();
|
||||||
|
break;
|
||||||
|
case ConnectionState.Disconnected:
|
||||||
|
root.failedNetwork = root.connectingNetwork;
|
||||||
|
completedNetwork = root.connectingNetwork;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (completedNetwork) {
|
||||||
|
root.connectingNetwork = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 10000
|
||||||
|
running: checkConnection.running
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
root.failedNetwork = root.connectingNetwork;
|
||||||
|
root.connectingNetwork = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import QtQuick
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
import qs.Modules.Settings.Common
|
||||||
|
import qs.Modules.Bar.Popouts.Network
|
||||||
|
import qs.Components
|
||||||
|
import qs.Helpers
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
bottomPadding: Tokens.spacing.extraSmall
|
||||||
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
|
font.pointSize: Tokens.font.size.smaller
|
||||||
|
text: {
|
||||||
|
if (modelData.type === "known") {
|
||||||
|
const count = Network.knownNetworks.filter(n => !n.connected).length;
|
||||||
|
|
||||||
|
return qsTr("%1 known network%2").arg(count).arg(count === 1 ? "" : "s");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modelData.type === "unknown") {
|
||||||
|
const count = Network.unknownNetworks.filter(n => !n.connected).length;
|
||||||
|
|
||||||
|
return qsTr("%1 network%2 available").arg(count).arg(count === 1 ? "" : "s");
|
||||||
|
}
|
||||||
|
|
||||||
|
return qsTr("object unknown");
|
||||||
|
}
|
||||||
|
topPadding: Tokens.spacing.small
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Modules.Settings.Common
|
||||||
|
import qs.Modules.Bar.Popouts.Network
|
||||||
|
import qs.Components
|
||||||
|
import qs.Helpers
|
||||||
|
import qs.Helpers.Network
|
||||||
|
import qs.Services
|
||||||
|
|
||||||
|
ConnectedRect {
|
||||||
|
id: networkItem
|
||||||
|
|
||||||
|
readonly property int connectedCount: Network.connectedNetworks.length
|
||||||
|
readonly property bool connecting: Network.connectingNetwork === modelData
|
||||||
|
property int horizontalPadding: Tokens.padding.largeIncreased
|
||||||
|
readonly property bool inConnectedGroup: index < connectedCount
|
||||||
|
// sectioning first / last item in list reminder
|
||||||
|
// if index === network.connectedNetworks.length - 1
|
||||||
|
// if index === network.connectedNetworks.length - 1 + network.knownNetworks.length - 2
|
||||||
|
// if index === network.connectedNetworks.length - 1 + network.knownNetworks.length
|
||||||
|
// list.model.values.length - 1
|
||||||
|
required property int index
|
||||||
|
readonly property bool isSecure: Network.isSecure(modelData.security)
|
||||||
|
required property ListView list
|
||||||
|
required property var modelData
|
||||||
|
property int verticalPadding: Tokens.padding.smaller
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
first: !inConnectedGroup && index === connectedCount + 1
|
||||||
|
implicitHeight: rowLayout.implicitHeight + verticalPadding * 2
|
||||||
|
last: inConnectedGroup ? index === connectedCount - 1 : index === (list?.count ?? -1)
|
||||||
|
radius: Tokens.rounding.small
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: rowLayout
|
||||||
|
|
||||||
|
Layout.preferredHeight: visible ? rowLayout.implicitHeight + Tokens.padding.smaller * 2 : 0
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: networkItem.horizontalPadding
|
||||||
|
anchors.rightMargin: networkItem.horizontalPadding
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: column
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: Tokens.spacing.extraSmall
|
||||||
|
Layout.rightMargin: Tokens.spacing.extraSmall
|
||||||
|
color: networkItem.modelData.active ? Colors.palette.m3primary : Colors.palette.m3onSurface
|
||||||
|
elide: Text.ElideRight
|
||||||
|
text: networkItem.modelData.name ? networkItem.modelData.name : qsTr("Unknown Network")
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
id: subtext
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
color: Colors.palette.m3outline
|
||||||
|
elide: Text.ElideRight
|
||||||
|
font.pointSize: Tokens.font.size.small
|
||||||
|
text: networkItem.modelData.connected ? qsTr("Connected: %1 strength").arg(Math.round(networkItem.modelData.signalStrength * 100) + "%") : qsTr("%1 strength").arg(Math.round(networkItem.modelData.signalStrength * 100) + "%")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
implicitHeight: icon.height
|
||||||
|
implicitWidth: icon.width
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
id: icon
|
||||||
|
|
||||||
|
color: networkItem.modelData.active ? Colors.palette.m3primary : Colors.palette.m3onSurfaceVariant
|
||||||
|
font.pointSize: Tokens.font.size.large
|
||||||
|
opacity: networkItem.connecting ? 0 : 1
|
||||||
|
text: Icons.getNetworkIcon(networkItem.modelData.signalStrength * 100, networkItem.isSecure)
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: opacity > 0
|
||||||
|
anchors.fill: parent
|
||||||
|
opacity: networkItem.connecting ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sourceComponent: CircularIndicator {
|
||||||
|
bgColor: "transparent"
|
||||||
|
running: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StateLayer {
|
||||||
|
color: networkItem.modelData.active ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (networkItem.isSecure && !networkItem.known) {
|
||||||
|
PopupManager.requestOpen(Qt.resolvedUrl("../../Modules/Bar/Popouts/Network/PSKOverlay.qml"), {
|
||||||
|
network: networkItem.modelData
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Network.requestConnect(networkItem.modelData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
import qs.Components
|
||||||
|
import qs.Modules.Settings.Common
|
||||||
|
|
||||||
|
CustomSwitch {
|
||||||
|
id: toggleItem
|
||||||
|
|
||||||
|
readonly property alias bg: bg
|
||||||
|
property alias first: bg.first
|
||||||
|
property alias last: bg.last
|
||||||
|
property string subtext
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
cLayer: 2
|
||||||
|
horizontalPadding: Tokens.padding.largeIncreased
|
||||||
|
implicitHeight: Math.max(implicitContentHeight, implicitIndicatorHeight) + verticalPadding * 2
|
||||||
|
implicitWidth: implicitContentWidth + implicitIndicatorWidth + horizontalPadding * 2
|
||||||
|
indicator.anchors.right: right
|
||||||
|
indicator.anchors.rightMargin: toggleItem.horizontalPadding
|
||||||
|
indicator.anchors.verticalCenter: verticalCenter
|
||||||
|
verticalPadding: Tokens.padding.normal
|
||||||
|
|
||||||
|
background: ConnectedRect {
|
||||||
|
id: bg
|
||||||
|
|
||||||
|
StateLayer {
|
||||||
|
id: stateLayer
|
||||||
|
|
||||||
|
manualPressOverride: toggleItem.pressed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
contentItem: Item {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: toggleItem.horizontalPadding
|
||||||
|
anchors.right: toggleItem.indicator.left
|
||||||
|
anchors.rightMargin: Tokens.spacing.normal
|
||||||
|
implicitHeight: column.implicitHeight
|
||||||
|
implicitWidth: column.implicitWidth
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: column
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
id: label
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
elide: Text.ElideRight
|
||||||
|
font.pointSize: Tokens.font.size.smaller
|
||||||
|
text: toggleItem.text
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
id: subtext
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
color: Colors.palette.m3outline
|
||||||
|
elide: Text.ElideRight
|
||||||
|
font.pointSize: Tokens.font.size.small
|
||||||
|
text: toggleItem.subtext
|
||||||
|
visible: toggleItem.subtext
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onPressed: stateLayer.press(stateLayer.mouseX, stateLayer.mouseY)
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ Singleton {
|
|||||||
|
|
||||||
function toggleNightLight(): void {
|
function toggleNightLight(): void {
|
||||||
service.manualToggle = true;
|
service.manualToggle = true;
|
||||||
service.toggle();
|
service.toggle(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
NightlightManager {
|
NightlightManager {
|
||||||
|
|||||||
+82
-36
@@ -41,6 +41,7 @@ Item {
|
|||||||
property real rsy: Math.min(sy, ey)
|
property real rsy: Math.min(sy, ey)
|
||||||
readonly property real scaleRatio: Hypr.monitorFor(screen).scale
|
readonly property real scaleRatio: Hypr.monitorFor(screen).scale
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
|
required property ScreenState screenState
|
||||||
property real sh: Math.abs(sy - ey)
|
property real sh: Math.abs(sy - ey)
|
||||||
readonly property color shadowColor: Hypr.options.decoration.shadow?.color ?? "black"
|
readonly property color shadowColor: Hypr.options.decoration.shadow?.color ?? "black"
|
||||||
readonly property bool shadowEnabled: Hypr.options.decoration.shadow.enabled
|
readonly property bool shadowEnabled: Hypr.options.decoration.shadow.enabled
|
||||||
@@ -97,10 +98,6 @@ Item {
|
|||||||
const args = Config.screenshot.mode === "auto" ? ["--rounding", `${rounding}`, "--radius", root.cornerRadius, "--shadow", root.shadowEnabled, "--shadow-blur", `${shadow_blur}`, "--shadow-color", `${r},${g},${b},${a}`, "--shadow-offset-x", root.shadowOffset[0], "--shadow-offset-y", root.shadowOffset[1]] : [];
|
const args = Config.screenshot.mode === "auto" ? ["--rounding", `${rounding}`, "--radius", root.cornerRadius, "--shadow", root.shadowEnabled, "--shadow-blur", `${shadow_blur}`, "--shadow-color", `${r},${g},${b},${a}`, "--shadow-offset-x", root.shadowOffset[0], "--shadow-offset-y", root.shadowOffset[1]] : [];
|
||||||
const postCmd = Config.screenshot.enable_pp ? ["zshell-img-tools", "--scale", root.scaleRatio, ...args, "--image"] : null;
|
const postCmd = Config.screenshot.enable_pp ? ["zshell-img-tools", "--scale", root.scaleRatio, ...args, "--image"] : null;
|
||||||
|
|
||||||
overlay.visible = border.visible = false;
|
|
||||||
handles.visible = false;
|
|
||||||
toolbar.visible = false;
|
|
||||||
|
|
||||||
ZShellIo.saveItem(captureLayer, tmpfile, Qt.rect(Math.ceil(rsx), Math.ceil(rsy), Math.floor(sw), Math.floor(sh)), path => {
|
ZShellIo.saveItem(captureLayer, tmpfile, Qt.rect(Math.ceil(rsx), Math.ceil(rsy), Math.floor(sw), Math.floor(sh)), path => {
|
||||||
const finalize = finalPath => {
|
const finalize = finalPath => {
|
||||||
if (copyToClipboard) {
|
if (copyToClipboard) {
|
||||||
@@ -129,22 +126,22 @@ Item {
|
|||||||
Behavior on rsx {
|
Behavior on rsx {
|
||||||
enabled: !selectArea.pressed && root.mode === "select"
|
enabled: !selectArea.pressed && root.mode === "select"
|
||||||
|
|
||||||
ExAnim {}
|
Anim {}
|
||||||
}
|
}
|
||||||
Behavior on rsy {
|
Behavior on rsy {
|
||||||
enabled: !selectArea.pressed && root.mode === "select"
|
enabled: !selectArea.pressed && root.mode === "select"
|
||||||
|
|
||||||
ExAnim {}
|
Anim {}
|
||||||
}
|
}
|
||||||
Behavior on sh {
|
Behavior on sh {
|
||||||
enabled: !selectArea.pressed && root.mode === "select"
|
enabled: !selectArea.pressed && root.mode === "select"
|
||||||
|
|
||||||
ExAnim {}
|
Anim {}
|
||||||
}
|
}
|
||||||
Behavior on sw {
|
Behavior on sw {
|
||||||
enabled: !selectArea.pressed && root.mode === "select"
|
enabled: !selectArea.pressed && root.mode === "select"
|
||||||
|
|
||||||
ExAnim {}
|
Anim {}
|
||||||
}
|
}
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -154,7 +151,7 @@ Item {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Hypr.extras.refreshOptions();
|
Hypr.extras.refreshOptions();
|
||||||
screencopy.active = true;
|
root.forceActiveFocus();
|
||||||
|
|
||||||
opacity = 1;
|
opacity = 1;
|
||||||
|
|
||||||
@@ -219,13 +216,63 @@ Item {
|
|||||||
onReleased: root.enterEditMode()
|
onReleased: root.enterEditMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onClosingChanged(): void {
|
||||||
|
if (root.loader.closing)
|
||||||
|
closeAnim.start();
|
||||||
|
else {
|
||||||
|
closeAnim.stop();
|
||||||
|
returnAnim.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
target: root.loader
|
||||||
|
}
|
||||||
|
|
||||||
|
ParallelAnimation {
|
||||||
|
id: returnAnim
|
||||||
|
|
||||||
|
Anim {
|
||||||
|
duration: 300
|
||||||
|
property: "opacity"
|
||||||
|
target: root
|
||||||
|
to: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Anim {
|
||||||
|
property: "rsx"
|
||||||
|
target: root
|
||||||
|
to: Math.min(root.sx, root.ex)
|
||||||
|
}
|
||||||
|
|
||||||
|
Anim {
|
||||||
|
property: "rsy"
|
||||||
|
target: root
|
||||||
|
to: Math.min(root.sy, root.ey)
|
||||||
|
}
|
||||||
|
|
||||||
|
Anim {
|
||||||
|
property: "sw"
|
||||||
|
target: root
|
||||||
|
to: Math.abs(root.sx - root.ex)
|
||||||
|
}
|
||||||
|
|
||||||
|
Anim {
|
||||||
|
property: "sh"
|
||||||
|
target: root
|
||||||
|
to: Math.abs(root.sy - root.ey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
id: closeAnim
|
id: closeAnim
|
||||||
|
|
||||||
PropertyAction {
|
ScriptAction {
|
||||||
property: "closing"
|
script: {
|
||||||
target: root.loader
|
const states = ShellState.allStates();
|
||||||
value: true
|
for (const s of states)
|
||||||
|
s.screenshot = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
@@ -236,19 +283,19 @@ Item {
|
|||||||
to: 0
|
to: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
ExAnim {
|
Anim {
|
||||||
properties: "rsx,rsy"
|
properties: "rsx,rsy"
|
||||||
target: root
|
target: root
|
||||||
to: 0
|
to: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
ExAnim {
|
Anim {
|
||||||
property: "sw"
|
property: "sw"
|
||||||
target: root
|
target: root
|
||||||
to: root.screen.width
|
to: root.screen.width
|
||||||
}
|
}
|
||||||
|
|
||||||
ExAnim {
|
Anim {
|
||||||
property: "sh"
|
property: "sh"
|
||||||
target: root
|
target: root
|
||||||
to: root.screen.height
|
to: root.screen.height
|
||||||
@@ -267,17 +314,12 @@ Item {
|
|||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Loader {
|
ScreencopyView {
|
||||||
id: screencopy
|
id: screencopy
|
||||||
|
|
||||||
active: false
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
asynchronous: true
|
captureSource: root.screen
|
||||||
|
paintCursor: false
|
||||||
sourceComponent: ScreencopyView {
|
|
||||||
captureSource: root.screen
|
|
||||||
paintCursor: false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AnnotationCanvas {
|
AnnotationCanvas {
|
||||||
@@ -286,6 +328,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
inkColor: root.inkColor
|
inkColor: root.inkColor
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
|
selection: selectionRect
|
||||||
tool: root.mode === "edit" && root.tool !== "move" ? root.tool : "none"
|
tool: root.mode === "edit" && root.tool !== "move" ? root.tool : "none"
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
@@ -297,15 +340,14 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
CustomRect {
|
||||||
id: overlay
|
id: overlay
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: "white"
|
color: "white"
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
opacity: 0.3
|
opacity: 0.3
|
||||||
radius: root.realRounding
|
visible: screencopy.hasContent
|
||||||
visible: screencopy.item?.hasContent ?? false
|
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
maskEnabled: true
|
maskEnabled: true
|
||||||
@@ -334,16 +376,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
CustomRect {
|
||||||
id: border
|
id: border
|
||||||
|
|
||||||
border.color: Colors.palette.m3primary
|
border.color: Colors.palette.m3primary
|
||||||
border.width: root.realBorderWidth
|
border.width: root.realBorderWidth
|
||||||
color: "transparent"
|
|
||||||
implicitHeight: selectionRect.implicitHeight + root.realBorderWidth * 2
|
implicitHeight: selectionRect.implicitHeight + root.realBorderWidth * 2
|
||||||
implicitWidth: selectionRect.implicitWidth + root.realBorderWidth * 2
|
implicitWidth: selectionRect.implicitWidth + root.realBorderWidth * 2
|
||||||
radius: root.realRounding > 0 ? root.realRounding + root.realBorderWidth : 0
|
radius: root.realRounding > 0 ? root.realRounding + root.realBorderWidth : 0
|
||||||
visible: screencopy.item?.hasContent ?? false
|
visible: screencopy.hasContent
|
||||||
x: selectionRect.x - root.realBorderWidth
|
x: selectionRect.x - root.realBorderWidth
|
||||||
y: selectionRect.y - root.realBorderWidth
|
y: selectionRect.y - root.realBorderWidth
|
||||||
|
|
||||||
@@ -355,17 +396,24 @@ Item {
|
|||||||
SelectionHandles {
|
SelectionHandles {
|
||||||
id: handles
|
id: handles
|
||||||
|
|
||||||
|
border: root.realBorderWidth
|
||||||
selH: root.sh
|
selH: root.sh
|
||||||
selW: root.sw
|
selW: root.sw
|
||||||
selX: root.rsx
|
selX: root.rsx
|
||||||
selY: root.rsy
|
selY: root.rsy
|
||||||
|
selection: selectionRect
|
||||||
|
tool: root.tool
|
||||||
visible: root.mode === "edit" && root.tool === "move"
|
visible: root.mode === "edit" && root.tool === "move"
|
||||||
|
|
||||||
onBoundsChanged: (x, y, w, h) => {
|
onBoundsChanged: (x, y, w, h) => {
|
||||||
root.sx = x;
|
let nx = Math.max(0, x);
|
||||||
root.sy = y;
|
let ny = Math.max(0, y);
|
||||||
root.ex = x + w;
|
let nw = Math.min(w, root.screen.width - nx);
|
||||||
root.ey = y + h;
|
let nh = Math.min(h, root.screen.height - ny);
|
||||||
|
root.sx = nx;
|
||||||
|
root.sy = ny;
|
||||||
|
root.ex = nx + nw;
|
||||||
|
root.ey = ny + nh;
|
||||||
}
|
}
|
||||||
onMoveBy: (dx, dy) => {
|
onMoveBy: (dx, dy) => {
|
||||||
const w = root.sw, h = root.sh;
|
const w = root.sw, h = root.sh;
|
||||||
@@ -396,6 +444,4 @@ Item {
|
|||||||
onToolSelected: t => root.tool = t
|
onToolSelected: t => root.tool = t
|
||||||
onUndoRequested: annotations.undo()
|
onUndoRequested: annotations.undo()
|
||||||
}
|
}
|
||||||
|
|
||||||
component ExAnim: Anim {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ Item {
|
|||||||
|
|
||||||
property color inkColor: "#ff3b30"
|
property color inkColor: "#ff3b30"
|
||||||
property real inkWidth: 4
|
property real inkWidth: 4
|
||||||
|
required property Rectangle selection
|
||||||
property string tool: "none"
|
property string tool: "none"
|
||||||
|
|
||||||
signal changed
|
signal changed
|
||||||
|
|
||||||
function clearAll() {
|
function clearAll() {
|
||||||
committedCanvas.clear();
|
canvas.clear();
|
||||||
previewCanvas.clear();
|
|
||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,90 +54,85 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function undo() {
|
function undo() {
|
||||||
committedCanvas.undoLastGroup();
|
canvas.undoLastGroup();
|
||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
enabled: tool !== "none"
|
||||||
|
|
||||||
StrokeCanvas {
|
StrokeCanvas {
|
||||||
id: committedCanvas
|
id: canvas
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
penColor: root.inkColor
|
penColor: root.inkColor
|
||||||
penWidth: root.inkWidth
|
penWidth: root.inkWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
StrokeCanvas {
|
MouseArea {
|
||||||
id: previewCanvas
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
penColor: root.inkColor
|
|
||||||
penWidth: root.inkWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
PointHandler {
|
|
||||||
id: drawHandler
|
id: drawHandler
|
||||||
|
|
||||||
property real startX
|
property real startX
|
||||||
property real startY
|
property real startY
|
||||||
property bool started: false
|
|
||||||
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
enabled: root.tool !== "none"
|
anchors.fill: parent
|
||||||
|
cursorShape: undefined
|
||||||
|
enabled: root.enabled
|
||||||
|
|
||||||
onActiveChanged: {
|
onPositionChanged: e => {
|
||||||
if (active)
|
const x = e.x;
|
||||||
|
const y = e.y;
|
||||||
|
|
||||||
|
if (!pressed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (root.tool === "pen") {
|
if (root.tool === "pen") {
|
||||||
committedCanvas.endStroke();
|
canvas.appendPoint(x, y);
|
||||||
} else if (started) {
|
|
||||||
const pts = root.sampleShape(root.tool, startX, startY, point.position.x, point.position.y);
|
|
||||||
if (pts.length > 0) {
|
|
||||||
committedCanvas.beginStroke(pts[0][0], pts[0][1], true);
|
|
||||||
for (let i = 1; i < pts.length; i++)
|
|
||||||
committedCanvas.appendPoint(pts[i][0], pts[i][1]);
|
|
||||||
committedCanvas.endStroke();
|
|
||||||
}
|
|
||||||
previewCanvas.clear();
|
|
||||||
}
|
|
||||||
started = false;
|
|
||||||
root.changed();
|
|
||||||
}
|
|
||||||
onPointChanged: {
|
|
||||||
if (!active)
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (point.pressedButtons & Qt.RightButton) {
|
const pts = root.sampleShape(root.tool, startX, startY, x, y);
|
||||||
root.clearAll();
|
if (pts.length > 0) {
|
||||||
return;
|
canvas.beginStroke(pts[0][0], pts[0][1], true);
|
||||||
|
for (let i = 1; i < pts.length; i++)
|
||||||
|
canvas.appendPoint(pts[i][0], pts[i][1]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
onPressed: e => {
|
||||||
|
if (e.button & Qt.LeftButton) {
|
||||||
|
startX = e.x;
|
||||||
|
startY = e.y;
|
||||||
|
canvas.beginStroke(e.x, e.y);
|
||||||
|
} else if (e.button & Qt.RightButton) {
|
||||||
|
root.clearAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onPressedChanged: if (!pressed)
|
||||||
|
canvas.endStroke()
|
||||||
|
}
|
||||||
|
|
||||||
|
HoverHandler {
|
||||||
|
cursorShape: {
|
||||||
|
if (root.tool === "none")
|
||||||
|
return undefined;
|
||||||
|
|
||||||
const x = point.position.x;
|
const x = point.position.x;
|
||||||
const y = point.position.y;
|
const y = point.position.y;
|
||||||
|
const withinXWidth = x > root.selection.x && x < root.selection.x + root.selection.implicitWidth;
|
||||||
|
const withinYHeight = y > root.selection.y && y < root.selection.y + root.selection.implicitHeight;
|
||||||
|
|
||||||
if (root.tool === "pen") {
|
if (withinXWidth && withinYHeight) {
|
||||||
if (!started) {
|
if (!drawHandler.pressed)
|
||||||
started = true;
|
canvas.showHover(x, y);
|
||||||
committedCanvas.beginStroke(x, y);
|
else
|
||||||
return;
|
canvas.showHover(drawHandler.mouseX, drawHandler.mouseY);
|
||||||
}
|
return Qt.BlankCursor;
|
||||||
committedCanvas.appendPoint(x, y);
|
} else {
|
||||||
return;
|
canvas.hideHover();
|
||||||
}
|
return undefined;
|
||||||
|
|
||||||
if (!started) {
|
|
||||||
started = true;
|
|
||||||
startX = point.pressPosition.x;
|
|
||||||
startY = point.pressPosition.y;
|
|
||||||
}
|
|
||||||
const pts = root.sampleShape(root.tool, startX, startY, x, y);
|
|
||||||
if (pts.length > 0) {
|
|
||||||
previewCanvas.beginStroke(pts[0][0], pts[0][1], true);
|
|
||||||
for (let i = 1; i < pts.length; i++)
|
|
||||||
previewCanvas.appendPoint(pts[i][0], pts[i][1]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
enabled: root.enabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,23 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import ZShell.Internal
|
||||||
|
import qs.Services
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property color handleBorder: "#3584e4"
|
required property int border
|
||||||
property color handleFill: "white"
|
property color handleBorder: Colors.palette.m3primary
|
||||||
|
property color handleFill: Colors.palette.m3onPrimary
|
||||||
property real hs: 12
|
property real hs: 12
|
||||||
property real minSize: 24
|
property real minSize: 24
|
||||||
required property real selH
|
required property real selH
|
||||||
required property real selW
|
required property real selW
|
||||||
required property real selX
|
required property real selX
|
||||||
required property real selY
|
required property real selY
|
||||||
|
required property Rectangle selection
|
||||||
|
required property string tool
|
||||||
|
|
||||||
signal boundsChanged(x: real, y: real, w: real, h: real)
|
signal boundsChanged(x: real, y: real, w: real, h: real)
|
||||||
signal dragFinished
|
signal dragFinished
|
||||||
@@ -23,12 +28,16 @@ Item {
|
|||||||
x: selX
|
x: selX
|
||||||
y: selY
|
y: selY
|
||||||
|
|
||||||
|
Component.onDestruction: Cursor.clearOverride()
|
||||||
|
|
||||||
DragHandler {
|
DragHandler {
|
||||||
id: moveHandler
|
id: moveHandler
|
||||||
|
|
||||||
property real accumX: 0
|
property real accumX: 0
|
||||||
property real accumY: 0
|
property real accumY: 0
|
||||||
|
|
||||||
|
cursorShape: undefined
|
||||||
|
dragThreshold: 0
|
||||||
target: null
|
target: null
|
||||||
|
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
@@ -45,51 +54,63 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HoverHandler {
|
||||||
|
cursorShape: {
|
||||||
|
if (root.tool !== "move")
|
||||||
|
return undefined;
|
||||||
|
|
||||||
|
if ((moveHandler.centroid.pressedButtons & Qt.LeftButton) && moveHandler.active)
|
||||||
|
return Qt.ClosedHandCursor;
|
||||||
|
else
|
||||||
|
return Qt.OpenHandCursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "tl"
|
edge: "tl"
|
||||||
x: -root.hs / 2
|
x: -(root.hs + root.border) / 2
|
||||||
y: -root.hs / 2
|
y: -(root.hs + root.border) / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "t"
|
edge: "t"
|
||||||
x: root.width / 2 - root.hs / 2
|
x: root.width / 2 - root.hs / 2
|
||||||
y: -root.hs / 2
|
y: -(root.hs + root.border) / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "tr"
|
edge: "tr"
|
||||||
x: root.width - root.hs / 2
|
x: root.width - root.hs / 2 + root.border / 2
|
||||||
y: -root.hs / 2
|
y: -(root.hs + root.border) / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "r"
|
edge: "r"
|
||||||
x: root.width - root.hs / 2
|
x: root.width - root.hs / 2 + root.border / 2
|
||||||
y: root.height / 2 - root.hs / 2
|
y: root.height / 2 - root.hs / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "br"
|
edge: "br"
|
||||||
x: root.width - root.hs / 2
|
x: root.width - root.hs / 2 + root.border / 2
|
||||||
y: root.height - root.hs / 2
|
y: root.height - root.hs / 2 + root.border / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "b"
|
edge: "b"
|
||||||
x: root.width / 2 - root.hs / 2
|
x: root.width / 2 - root.hs / 2
|
||||||
y: root.height - root.hs / 2
|
y: root.height - root.hs / 2 + root.border / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "bl"
|
edge: "bl"
|
||||||
x: -root.hs / 2
|
x: -(root.hs + root.border) / 2
|
||||||
y: root.height - root.hs / 2
|
y: root.height - root.hs / 2 + root.border / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle {
|
Handle {
|
||||||
edge: "l"
|
edge: "l"
|
||||||
x: -root.hs / 2
|
x: -(root.hs + root.border) / 2
|
||||||
y: root.height / 2 - root.hs / 2
|
y: root.height / 2 - root.hs / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +128,8 @@ Item {
|
|||||||
z: 10
|
z: 10
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
|
id: hover
|
||||||
|
|
||||||
cursorShape: {
|
cursorShape: {
|
||||||
switch (handle.edge) {
|
switch (handle.edge) {
|
||||||
case "tl":
|
case "tl":
|
||||||
@@ -132,6 +155,7 @@ Item {
|
|||||||
property real startX
|
property real startX
|
||||||
property real startY
|
property real startY
|
||||||
|
|
||||||
|
dragThreshold: 0
|
||||||
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.TakeOverForbidden
|
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.TakeOverForbidden
|
||||||
target: null
|
target: null
|
||||||
|
|
||||||
@@ -141,8 +165,10 @@ Item {
|
|||||||
startY = root.y;
|
startY = root.y;
|
||||||
startW = root.width;
|
startW = root.width;
|
||||||
startH = root.height;
|
startH = root.height;
|
||||||
|
Cursor.setOverride(hover.cursorShape);
|
||||||
} else {
|
} else {
|
||||||
root.dragFinished();
|
root.dragFinished();
|
||||||
|
Cursor.clearOverride();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onTranslationChanged: {
|
onTranslationChanged: {
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import Quickshell
|
|||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import ZShell.Models
|
import ZShell.Models
|
||||||
|
import ZShell.Internal
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
|
import qs.Components
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Paths
|
import qs.Paths
|
||||||
@@ -140,4 +142,40 @@ Searcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WallpaperService {
|
||||||
|
id: wallpaper
|
||||||
|
|
||||||
|
path: root.current
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: Quickshell.screens
|
||||||
|
|
||||||
|
WallpaperObject {
|
||||||
|
readonly property var crops: root.getCrop(modelData.name)
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
cropHeight: crops?.height ?? 1.0
|
||||||
|
cropWidth: crops?.width ?? 1.0
|
||||||
|
cropX: crops?.x ?? 0.0
|
||||||
|
cropY: crops?.y ?? 0.0
|
||||||
|
screen: modelData.name
|
||||||
|
service: wallpaper
|
||||||
|
zoom: crops?.zoom ?? 1.0
|
||||||
|
|
||||||
|
Behavior on cropHeight {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
|
Behavior on cropWidth {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
|
Behavior on cropX {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
|
Behavior on cropY {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-10
@@ -17,12 +17,12 @@ GridLayout {
|
|||||||
required property Wrapper popouts
|
required property Wrapper popouts
|
||||||
required property ClipWrapper popoutsWrapper
|
required property ClipWrapper popoutsWrapper
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
readonly property int vPadding: 6
|
|
||||||
required property ScreenState screenState
|
required property ScreenState screenState
|
||||||
|
readonly property int vPadding: 6
|
||||||
|
|
||||||
function axisCenterOf(item: Item): real {
|
function axisCenterOf(item: Item): real {
|
||||||
const c = item.mapToItem(root, item.implicitWidth / 2, item.implicitHeight / 2);
|
const c = item.mapToItem(root, item.implicitWidth / 2, item.implicitHeight / 2);
|
||||||
return horizontal ? c.x : c.y;
|
return horizontal ? Math.floor(c.x) : Math.floor(c.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkPopout(pos: real): void {
|
function checkPopout(pos: real): void {
|
||||||
@@ -206,14 +206,6 @@ GridLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DelegateChoice {
|
|
||||||
roleValue: "network"
|
|
||||||
|
|
||||||
delegate: EntryWrapper {
|
|
||||||
NetworkWidget {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: "media"
|
roleValue: "media"
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import Quickshell
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Effects
|
|
||||||
import ZShell.Config
|
|
||||||
import qs.Components
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
required property Item bar
|
|
||||||
required property ScreenState screenState
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
CustomRect {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: -1
|
|
||||||
color: Colors.palette.m3surface
|
|
||||||
layer.enabled: true
|
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
maskEnabled: true
|
|
||||||
maskInverted: true
|
|
||||||
maskSource: mask
|
|
||||||
maskSpreadAtMin: 1
|
|
||||||
maskThresholdMin: 0.5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: mask
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
layer.enabled: true
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Config.bar.border + 1
|
|
||||||
anchors.topMargin: root.bar.implicitHeight + 1
|
|
||||||
radius: Config.bar.border > 0 ? Config.bar.rounding : 0
|
|
||||||
topLeftRadius: Config.bar.rounding
|
|
||||||
topRightRadius: Config.bar.rounding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Shapes
|
import Quickshell
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
@@ -12,6 +12,7 @@ GridLayout {
|
|||||||
property real animatedPercentage: 0
|
property real animatedPercentage: 0
|
||||||
readonly property real arcStartAngle: 0.75 * Math.PI
|
readonly property real arcStartAngle: 0.75 * Math.PI
|
||||||
readonly property real arcSweep: 1.5 * Math.PI
|
readonly property real arcSweep: 1.5 * Math.PI
|
||||||
|
readonly property real dpr: (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1
|
||||||
required property bool horizontal
|
required property bool horizontal
|
||||||
property string icon
|
property string icon
|
||||||
required property color iconColor
|
required property color iconColor
|
||||||
@@ -22,12 +23,17 @@ GridLayout {
|
|||||||
property bool warning: percentage * 100 >= warningThreshold
|
property bool warning: percentage * 100 >= warningThreshold
|
||||||
property int warningThreshold: 80
|
property int warningThreshold: 80
|
||||||
|
|
||||||
|
function snap(v) {
|
||||||
|
return Math.round(v * dpr) / dpr;
|
||||||
|
}
|
||||||
|
|
||||||
columnSpacing: Tokens.spacing.medium
|
columnSpacing: Tokens.spacing.medium
|
||||||
columns: horizontal ? -1 : 1
|
columns: horizontal ? -1 : 1
|
||||||
percentage: 0
|
percentage: 0
|
||||||
|
|
||||||
Behavior on animatedPercentage {
|
Behavior on animatedPercentage {
|
||||||
Anim {}
|
Anim {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: animatedPercentage = percentage
|
Component.onCompleted: animatedPercentage = percentage
|
||||||
@@ -47,27 +53,35 @@ GridLayout {
|
|||||||
text: root.icon
|
text: root.icon
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
CustomRect {
|
||||||
|
id: track
|
||||||
|
|
||||||
Layout.preferredHeight: root.horizontal ? icon.implicitHeight - Tokens.padding.extraSmall : 4
|
Layout.preferredHeight: root.horizontal ? icon.implicitHeight - Tokens.padding.extraSmall : 4
|
||||||
Layout.preferredWidth: root.horizontal ? 4 : icon.implicitWidth
|
Layout.preferredWidth: root.horizontal ? 4 : icon.implicitWidth
|
||||||
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
||||||
radius: Tokens.rounding.full
|
radius: Math.min(width, height) / 2
|
||||||
|
|
||||||
CustomRect {
|
Item {
|
||||||
id: fill
|
id: clipper
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: root.horizontal ? parent.bottom : undefined
|
||||||
anchors.left: parent.left
|
anchors.horizontalCenter: root.horizontal ? parent.horizontalCenter : undefined
|
||||||
anchors.right: root.horizontal ? parent.right : undefined
|
anchors.left: root.horizontal ? undefined : parent.left
|
||||||
anchors.top: root.horizontal ? undefined : parent.top
|
anchors.verticalCenter: root.horizontal ? undefined : parent.verticalCenter
|
||||||
color: root.mainColor
|
clip: true
|
||||||
implicitHeight: root.horizontal ? Math.ceil(root.percentage * parent.height) : 0
|
height: root.horizontal ? root.snap(root.percentage * track.height) : track.height * 2
|
||||||
implicitWidth: root.horizontal ? 0 : Math.ceil(root.percentage * parent.width)
|
width: root.horizontal ? track.width * 2 : root.snap(root.percentage * track.width)
|
||||||
|
|
||||||
// Behavior on implicitHeight {
|
CustomRect {
|
||||||
// Anim {
|
anchors.bottom: root.horizontal ? parent.bottom : undefined
|
||||||
// }
|
anchors.horizontalCenter: root.horizontal ? parent.horizontalCenter : undefined
|
||||||
// }
|
anchors.left: root.horizontal ? undefined : parent.left
|
||||||
|
anchors.verticalCenter: root.horizontal ? undefined : parent.verticalCenter
|
||||||
|
color: root.mainColor
|
||||||
|
height: track.height
|
||||||
|
radius: track.radius
|
||||||
|
width: track.width
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,28 @@ WidgetBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
roleValue: "bluetooth"
|
||||||
|
|
||||||
|
delegate: EntryWrapper {
|
||||||
|
name: "bluetooth"
|
||||||
|
|
||||||
|
BluetoothWidget {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
roleValue: "network"
|
||||||
|
|
||||||
|
delegate: EntryWrapper {
|
||||||
|
name: "network"
|
||||||
|
|
||||||
|
NetworkWidget {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: "power"
|
roleValue: "power"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
import qs.Components
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
animate: true
|
||||||
|
color: Colors.palette.m3onSurface // Network.connected ? root.textColor : Colors.palette.m3error
|
||||||
|
fill: 1
|
||||||
|
font.pointSize: Tokens.font.size.larger
|
||||||
|
text: "bluetooth"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
import qs.Components
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
animate: true
|
||||||
|
color: Colors.palette.m3onSurface // Network.connected ? root.textColor : Colors.palette.m3error
|
||||||
|
fill: 1
|
||||||
|
font.pointSize: Tokens.font.size.larger
|
||||||
|
text: "android_wifi_4_bar"
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ Item {
|
|||||||
required property Wrapper popouts
|
required property Wrapper popouts
|
||||||
|
|
||||||
function resolveIcon(app: string, icon: string): string {
|
function resolveIcon(app: string, icon: string): string {
|
||||||
if (app === "chrome_status_icon_1") {
|
if (app === "discord_status_icon_1" && Config.bar.tray.replaceIcons) {
|
||||||
return Quickshell.iconPath("discord-tray");
|
return Quickshell.iconPath("discord-tray");
|
||||||
} else if (app === "AyuGramDesktop") {
|
} else if (app === "AyuGramDesktop") {
|
||||||
if (icon === Quickshell.iconPath("com.ayugram.desktop-attention-symbolic"))
|
if (icon === Quickshell.iconPath("com.ayugram.desktop-attention-symbolic"))
|
||||||
@@ -50,6 +50,8 @@ Item {
|
|||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
|
id: layer
|
||||||
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: icon.layer.enabled && root.current ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
color: icon.layer.enabled && root.current ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ Item {
|
|||||||
y: parent.y
|
y: parent.y
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +100,7 @@ Item {
|
|||||||
value: Audio.volume
|
value: Audio.volume
|
||||||
|
|
||||||
Behavior on value {
|
Behavior on value {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onInteraction: value => Audio.setVolume(value)
|
onInteraction: value => Audio.setVolume(value)
|
||||||
@@ -123,7 +121,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
CustomRect {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 65 + Tokens.spacing.small * 2
|
Layout.preferredHeight: 65 + Tokens.spacing.small * 2
|
||||||
Layout.topMargin: root.topMargin
|
Layout.topMargin: root.topMargin
|
||||||
@@ -136,17 +134,21 @@ Item {
|
|||||||
node: Audio.source
|
node: Audio.source
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomRect {
|
ClipRect {
|
||||||
id: sourcePeakFill
|
anchors.fill: parent
|
||||||
|
radius: parent.radius
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
CustomRect {
|
||||||
anchors.left: parent.left
|
id: sourcePeakFill
|
||||||
anchors.top: parent.top
|
|
||||||
color: Qt.alpha(Colors.palette.m3primary, 0.15)
|
|
||||||
implicitWidth: parent.width * sourcePeak.peak
|
|
||||||
|
|
||||||
Behavior on implicitWidth {
|
anchors.bottom: parent.bottom
|
||||||
Anim {
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
color: Qt.alpha(Colors.palette.m3primary, 0.15)
|
||||||
|
implicitWidth: parent.width * sourcePeak.peak
|
||||||
|
|
||||||
|
Behavior on implicitWidth {
|
||||||
|
Anim {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,8 +197,7 @@ Item {
|
|||||||
value: Audio.sourceVolume
|
value: Audio.sourceVolume
|
||||||
|
|
||||||
Behavior on value {
|
Behavior on value {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onInteraction: value => Audio.setSourceVolume(value)
|
onInteraction: value => Audio.setSourceVolume(value)
|
||||||
@@ -230,7 +231,7 @@ Item {
|
|||||||
|
|
||||||
model: Audio.streams.filter(s => s.isSink)
|
model: Audio.streams.filter(s => s.isSink)
|
||||||
|
|
||||||
CustomClippingRect {
|
CustomRect {
|
||||||
id: appBox
|
id: appBox
|
||||||
|
|
||||||
required property int index
|
required property int index
|
||||||
@@ -248,17 +249,21 @@ Item {
|
|||||||
node: appBox.modelData
|
node: appBox.modelData
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomRect {
|
ClipRect {
|
||||||
id: peakFill
|
anchors.fill: parent
|
||||||
|
radius: parent.radius
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
CustomRect {
|
||||||
anchors.left: parent.left
|
id: peakFill
|
||||||
anchors.top: parent.top
|
|
||||||
color: Qt.alpha(Colors.palette.m3primary, 0.15)
|
|
||||||
implicitWidth: parent.width * peak.peak
|
|
||||||
|
|
||||||
Behavior on implicitWidth {
|
anchors.bottom: parent.bottom
|
||||||
Anim {
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
color: Qt.alpha(Colors.palette.m3primary, 0.15)
|
||||||
|
implicitWidth: parent.width * peak.peak
|
||||||
|
|
||||||
|
Behavior on implicitWidth {
|
||||||
|
Anim {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -316,8 +321,7 @@ Item {
|
|||||||
value: appBox.modelData.audio.volume
|
value: appBox.modelData.audio.volume
|
||||||
|
|
||||||
Behavior on value {
|
Behavior on value {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onInteraction: value => Audio.setStreamVolume(appBox.modelData, value)
|
onInteraction: value => Audio.setStreamVolume(appBox.modelData, value)
|
||||||
|
|||||||
@@ -0,0 +1,385 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQml.Models
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Bluetooth
|
||||||
|
import ZShell.Components
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
import qs.Components
|
||||||
|
import qs.Helpers
|
||||||
|
|
||||||
|
CustomClippingRect {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property list<var> btConnected: Bluetooth.devices.values.filter(d => d.connected)
|
||||||
|
|
||||||
|
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
|
||||||
|
implicitWidth: 500
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: layout
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Tokens.padding.larger
|
||||||
|
spacing: Tokens.spacing.extraSmall / 2
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
|
Layout.topMargin: Tokens.padding.normal
|
||||||
|
font.pointSize: Tokens.font.size.large
|
||||||
|
text: qsTr("Bluetooth")
|
||||||
|
}
|
||||||
|
|
||||||
|
Toggle {
|
||||||
|
checked: Bluetooth.defaultAdapter?.enabled ?? false // qmllint disable unresolved-type
|
||||||
|
first: true
|
||||||
|
subtext: qsTr("Toggle bluetooth device state")
|
||||||
|
text: checked ? qsTr("Enabled") : qsTr("Disabled")
|
||||||
|
|
||||||
|
onToggled: {
|
||||||
|
const adapter = Bluetooth.defaultAdapter; // qmllint disable unresolved-type
|
||||||
|
if (adapter)
|
||||||
|
adapter.enabled = checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Toggle {
|
||||||
|
checked: Bluetooth.defaultAdapter?.discovering ?? false // qmllint disable unresolved-type
|
||||||
|
last: root.btConnected.length === 0
|
||||||
|
subtext: qsTr("Enable scanning for new devices")
|
||||||
|
text: qsTr("Discover")
|
||||||
|
|
||||||
|
onToggled: {
|
||||||
|
const adapter = Bluetooth.defaultAdapter; // qmllint disable unresolved-type
|
||||||
|
if (adapter)
|
||||||
|
adapter.discovering = checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: rows
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: contentHeight
|
||||||
|
interactive: false
|
||||||
|
section.property: "connected"
|
||||||
|
spacing: Tokens.spacing.extraSmall / 2
|
||||||
|
|
||||||
|
add: Transition {
|
||||||
|
Anim {
|
||||||
|
from: 0
|
||||||
|
property: "opacity"
|
||||||
|
to: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delegate: DelegateChooser {
|
||||||
|
role: "isDivider"
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
roleValue: true
|
||||||
|
|
||||||
|
delegate: StatusDivider {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
delegate: BluetoothItem {
|
||||||
|
list: rows
|
||||||
|
width: rows.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
displaced: Transition {
|
||||||
|
Anim {
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
property: "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model: ScriptModel {
|
||||||
|
objectProp: "address"
|
||||||
|
values: {
|
||||||
|
const byName = (a, b) => a.name.localeCompare(b.name);
|
||||||
|
return [...[...Bluetooth.devices.values].filter(d => d.connected).sort(byName).slice(0, 5),
|
||||||
|
{
|
||||||
|
isDivider: true
|
||||||
|
},
|
||||||
|
...[...Bluetooth.devices.values].filter(d => !d.connected).sort(byName).slice(0, 5)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
move: Transition {
|
||||||
|
Anim {
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
property: "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
remove: Transition {
|
||||||
|
Anim {
|
||||||
|
property: "opacity"
|
||||||
|
to: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
section.delegate: Rectangle {
|
||||||
|
required property string section
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
height: childrenRect.height
|
||||||
|
width: ListView.view.width
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
text: parent.section
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component BluetoothItem: ConnectedRect {
|
||||||
|
id: btItem
|
||||||
|
|
||||||
|
readonly property int connectedCount: root.btConnected.length
|
||||||
|
readonly property bool connecting: Network.connectingNetwork === modelData
|
||||||
|
property int horizontalPadding: Tokens.padding.largeIncreased
|
||||||
|
readonly property bool inConnectedGroup: index < connectedCount
|
||||||
|
required property int index
|
||||||
|
required property ListView list
|
||||||
|
readonly property bool loading: modelData.state === BluetoothDeviceState.Connecting || modelData.state === BluetoothDeviceState.Disconnecting // qmllint disable unresolved-type
|
||||||
|
|
||||||
|
required property BluetoothDevice modelData
|
||||||
|
property int verticalPadding: Tokens.padding.smaller
|
||||||
|
|
||||||
|
first: !inConnectedGroup && index === connectedCount + 1
|
||||||
|
implicitHeight: rowLayout.implicitHeight + verticalPadding * 2
|
||||||
|
last: inConnectedGroup ? index === connectedCount - 1 : index === list.count - 1
|
||||||
|
radius: Tokens.rounding.small
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 50
|
||||||
|
running: btItem.ListView.delayRemove
|
||||||
|
|
||||||
|
onTriggered: btItem.ListView.delayRemove = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onConnectedChanged(): void {
|
||||||
|
if (!btItem.modelData.connected)
|
||||||
|
btItem.ListView.delayRemove = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPairedChanged(): void {
|
||||||
|
if (btItem.modelData.paired)
|
||||||
|
btItem.modelData.connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
target: btItem.modelData
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: rowLayout
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: btItem.horizontalPadding
|
||||||
|
anchors.rightMargin: btItem.horizontalPadding
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: column
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: Tokens.spacing.extraSmall
|
||||||
|
Layout.rightMargin: Tokens.spacing.extraSmall
|
||||||
|
elide: Text.ElideRight
|
||||||
|
text: btItem.modelData.name
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
id: subtext
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
color: Colors.palette.m3outline
|
||||||
|
elide: Text.ElideRight
|
||||||
|
font.pointSize: Tokens.font.size.small
|
||||||
|
text: btItem.modelData.connected ? (btItem.modelData.batteryAvailable ? qsTr("%1 battery left").arg(Math.round(btItem.modelData.battery * 100) + "%") : qsTr("Battery status unknown")) : btItem.modelData.address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
implicitHeight: icon.height
|
||||||
|
implicitWidth: icon.width
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
id: icon
|
||||||
|
|
||||||
|
font.pointSize: Tokens.font.size.large
|
||||||
|
opacity: btItem.connecting ? 0 : 1
|
||||||
|
text: btItem.modelData.batteryAvailable ? Icons.getBatteryIcon(btItem.modelData.battery) : "battery_unknown"
|
||||||
|
visible: btItem.modelData.state === BluetoothDeviceState.Connected // qmllint disable unresolved-type
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: opacity > 0
|
||||||
|
anchors.fill: parent
|
||||||
|
opacity: btItem.connecting ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sourceComponent: CircularIndicator {
|
||||||
|
bgColor: "transparent"
|
||||||
|
running: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonRow {
|
||||||
|
spacing: Tokens.spacing.small
|
||||||
|
|
||||||
|
IconTextButton {
|
||||||
|
font.pointSize: Tokens.font.size.small
|
||||||
|
icon: btItem.modelData.connected ? "link_off" : btItem.modelData.paired ? "link" : "add_link"
|
||||||
|
text: btItem.modelData.connected ? qsTr("Disconnect") : btItem.modelData.paired ? qsTr("Connect") : qsTr("Pair")
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (btItem.modelData.connected)
|
||||||
|
btItem.modelData.disconnect();
|
||||||
|
else if (btItem.modelData.paired)
|
||||||
|
btItem.modelData.connect();
|
||||||
|
else if (!btItem.modelData.paired)
|
||||||
|
btItem.modelData.pair();
|
||||||
|
else if (btItem.modelData.pairing)
|
||||||
|
btItem.modelData.cancelPair();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
component ConnectedRect: CustomRect {
|
||||||
|
id: bg
|
||||||
|
|
||||||
|
property bool first
|
||||||
|
property bool last
|
||||||
|
|
||||||
|
bottomLeftRadius: last ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||||
|
bottomRightRadius: last ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||||
|
color: Colors.tPalette.m3surfaceContainer
|
||||||
|
topLeftRadius: first ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||||
|
topRightRadius: first ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||||
|
|
||||||
|
Behavior on bottomLeftRadius {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on bottomRightRadius {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on topLeftRadius {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on topRightRadius {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
component StatusDivider: CustomText {
|
||||||
|
bottomPadding: Tokens.spacing.extraSmall
|
||||||
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
|
font.pointSize: Tokens.font.size.smaller
|
||||||
|
text: {
|
||||||
|
const devices = Bluetooth.devices.values; // qmllint disable unresolved-type
|
||||||
|
const connectedCount = devices.filter(d => d.connected).length;
|
||||||
|
let available = qsTr("%1 device%2 available").arg(devices.length - connectedCount).arg(devices.length === 1 ? "" : "s");
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
topPadding: Tokens.spacing.small
|
||||||
|
}
|
||||||
|
component Toggle: CustomSwitch {
|
||||||
|
id: toggleItem
|
||||||
|
|
||||||
|
readonly property alias bg: bg
|
||||||
|
property alias first: bg.first
|
||||||
|
property alias last: bg.last
|
||||||
|
property string subtext
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
cLayer: 2
|
||||||
|
horizontalPadding: Tokens.padding.largeIncreased
|
||||||
|
implicitHeight: Math.max(implicitContentHeight, implicitIndicatorHeight) + verticalPadding * 2
|
||||||
|
implicitWidth: implicitContentWidth + implicitIndicatorWidth + horizontalPadding * 2
|
||||||
|
indicator.anchors.right: right
|
||||||
|
indicator.anchors.rightMargin: toggleItem.horizontalPadding
|
||||||
|
indicator.anchors.verticalCenter: verticalCenter
|
||||||
|
verticalPadding: Tokens.padding.normal
|
||||||
|
|
||||||
|
background: ConnectedRect {
|
||||||
|
id: bg
|
||||||
|
|
||||||
|
StateLayer {
|
||||||
|
id: stateLayer
|
||||||
|
|
||||||
|
manualPressOverride: toggleItem.pressed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
contentItem: Item {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: toggleItem.horizontalPadding
|
||||||
|
anchors.right: toggleItem.indicator.left
|
||||||
|
anchors.rightMargin: Tokens.spacing.normal
|
||||||
|
implicitHeight: column.implicitHeight
|
||||||
|
implicitWidth: column.implicitWidth
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: column
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
id: label
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
elide: Text.ElideRight
|
||||||
|
font: {
|
||||||
|
const f = Qt.font(label.font);
|
||||||
|
f.pointSize = Tokens.font.size.smaller;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
text: toggleItem.text
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
id: subtext
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
color: Colors.palette.m3outline
|
||||||
|
elide: Text.ElideRight
|
||||||
|
font: {
|
||||||
|
const f = Qt.font(subtext.font);
|
||||||
|
f.pointSize = Tokens.font.size.small;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
text: toggleItem.subtext
|
||||||
|
visible: toggleItem.subtext
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onPressed: stateLayer.press(stateLayer.mouseX, stateLayer.mouseY)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -82,6 +82,13 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Popout {
|
||||||
|
name: "bluetooth"
|
||||||
|
|
||||||
|
sourceComponent: BluetoothPopout {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Popout {
|
Popout {
|
||||||
name: "updates"
|
name: "updates"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import QtQuick
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
import qs.Helpers.Network
|
||||||
|
import qs.Components
|
||||||
|
|
||||||
|
CustomRect {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property bool closing: PopupManager.closed
|
||||||
|
readonly property url currentPopup: PopupManager.currentPopup
|
||||||
|
property bool shouldBeVisible: loader.status === Loader.Ready
|
||||||
|
|
||||||
|
color: Qt.alpha(Colors.palette.m3shadow, 0.3)
|
||||||
|
opacity: shouldBeVisible && !closing ? 1 : 0
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (!visible) {
|
||||||
|
PopupManager.requestClose();
|
||||||
|
PopupManager.currentPopup = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomMouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
preventStealing: true
|
||||||
|
propagateComposedEvents: false
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
const insideItemWidth = mouseX < loader.x + loader.item.width && mouseX > loader.x;
|
||||||
|
const insideItemHeight = mouseY < loader.y + loader.item.height && mouseY > loader.y;
|
||||||
|
if (insideItemHeight && insideItemWidth)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PopupManager.requestClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: loader
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onCurrentPopupChanged(): void {
|
||||||
|
if (PopupManager.currentPopup) {
|
||||||
|
loader.setSource(PopupManager.currentPopup, PopupManager.currentPopupProps);
|
||||||
|
} else {
|
||||||
|
loader.source = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
target: PopupManager
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onNetworkConnected(): void {
|
||||||
|
PopupManager.requestClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
target: Network
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import ZShell.Components
|
||||||
|
import ZShell.Config
|
||||||
|
import qs.Services
|
||||||
|
import qs.Components
|
||||||
|
import qs.Helpers.Network
|
||||||
|
|
||||||
|
CustomClippingRect {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property var network
|
||||||
|
|
||||||
|
color: Colors.palette.m3surfaceContainer
|
||||||
|
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
|
||||||
|
implicitWidth: layout.implicitWidth + layout.anchors.margins * 2
|
||||||
|
radius: Tokens.rounding.large
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: layout
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Tokens.padding.extraLarge
|
||||||
|
spacing: Tokens.spacing.medium
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
font.pointSize: Tokens.font.size.extraLarge * 2
|
||||||
|
text: "lock"
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
color: Colors.palette.m3onSurfaceVariant
|
||||||
|
text: qsTr("Connect to %1").arg(root.network.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomTextField {
|
||||||
|
id: passwordField
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: 400
|
||||||
|
echoMode: CustomTextField.Password
|
||||||
|
errorText: qsTr("Failed to connect with given password")
|
||||||
|
isError: Network.failedNetwork
|
||||||
|
leadingIcon: "lock"
|
||||||
|
passwordMaskDelay: 5000
|
||||||
|
placeholderText: qsTr("Input password")
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonRow {
|
||||||
|
id: buttonRow
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: Tokens.spacing.extraSmall
|
||||||
|
|
||||||
|
IconTextButton {
|
||||||
|
fillWidth: true
|
||||||
|
font.pointSize: Tokens.font.size.normal
|
||||||
|
icon: "close"
|
||||||
|
inactiveColor: Colors.layer(Colors.palette.m3surfaceContainerHighest, 2)
|
||||||
|
inactiveOnColor: Colors.palette.m3onSurfaceVariant
|
||||||
|
isRound: true
|
||||||
|
isToggle: false
|
||||||
|
shapeMorph: true
|
||||||
|
text: "Cancel"
|
||||||
|
|
||||||
|
onClicked: PopupManager.requestClose()
|
||||||
|
}
|
||||||
|
|
||||||
|
IconTextButton {
|
||||||
|
fillWidth: true
|
||||||
|
font.pointSize: Tokens.font.size.normal
|
||||||
|
icon: Network.connectingNetwork ? "" : "check"
|
||||||
|
inactiveColor: Network.connectingNetwork ? Colors.palette.m3primaryContainer : Network.failedNetwork ? Colors.palette.m3error : Colors.palette.m3primary
|
||||||
|
inactiveOnColor: Network.connectingNetwork ? Colors.palette.m3onPrimaryContainer : Network.failedNetwork ? Colors.palette.m3onError : Colors.palette.m3onPrimary
|
||||||
|
isRound: true
|
||||||
|
isToggle: false
|
||||||
|
shapeMorph: true
|
||||||
|
text: Network.connectingNetwork ? "" : "Apply"
|
||||||
|
|
||||||
|
onClicked: Network.requestConnect(root.network, passwordField.text)
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: opacity > 0
|
||||||
|
anchors.centerIn: parent
|
||||||
|
opacity: Network.connectingNetwork ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sourceComponent: CircularIndicator {
|
||||||
|
bgColor: "transparent"
|
||||||
|
implicitSize: buttonRow.height - Tokens.padding.normal
|
||||||
|
running: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property bool closed: true
|
||||||
|
property url currentPopup: ""
|
||||||
|
property var currentPopupProps: ({})
|
||||||
|
|
||||||
|
function requestClose(): void {
|
||||||
|
closed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestOpen(source: url, properties = {}): void {
|
||||||
|
currentPopupProps = properties;
|
||||||
|
currentPopup = source;
|
||||||
|
closed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,36 +1,142 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Networking
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Components
|
import Quickshell
|
||||||
|
import ZShell.Components
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Modules
|
import qs.Services
|
||||||
import qs.Helpers as Helpers
|
import qs.Modules.Settings.Common
|
||||||
|
import qs.Modules.Bar.Popouts.Network
|
||||||
|
import qs.Components
|
||||||
|
import qs.Helpers.Network
|
||||||
|
|
||||||
Item {
|
CustomClippingRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property var wrapper
|
required property var wrapper
|
||||||
|
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
implicitHeight: networkPopContent.height + networkPopContent.anchors.margins * 2
|
||||||
|
implicitWidth: 500 + 8 * 2
|
||||||
|
radius: (20 - Tokens.padding.small) * Tokens.rounding.scale
|
||||||
|
|
||||||
|
Component.onCompleted: Network.active = true
|
||||||
|
Component.onDestruction: Network.active = false
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: layout
|
id: networkPopContent
|
||||||
|
|
||||||
spacing: 8
|
anchors.left: parent.left
|
||||||
|
anchors.margins: Tokens.padding.large
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
spacing: Tokens.spacing.extraSmall / 2
|
||||||
|
|
||||||
Repeater {
|
CustomText {
|
||||||
model: Helpers.Network.devices
|
Layout.preferredHeight: visible ? implicitHeight : 0
|
||||||
|
Layout.rightMargin: Tokens.padding.extraSmall
|
||||||
|
font.pointSize: Tokens.font.size.large
|
||||||
|
text: qsTr("Wifi")
|
||||||
|
}
|
||||||
|
|
||||||
CustomRadioButton {
|
Toggle {
|
||||||
id: network
|
Layout.preferredHeight: visible ? implicitHeight : 0
|
||||||
|
checked: Network.wifiEnabled
|
||||||
|
first: true
|
||||||
|
last: Network.connectedNetworks.length === 0
|
||||||
|
subtext: qsTr("Toggle WiFi device state")
|
||||||
|
text: checked ? qsTr("Enabled") : qsTr("Disabled")
|
||||||
|
|
||||||
required property NetworkDevice modelData
|
onToggled: Network.setWifi(checked)
|
||||||
|
}
|
||||||
|
|
||||||
checked: Helpers.Network.activeDevice?.name === modelData.name
|
ListView {
|
||||||
text: modelData.description
|
id: rows
|
||||||
visible: modelData.name !== "lo"
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: contentHeight
|
||||||
|
interactive: false
|
||||||
|
section.property: "connected"
|
||||||
|
spacing: Tokens.spacing.extraSmall / 2
|
||||||
|
|
||||||
|
add: Transition {
|
||||||
|
Anim {
|
||||||
|
from: 0
|
||||||
|
property: "opacity"
|
||||||
|
to: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delegate: DelegateChooser {
|
||||||
|
role: "isDivider"
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
roleValue: true
|
||||||
|
|
||||||
|
delegate: NetworkDivider {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DelegateChoice {
|
||||||
|
delegate: NetworkItem {
|
||||||
|
list: rows
|
||||||
|
width: rows.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
displaced: Transition {
|
||||||
|
Anim {
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
property: "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model: ScriptModel {
|
||||||
|
values: {
|
||||||
|
const byStrengthName = (a, b) => b.signalStrength - a.signalStrength || a.name.localeCompare(b.name);
|
||||||
|
const cNetworks = [...Network.connectedNetworks];
|
||||||
|
const kNetworks = [...Network.knownNetworks];
|
||||||
|
const uNetworks = [...Network.unknownNetworks];
|
||||||
|
|
||||||
|
return [...cNetworks.sort(byStrengthName), ...(kNetworks.length > 0 ? [
|
||||||
|
{
|
||||||
|
isDivider: true,
|
||||||
|
type: "known"
|
||||||
|
},
|
||||||
|
...kNetworks.sort(byStrengthName)] : []), ...(uNetworks.length > 0 ? [
|
||||||
|
{
|
||||||
|
isDivider: true,
|
||||||
|
type: "unknown"
|
||||||
|
},
|
||||||
|
...uNetworks.sort(byStrengthName)] : [])];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
move: Transition {
|
||||||
|
Anim {
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
property: "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
remove: Transition {
|
||||||
|
Anim {
|
||||||
|
property: "opacity"
|
||||||
|
to: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
section.delegate: Rectangle {
|
||||||
|
required property string section
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
height: childrenRect.height
|
||||||
|
width: ListView.view.width
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
text: parent.section
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NetworkOverlay {
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import qs.Modules
|
|||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
CustomRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property bool hasUpdates: Object.keys(Updates.updates)?.length > 0
|
readonly property bool hasUpdates: Object.keys(Updates.updates)?.length > 0
|
||||||
@@ -36,8 +36,8 @@ CustomClippingRect {
|
|||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: noUpdatesIcon
|
id: noUpdatesIcon
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.centerIn: parent
|
||||||
anchors.top: parent.top
|
anchors.verticalCenterOffset: -noUpdatesText.implicitHeight
|
||||||
color: Colors.tPalette.m3onSurfaceVariant
|
color: Colors.tPalette.m3onSurfaceVariant
|
||||||
fontStyle: Tokens.font.icon.builders.large.size(48).weight(Font.DemiBold).build()
|
fontStyle: Tokens.font.icon.builders.large.size(48).weight(Font.DemiBold).build()
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
@@ -45,6 +45,8 @@ CustomClippingRect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
|
id: noUpdatesText
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: noUpdatesIcon.bottom
|
anchors.top: noUpdatesIcon.bottom
|
||||||
color: Colors.tPalette.m3onSurfaceVariant
|
color: Colors.tPalette.m3onSurfaceVariant
|
||||||
@@ -71,6 +73,7 @@ CustomClippingRect {
|
|||||||
implicitHeight: Math.min(contentHeight, (root.itemHeight + spacing) * 5 - spacing)
|
implicitHeight: Math.min(contentHeight, (root.itemHeight + spacing) * 5 - spacing)
|
||||||
implicitWidth: contentWidth
|
implicitWidth: contentWidth
|
||||||
spacing: Tokens.spacing.medium
|
spacing: Tokens.spacing.medium
|
||||||
|
clip: true
|
||||||
|
|
||||||
delegate: CustomRect {
|
delegate: CustomRect {
|
||||||
id: update
|
id: update
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Hyprland
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Item {
|
|||||||
searchField.forceActiveFocus();
|
searchField.forceActiveFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: search
|
id: search
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@@ -54,7 +54,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: preview
|
id: preview
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
@@ -228,7 +228,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: Tokens.spacing.small
|
spacing: Tokens.spacing.small
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: textRect
|
id: textRect
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
@@ -11,11 +10,6 @@ import qs.Components
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property real nonAnimWidth: view.implicitWidth + viewWrapper.anchors.margins * 2
|
|
||||||
readonly property real nonAnimHeight: tabs.implicitHeight + tabs.anchors.topMargin + view.implicitHeight + viewWrapper.anchors.margins + viewWrapper.anchors.topMargin
|
|
||||||
|
|
||||||
required property ScreenState screenState
|
|
||||||
|
|
||||||
readonly property var dashboardTabs: {
|
readonly property var dashboardTabs: {
|
||||||
const allTabs = [
|
const allTabs = [
|
||||||
{
|
{
|
||||||
@@ -45,9 +39,12 @@ Item {
|
|||||||
];
|
];
|
||||||
return allTabs.filter(tab => tab.enabled);
|
return allTabs.filter(tab => tab.enabled);
|
||||||
}
|
}
|
||||||
|
readonly property real nonAnimHeight: tabs.implicitHeight + tabs.anchors.topMargin + view.implicitHeight + viewWrapper.anchors.margins + viewWrapper.anchors.topMargin
|
||||||
|
readonly property real nonAnimWidth: view.implicitWidth + viewWrapper.anchors.margins * 2
|
||||||
|
required property ScreenState screenState
|
||||||
|
|
||||||
implicitWidth: nonAnimWidth
|
|
||||||
implicitHeight: nonAnimHeight
|
implicitHeight: nonAnimHeight
|
||||||
|
implicitWidth: nonAnimWidth
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -63,15 +60,14 @@ Item {
|
|||||||
Tabs {
|
Tabs {
|
||||||
id: tabs
|
id: tabs
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
anchors.margins: Tokens.padding.small
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: ZUtils.clamp(anchors.margins - Config.bar.border, 0, anchors.margins)
|
||||||
nonAnimWidth: view.implicitWidth
|
nonAnimWidth: view.implicitWidth
|
||||||
screenState: root.screenState
|
screenState: root.screenState
|
||||||
tabs: root.dashboardTabs
|
tabs: root.dashboardTabs
|
||||||
anchors.topMargin: ZUtils.clamp(anchors.margins - Config.bar.border, 0, anchors.margins)
|
|
||||||
anchors.margins: Tokens.padding.small
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -79,15 +75,15 @@ Item {
|
|||||||
|
|
||||||
property int radius: Tokens.rounding.extraLarge - anchors.margins
|
property int radius: Tokens.rounding.extraLarge - anchors.margins
|
||||||
|
|
||||||
anchors.top: tabs.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.topMargin: Tokens.spacing.small
|
anchors.left: parent.left
|
||||||
anchors.margins: Tokens.padding.small
|
anchors.margins: Tokens.padding.small
|
||||||
clip: true
|
anchors.right: parent.right
|
||||||
|
anchors.top: tabs.bottom
|
||||||
|
anchors.topMargin: Tokens.spacing.small
|
||||||
|
clip: view.currentIndex !== 3 || (!view.currentItem?.settled ?? true)
|
||||||
|
|
||||||
Flickable {
|
Item {
|
||||||
id: view
|
id: view
|
||||||
|
|
||||||
readonly property int currentIndex: root.screenState.dashboardTab
|
readonly property int currentIndex: root.screenState.dashboardTab
|
||||||
@@ -97,64 +93,50 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
implicitWidth: currentItem?.implicitWidth ?? 0
|
|
||||||
implicitHeight: currentItem?.implicitHeight ?? 0
|
implicitHeight: currentItem?.implicitHeight ?? 0
|
||||||
|
implicitWidth: currentItem?.implicitWidth ?? 0
|
||||||
|
|
||||||
contentX: currentItem?.x ?? 0
|
Repeater {
|
||||||
contentWidth: row.implicitWidth
|
id: repeater
|
||||||
contentHeight: row.implicitHeight
|
|
||||||
|
|
||||||
interactive: false
|
delegate: Loader {
|
||||||
|
id: paneLoader
|
||||||
|
|
||||||
onContentXChanged: {
|
required property int index
|
||||||
if (!moving || !currentItem)
|
required property var modelData
|
||||||
return;
|
|
||||||
|
|
||||||
const x = contentX - currentItem.x;
|
readonly property real targetX: index < view.currentIndex ? -view.implicitWidth : index > view.currentIndex ? view.implicitWidth : 0
|
||||||
if (x > currentItem.implicitWidth / 2)
|
readonly property bool settled: x === targetX
|
||||||
root.screenState.dashboardTab = Math.min(root.screenState.dashboardTab + 1, tabs.count - 1);
|
|
||||||
else if (x < -currentItem.implicitWidth / 2)
|
|
||||||
root.screenState.dashboardTab = Math.max(root.screenState.dashboardTab - 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
active: index === view.currentIndex || opacity > 0
|
||||||
id: row
|
opacity: index === view.currentIndex ? 1 : 0
|
||||||
|
sourceComponent: modelData.component
|
||||||
|
visible: opacity > 0
|
||||||
|
x: targetX
|
||||||
|
y: 0
|
||||||
|
|
||||||
Repeater {
|
Behavior on opacity {
|
||||||
id: repeater
|
Anim {
|
||||||
|
type: Anim.DefaultEffects
|
||||||
model: ScriptModel {
|
}
|
||||||
values: root.dashboardTabs
|
|
||||||
}
|
}
|
||||||
|
Behavior on x {
|
||||||
delegate: Loader {
|
Anim {
|
||||||
id: paneLoader
|
type: Anim.DefaultEffects
|
||||||
|
}
|
||||||
required property int index
|
|
||||||
required property var modelData
|
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
|
|
||||||
sourceComponent: modelData.component
|
|
||||||
|
|
||||||
Component.onCompleted: active = Qt.binding(() => {
|
|
||||||
if (index === view.currentIndex)
|
|
||||||
return true;
|
|
||||||
const vx = Math.floor(view.visibleArea.xPosition * view.contentWidth);
|
|
||||||
const vex = Math.floor(vx + view.visibleArea.widthRatio * view.contentWidth);
|
|
||||||
return (vx >= x && vx <= x + implicitWidth) || (vex >= x && vex <= x + implicitWidth);
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
model: ScriptModel {
|
||||||
|
values: root.dashboardTabs
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: dashComponent
|
id: dashComponent
|
||||||
|
|
||||||
Dash {
|
Dash {
|
||||||
screenState: root.screenState
|
|
||||||
radius: viewWrapper.radius
|
radius: viewWrapper.radius
|
||||||
|
screenState: root.screenState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,8 +152,8 @@ Item {
|
|||||||
id: mediaComponent
|
id: mediaComponent
|
||||||
|
|
||||||
Media {
|
Media {
|
||||||
screenState: root.screenState
|
|
||||||
radius: viewWrapper.radius
|
radius: viewWrapper.radius
|
||||||
|
screenState: root.screenState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,12 +164,6 @@ Item {
|
|||||||
radius: viewWrapper.radius
|
radius: viewWrapper.radius
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on contentX {
|
|
||||||
Anim {
|
|
||||||
type: Anim.DefaultEffects
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Row {
|
|||||||
padding: 20
|
padding: 20
|
||||||
spacing: 12
|
spacing: 12
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
||||||
implicitHeight: info.implicitHeight
|
implicitHeight: info.implicitHeight
|
||||||
implicitWidth: info.implicitHeight
|
implicitWidth: info.implicitHeight
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Item {
|
|||||||
implicitWidth: 1000
|
implicitWidth: 1000
|
||||||
implicitHeight: 320
|
implicitHeight: 320
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: root.radius
|
radius: root.radius
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ CustomListView {
|
|||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
spacing: Tokens.spacing.extraSmall / 2
|
spacing: Tokens.spacing.extraSmall / 2
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: iconClip
|
id: iconClip
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Item {
|
|||||||
onClicked: root.close()
|
onClicked: root.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: popupBackground
|
id: popupBackground
|
||||||
readonly property real padding: 4
|
readonly property real padding: 4
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ Item {
|
|||||||
visible: false
|
visible: false
|
||||||
z: 999
|
z: 999
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: popupBackground
|
id: popupBackground
|
||||||
|
|
||||||
readonly property real padding: Tokens.padding.extraSmall
|
readonly property real padding: Tokens.padding.extraSmall
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Item {
|
|||||||
implicitHeight: tileHeight + Tokens.padding.large * 2
|
implicitHeight: tileHeight + Tokens.padding.large * 2
|
||||||
implicitWidth: tileWidth
|
implicitWidth: tileWidth
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: image
|
id: image
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ ColumnLayout {
|
|||||||
text: Time.format("dddd, d MMMM yyyy")
|
text: Time.format("dddd, d MMMM yyyy")
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: Tokens.spacing.largeIncreased * 2
|
Layout.topMargin: Tokens.spacing.largeIncreased * 2
|
||||||
color: Colors.tPalette.m3surfaceContainer
|
color: Colors.tPalette.m3surfaceContainer
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import qs.Helpers
|
|||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property var lock
|
required property var lock
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import QtQuick
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import ZShell.Components
|
import ZShell.Components
|
||||||
import qs.Components
|
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
|
import qs.Components
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property var lock
|
required property var lock
|
||||||
|
|||||||
@@ -24,12 +24,11 @@ ColumnLayout {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: Colors.palette.m3outline
|
color: Colors.palette.m3outline
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.family: Config.appearance.font.family.mono
|
font: Tokens.font.mono.builders.small.weight(Font.Medium).build()
|
||||||
font.weight: 500
|
|
||||||
text: NotifServer.list.length > 0 ? qsTr("%1 notification%2").arg(NotifServer.list.length).arg(NotifServer.list.length === 1 ? "" : "s") : qsTr("Notifications")
|
text: NotifServer.list.length > 0 ? qsTr("%1 notification%2").arg(NotifServer.list.length).arg(NotifServer.list.length === 1 ? "" : "s") : qsTr("Notifications")
|
||||||
}
|
}
|
||||||
|
|
||||||
ClippingRectangle {
|
ClipRect {
|
||||||
id: clipRect
|
id: clipRect
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ CustomRect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClippingRectangle {
|
ClipRect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: root.urgency === "critical" ? Colors.palette.m3error : root.urgency === "low" ? Colors.layer(Colors.palette.m3surfaceContainerHighest, 3) : Colors.palette.m3secondaryContainer
|
color: root.urgency === "critical" ? Colors.palette.m3error : root.urgency === "low" ? Colors.layer(Colors.palette.m3surfaceContainerHighest, 3) : Colors.palette.m3secondaryContainer
|
||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import qs.Components
|
||||||
import qs.Paths
|
import qs.Paths
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
ClippingRectangle {
|
ClipRect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ pragma ComponentBehavior: Bound
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import qs.Components
|
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
|
import ZShell.Components
|
||||||
|
import qs.Components
|
||||||
import qs.Daemons
|
import qs.Daemons
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ Item {
|
|||||||
for (let i = 0; i < count; i++)
|
for (let i = 0; i < count; i++)
|
||||||
height += (list.itemAtIndex(i) as NotifWrapper)?.nonAnimHeight ?? 0;
|
height += (list.itemAtIndex(i) as NotifWrapper)?.nonAnimHeight ?? 0;
|
||||||
|
|
||||||
if (panels.popouts.hasCurrent && (panels.popouts.currentCenter + (panels.popouts.current?.width / 2)) > panels.notifications.x)
|
if (panels.popouts.hasCurrent && (panels.popouts.currentCenter + (panels.popouts.current?.width / 2)) > panels.notifications.x || screenState.dashboard)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (screenState.osd) {
|
if (screenState.osd) {
|
||||||
@@ -36,25 +37,20 @@ Item {
|
|||||||
height = h;
|
height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screenState.session) {
|
|
||||||
const h = panels.session.y - Tokens.spacing.small * 2 - padding * 2;
|
|
||||||
if (height > h)
|
|
||||||
height = h;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.min(((QsWindow.window as QsWindow)?.screen?.height ?? 0) - 1 * 2, height + padding * 2);
|
return Math.min(((QsWindow.window as QsWindow)?.screen?.height ?? 0) - 1 * 2, height + padding * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: Config.notifs.sizes.width + padding * 2
|
implicitWidth: Config.notifs.sizes.width + padding * 2
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {}
|
Anim {}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClippingWrapperRectangle {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: root.padding
|
anchors.margins: root.padding
|
||||||
color: "transparent"
|
clip: true
|
||||||
radius: Tokens.rounding.large - root.padding
|
// radius: Tokens.rounding.large - root.padding
|
||||||
|
|
||||||
CustomListView {
|
CustomListView {
|
||||||
id: list
|
id: list
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ CustomRect {
|
|||||||
visible: root.hasImage || root.hasAppIcon
|
visible: root.hasImage || root.hasAppIcon
|
||||||
width: Config.notifs.sizes.image
|
width: Config.notifs.sizes.image
|
||||||
|
|
||||||
sourceComponent: CustomClippingRect {
|
sourceComponent: ClipRect {
|
||||||
color: root.modelData.urgency === NotificationUrgency.Critical ? Colors.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colors.layer(Colors.palette.m3surfaceContainerHighest, 2) : Colors.palette.m3secondaryContainer
|
color: root.modelData.urgency === NotificationUrgency.Critical ? Colors.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colors.layer(Colors.palette.m3surfaceContainerHighest, 2) : Colors.palette.m3secondaryContainer
|
||||||
implicitHeight: Config.notifs.sizes.image
|
implicitHeight: Config.notifs.sizes.image
|
||||||
implicitWidth: Config.notifs.sizes.image
|
implicitWidth: Config.notifs.sizes.image
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,32 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import ZShell.Config
|
|
||||||
import qs.Components
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillHeight: true
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
color: Colors.tPalette.m3outlineVariant
|
|
||||||
font.pointSize: 36
|
|
||||||
text: "chat"
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
color: Colors.tPalette.m3onSurfaceVariant
|
|
||||||
text: qsTr("Send a message to get started")
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillHeight: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,619 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import ZShell.Blobs
|
|
||||||
import ZShell.Config
|
|
||||||
import ZShell.Components
|
|
||||||
import ZShell.Llm
|
|
||||||
import qs.Components
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
required property int index
|
|
||||||
required property var modelData
|
|
||||||
required property var blocks
|
|
||||||
readonly property var segments: modelData.segments
|
|
||||||
required property Item rootParent
|
|
||||||
required property ChatGeneration current
|
|
||||||
readonly property bool isActive: index === blocks.length - 1
|
|
||||||
property bool expanded: false
|
|
||||||
readonly property LlmSegment lastSegment: root.segments[root.segments.length - 1]
|
|
||||||
readonly property real totalElapsedMs: root.segments.reduce((sum, s) => sum + (s.elapsedMs ?? 0), 0)
|
|
||||||
readonly property bool pendingApproval: current.toolApprovalPending && segments.filter(s => s.type === LlmSegment.Type.ToolCall).some(s => current.pendingToolCalls.includes(s))
|
|
||||||
|
|
||||||
implicitHeight: {
|
|
||||||
const expand = expandedRect.implicitHeight + layout.implicitHeight + expandedRect.anchors.topMargin;
|
|
||||||
const collapsed = layout.implicitHeight;
|
|
||||||
const approval = layout.implicitHeight + approvalPrompt.implicitHeight + approvalPrompt.anchors.topMargin;
|
|
||||||
|
|
||||||
if (expanded)
|
|
||||||
return expand;
|
|
||||||
else if (pendingApproval)
|
|
||||||
return approval;
|
|
||||||
else
|
|
||||||
return collapsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
onCurrentChanged: expanded = false
|
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
|
||||||
Anim {
|
|
||||||
type: Anim.DefaultEffects
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: layout
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
Item {
|
|
||||||
implicitHeight: expandBtn.implicitHeight
|
|
||||||
implicitWidth: expandBtn.implicitWidth
|
|
||||||
|
|
||||||
LoadingIndicator {
|
|
||||||
id: spinnerReasoning
|
|
||||||
|
|
||||||
implicitSize: collapsedText.implicitHeight
|
|
||||||
anchors.centerIn: parent
|
|
||||||
opacity: root.isActive ? 1 : 0
|
|
||||||
visible: opacity > 0
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IconButton {
|
|
||||||
id: expandBtn
|
|
||||||
|
|
||||||
font: Tokens.font.icon.medium
|
|
||||||
icon: "keyboard_arrow_down"
|
|
||||||
inactiveOnColor: hovered ? Colors.palette.m3onSurface : Colors.palette.m3outline
|
|
||||||
anchors.centerIn: parent
|
|
||||||
opacity: root.isActive ? 0 : 1
|
|
||||||
enabled: opacity > 0
|
|
||||||
rotation: root.expanded ? 180 : 0
|
|
||||||
type: IconButton.Text
|
|
||||||
|
|
||||||
Behavior on rotation {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: root.expanded = !root.expanded
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
id: collapsedText
|
|
||||||
|
|
||||||
color: Colors.palette.m3outline
|
|
||||||
font: Tokens.font.label.small
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.leftMargin: Tokens.spacing.medium
|
|
||||||
text: {
|
|
||||||
if (root.isActive) {
|
|
||||||
if (root.pendingApproval)
|
|
||||||
return qsTr("Waiting for approval...");
|
|
||||||
|
|
||||||
if (root.lastSegment.type === LlmSegment.Type.ToolCall)
|
|
||||||
return qsTr("Using %1...").arg(root.lastSegment.name);
|
|
||||||
return qsTr("Thinking...");
|
|
||||||
}
|
|
||||||
return qsTr("Worked for %1s").arg((root.totalElapsedMs / 1000).toFixed(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: approvalPrompt
|
|
||||||
anchors.top: layout.bottom
|
|
||||||
anchors.topMargin: Tokens.spacing.small
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
implicitHeight: approvalLayout.implicitHeight + approvalLayout.anchors.margins * 2
|
|
||||||
visible: root.pendingApproval
|
|
||||||
|
|
||||||
CustomRect {
|
|
||||||
id: approvalBg
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: Tokens.rounding.medium
|
|
||||||
color: Colors.palette.m3surface
|
|
||||||
border.width: 1
|
|
||||||
border.color: Colors.palette.m3outlineVariant
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: approvalLayout
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Tokens.padding.medium
|
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
id: requestHeader
|
|
||||||
text: qsTr("Tool call request")
|
|
||||||
font: Tokens.font.headline.medium
|
|
||||||
color: Colors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: toolsBg
|
|
||||||
|
|
||||||
property bool open: false
|
|
||||||
property Item rootParent: root.rootParent
|
|
||||||
property int maxHeight: rootParent.height - Tokens.padding.medium * 2
|
|
||||||
property int openHeight: Math.min(toolsContent.item?.implicitHeight, maxHeight)
|
|
||||||
property int openWidth: toolsBg.rootParent.width - Tokens.padding.medium * 2
|
|
||||||
property real openHeightProg: openHeight / maxHeight
|
|
||||||
property int collapsedY: 0
|
|
||||||
|
|
||||||
implicitHeight: toolList.implicitHeight + toolList.anchors.margins * 2
|
|
||||||
z: open || dialogTransition.running ? 2 : 0
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
function reparentWrapper(): void {
|
|
||||||
const newParent = open ? toolsBg.rootParent : toolsBg;
|
|
||||||
const c = toolsWrapper.parent.mapToItem(newParent, toolsWrapper.x + toolsWrapper.width / 2, toolsWrapper.y + toolsWrapper.height / 2);
|
|
||||||
toolsBg.collapsedY = toolsWrapper.y;
|
|
||||||
toolsWrapper.parent = newParent;
|
|
||||||
toolsWrapper.x = c.x - toolsWrapper.width / 2;
|
|
||||||
toolsWrapper.y = c.y - toolsWrapper.height / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
onOpenChanged: {
|
|
||||||
if (open)
|
|
||||||
toolsBg.rootParent.interactive = false;
|
|
||||||
else
|
|
||||||
toolsBg.rootParent.interactive = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlobGroup {
|
|
||||||
id: blobGroup
|
|
||||||
|
|
||||||
color: toolsBg.open ? Colors.palette.m3surfaceContainerHighest : Colors.tPalette.m3primaryContainer
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
CAnim {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: backdrop
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
enabled: false
|
|
||||||
hoverEnabled: enabled
|
|
||||||
preventStealing: true
|
|
||||||
parent: toolsBg.open ? toolsBg.rootParent : toolsBg
|
|
||||||
|
|
||||||
onClicked: toolsBg.open = false
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: toolsWrapper
|
|
||||||
|
|
||||||
width: toolsBg.width
|
|
||||||
height: toolBox.implicitHeight
|
|
||||||
rotation: parent === toolsBg.rootParent ? 180 : 0
|
|
||||||
z: 1
|
|
||||||
|
|
||||||
states: State {
|
|
||||||
name: "open"
|
|
||||||
when: toolsBg.open
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
backdrop.enabled: true
|
|
||||||
toolsBackground.bottomLeftRadius: Tokens.rounding.largeIncreased
|
|
||||||
toolsBackground.bottomRightRadius: Tokens.rounding.largeIncreased
|
|
||||||
toolsBackground.topRightRadius: Tokens.rounding.largeIncreased
|
|
||||||
toolsBackground.topLeftRadius: Tokens.rounding.largeIncreased
|
|
||||||
toolsContent.opacity: 1
|
|
||||||
toolsWrapper.height: toolsBg.openHeight
|
|
||||||
toolsWrapper.width: toolsBg.openWidth
|
|
||||||
toolsWrapper.x: (toolsBg.rootParent.width - toolsBg.openWidth) / 2
|
|
||||||
toolsWrapper.y: (confirmationRow.implicitHeight + Tokens.spacing.small + Tokens.padding.medium) * (1 - toolsBg.openHeightProg) + Tokens.padding.medium
|
|
||||||
elevation.opacity: 1
|
|
||||||
toolBox.opacity: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
transitions: Transition {
|
|
||||||
id: dialogTransition
|
|
||||||
|
|
||||||
SequentialAnimation {
|
|
||||||
ScriptAction {
|
|
||||||
script: toolsBg.reparentWrapper()
|
|
||||||
}
|
|
||||||
|
|
||||||
Anim {
|
|
||||||
properties: "x,y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyAction {
|
|
||||||
property: "enabled"
|
|
||||||
}
|
|
||||||
|
|
||||||
Anim {
|
|
||||||
properties: "opacity,topLeftRadius,topRightRadius,bottomLeftRadius,bottomRightRadius"
|
|
||||||
type: Anim.DefaultEffects
|
|
||||||
}
|
|
||||||
|
|
||||||
Anim {
|
|
||||||
properties: "width,height"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Elevation {
|
|
||||||
id: elevation
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
bottomLeftRadius: toolsBackground.bottomLeftRadius
|
|
||||||
bottomRightRadius: toolsBackground.bottomRightRadius
|
|
||||||
level: 4
|
|
||||||
opacity: 0
|
|
||||||
radius: toolsBackground.radius
|
|
||||||
|
|
||||||
transform: Matrix4x4 {
|
|
||||||
matrix: toolsBackground.deformMatrix
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BlobRect {
|
|
||||||
id: toolsBackground
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
bottomLeftRadius: toolsBg.open ? Tokens.rounding.largeIncreased : Tokens.rounding.small
|
|
||||||
bottomRightRadius: toolsBg.open ? Tokens.rounding.largeIncreased : Tokens.rounding.small
|
|
||||||
topRightRadius: toolsBg.open ? Tokens.rounding.largeIncreased : Tokens.rounding.small
|
|
||||||
topLeftRadius: toolsBg.open ? Tokens.rounding.largeIncreased : Tokens.rounding.small
|
|
||||||
deformScale: 0
|
|
||||||
group: blobGroup
|
|
||||||
opacity: blobGroup.color.a * (root.enabled ? 1 : 0.5)
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomRect {
|
|
||||||
id: toolBox
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
height: Math.min(implicitHeight, parent.height)
|
|
||||||
implicitHeight: toolList.implicitHeight + Tokens.padding.medium * 2
|
|
||||||
radius: Tokens.rounding.small
|
|
||||||
|
|
||||||
StateLayer {
|
|
||||||
onClicked: {
|
|
||||||
toolsBg.open = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: toolList
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: Tokens.padding.medium
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
id: repeater
|
|
||||||
|
|
||||||
model: root.current.pendingToolCalls?.slice(0, 4) ?? []
|
|
||||||
|
|
||||||
delegate: RowLayout {
|
|
||||||
id: toolText
|
|
||||||
|
|
||||||
required property LlmSegment modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
spacing: Tokens.spacing.medium
|
|
||||||
|
|
||||||
function toolTarget(seg: LlmSegment): string {
|
|
||||||
var a = null;
|
|
||||||
try {
|
|
||||||
a = JSON.parse(seg.arguments);
|
|
||||||
} catch (e) {}
|
|
||||||
if (a && typeof a === "object") {
|
|
||||||
const v = a.url ?? a.path;
|
|
||||||
if (v !== undefined && v !== null)
|
|
||||||
return String(v);
|
|
||||||
}
|
|
||||||
return String(seg.arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
color: Colors.palette.m3onPrimaryContainer
|
|
||||||
text: toolText.modelData.name === "webfetch" ? "web" : "text_snippet"
|
|
||||||
fill: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
color: Colors.palette.m3onPrimaryContainer
|
|
||||||
text: qsTr("%1").arg(toolText.modelData.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
color: Colors.palette.m3onPrimaryContainer
|
|
||||||
text: "arrow_right_alt"
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
color: Colors.palette.m3onPrimaryContainer
|
|
||||||
text: qsTr("%1").arg(toolText.toolTarget(toolText.modelData))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
color: Colors.palette.m3onPrimaryContainer
|
|
||||||
text: qsTr("And %1 more").arg(root.current.pendingToolCalls.slice(4).length)
|
|
||||||
visible: repeater.count < root.current.pendingToolCalls.length
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: toolsContent
|
|
||||||
|
|
||||||
active: opacity > 0
|
|
||||||
anchors.fill: parent
|
|
||||||
asynchronous: false
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
sourceComponent: MouseArea {
|
|
||||||
onWheel: event => event.accepted = true
|
|
||||||
preventStealing: true
|
|
||||||
implicitHeight: innerLayout.contentHeight + innerLayout.anchors.margins * 2
|
|
||||||
|
|
||||||
VerticalFadeListView {
|
|
||||||
id: innerLayout
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Tokens.padding.small
|
|
||||||
cacheBuffer: height * 10
|
|
||||||
fadeAmount: 0.1
|
|
||||||
fadeEnabled: interactive
|
|
||||||
spacing: 0
|
|
||||||
clip: true
|
|
||||||
interactive: contentHeight > toolsBg.maxHeight
|
|
||||||
|
|
||||||
model: root.current.pendingToolCalls ?? []
|
|
||||||
|
|
||||||
delegate: Item {
|
|
||||||
id: toolCall
|
|
||||||
|
|
||||||
required property LlmSegment modelData
|
|
||||||
property bool expanded: false
|
|
||||||
|
|
||||||
implicitWidth: CustomListView.view.width
|
|
||||||
implicitHeight: collapsedRow.implicitHeight + collapsedRow.anchors.margins + (expanded ? expandedTool.implicitHeight + expandedTool.anchors.margins + expandedTool.anchors.topMargin : collapsedRow.anchors.margins)
|
|
||||||
|
|
||||||
function toolTarget(seg: LlmSegment): string {
|
|
||||||
var a = null;
|
|
||||||
try {
|
|
||||||
a = JSON.parse(seg.arguments);
|
|
||||||
} catch (e) {}
|
|
||||||
if (a && typeof a === "object") {
|
|
||||||
const v = a.url ?? a.path;
|
|
||||||
if (v !== undefined && v !== null)
|
|
||||||
return String(v);
|
|
||||||
}
|
|
||||||
return String(seg.arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: collapsedRow
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Tokens.padding.medium
|
|
||||||
|
|
||||||
IconButton {
|
|
||||||
id: toolExpandBtn
|
|
||||||
|
|
||||||
font: Tokens.font.icon.medium
|
|
||||||
icon: "keyboard_arrow_down"
|
|
||||||
inactiveOnColor: hovered ? Colors.palette.m3onSurface : Colors.palette.m3outline
|
|
||||||
rotation: toolCall.expanded ? 180 : 0
|
|
||||||
type: IconButton.Text
|
|
||||||
|
|
||||||
Behavior on rotation {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: toolCall.expanded = !toolCall.expanded
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
id: preview
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
text: toolCall.modelData.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomClippingRect {
|
|
||||||
id: expandedTool
|
|
||||||
|
|
||||||
anchors.top: collapsedRow.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.margins: Tokens.padding.medium
|
|
||||||
anchors.topMargin: Tokens.spacing.medium
|
|
||||||
|
|
||||||
implicitHeight: fullToolCall.implicitHeight + fullToolCall.anchors.margins * 2
|
|
||||||
radius: Tokens.rounding.medium
|
|
||||||
color: Colors.palette.m3surfaceContainerLow
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
id: fullToolCall
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Tokens.padding.medium
|
|
||||||
|
|
||||||
text: toolCall.toolTarget(toolCall.modelData)
|
|
||||||
wrapMode: CustomText.WrapAtWordBoundaryOrAnywhere
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ButtonRow {
|
|
||||||
id: confirmationRow
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
spacing: Tokens.spacing.medium
|
|
||||||
|
|
||||||
IconTextButton {
|
|
||||||
icon: "check_circle"
|
|
||||||
text: qsTr("Allow")
|
|
||||||
horizontalPadding: Tokens.padding.large
|
|
||||||
verticalPadding: Tokens.padding.small
|
|
||||||
isRound: true
|
|
||||||
shapeMorph: true
|
|
||||||
onClicked: root.current.approveTools()
|
|
||||||
}
|
|
||||||
|
|
||||||
IconTextButton {
|
|
||||||
icon: "cancel"
|
|
||||||
text: qsTr("Deny")
|
|
||||||
isRound: true
|
|
||||||
shapeMorph: true
|
|
||||||
inactiveColor: Colors.palette.m3error
|
|
||||||
inactiveOnColor: Colors.palette.m3onError
|
|
||||||
horizontalPadding: Tokens.padding.large
|
|
||||||
verticalPadding: Tokens.padding.small
|
|
||||||
onClicked: root.current.denyTools()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomClippingRect {
|
|
||||||
id: expandedRect
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: layout.bottom
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.topMargin: Tokens.spacing.small
|
|
||||||
color: Colors.palette.m3surfaceContainerLow
|
|
||||||
implicitHeight: expandedContent.contentHeight + expandedContent.anchors.margins * 2
|
|
||||||
opacity: root.expanded ? 1 : 0
|
|
||||||
radius: Tokens.rounding.medium
|
|
||||||
visible: opacity > 0
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListView {
|
|
||||||
id: expandedContent
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Tokens.padding.medium
|
|
||||||
model: root.segments
|
|
||||||
spacing: Tokens.spacing.medium
|
|
||||||
|
|
||||||
delegate: Item {
|
|
||||||
id: segment
|
|
||||||
|
|
||||||
required property LlmSegment modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
implicitWidth: ListView.view.width
|
|
||||||
implicitHeight: header.implicitHeight + content.implicitHeight + content.anchors.topMargin
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: header
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
text: segment.modelData.type === LlmSegment.Type.Reasoning ? "cognition" : "build"
|
|
||||||
fill: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: segment.modelData.type === LlmSegment.Type.Reasoning ? qsTr("Thought for %1s").arg((segment.modelData.elapsedMs / 1000).toFixed(1)) : qsTr("Used %1 for %2s").arg(segment.modelData.name).arg((segment.modelData.elapsedMs / 1000).toFixed(1))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
id: content
|
|
||||||
|
|
||||||
function toolTarget(seg: LlmSegment): string {
|
|
||||||
var a = null;
|
|
||||||
try {
|
|
||||||
a = JSON.parse(seg.arguments);
|
|
||||||
} catch (e) {}
|
|
||||||
if (a && typeof a === "object") {
|
|
||||||
const v = a.url ?? a.path;
|
|
||||||
if (v !== undefined && v !== null)
|
|
||||||
return String(v);
|
|
||||||
}
|
|
||||||
return String(seg.arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
function prettyTool(seg: LlmSegment): string {
|
|
||||||
if (seg.name === "webfetch") {
|
|
||||||
switch (seg.status) {
|
|
||||||
case LlmSegment.Status.Running:
|
|
||||||
return qsTr("Fetching");
|
|
||||||
case LlmSegment.Status.Pending:
|
|
||||||
return qsTr("Pending fetch");
|
|
||||||
case LlmSegment.Status.Success:
|
|
||||||
return qsTr("Fetched");
|
|
||||||
case LlmSegment.Status.Error:
|
|
||||||
return qsTr("Failed to fetch");
|
|
||||||
default:
|
|
||||||
return qsTr("Fetched website");
|
|
||||||
}
|
|
||||||
} else if (seg.name === "readfile") {
|
|
||||||
switch (seg.status) {
|
|
||||||
case LlmSegment.Status.Running:
|
|
||||||
return qsTr("Reading");
|
|
||||||
case LlmSegment.Status.Pending:
|
|
||||||
return qsTr("Pending read");
|
|
||||||
case LlmSegment.Status.Success:
|
|
||||||
return qsTr("Read");
|
|
||||||
case LlmSegment.Status.Error:
|
|
||||||
return qsTr("Failed to read");
|
|
||||||
default:
|
|
||||||
return qsTr("Read file");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Tokens.padding.small
|
|
||||||
anchors.top: header.bottom
|
|
||||||
anchors.topMargin: Tokens.spacing.small
|
|
||||||
anchors.right: parent.right
|
|
||||||
color: Colors.palette.m3outline
|
|
||||||
font: Tokens.font.body.small
|
|
||||||
wrapMode: CustomText.WrapAtWordBoundaryOrAnywhere
|
|
||||||
text: segment.modelData.type === LlmSegment.Type.Reasoning ? segment.modelData.text : qsTr("%1 %2").arg(content.prettyTool(segment.modelData)).arg(content.toolTarget(segment.modelData))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@ import ZShell.Config
|
|||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property real animPerc: UPower.displayDevice.percentage
|
property real animPerc: UPower.displayDevice.percentage
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import ZShell.Config
|
|||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
CustomRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property color accent
|
required property color accent
|
||||||
@@ -19,15 +19,20 @@ CustomClippingRect {
|
|||||||
implicitWidth: 450
|
implicitWidth: 450
|
||||||
radius: Tokens.rounding.largeIncreased
|
radius: Tokens.rounding.largeIncreased
|
||||||
|
|
||||||
CustomRect {
|
ClipRect {
|
||||||
anchors.bottom: parent.bottom
|
anchors.fill: parent
|
||||||
anchors.left: parent.left
|
radius: parent.radius
|
||||||
anchors.top: parent.top
|
|
||||||
color: Qt.alpha(root.accent, 0.05)
|
|
||||||
implicitWidth: parent.width * root.usage
|
|
||||||
|
|
||||||
Behavior on implicitWidth {
|
CustomRect {
|
||||||
Anim {}
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
color: Qt.alpha(root.accent, 0.05)
|
||||||
|
implicitWidth: parent.width * root.usage
|
||||||
|
|
||||||
|
Behavior on implicitWidth {
|
||||||
|
Anim {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ CustomRect {
|
|||||||
value: Memory.percentage
|
value: Memory.percentage
|
||||||
|
|
||||||
Behavior on clampedVal {
|
Behavior on clampedVal {
|
||||||
Anim {}
|
Anim {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|||||||
@@ -121,6 +121,6 @@ CustomRect {
|
|||||||
|
|
||||||
activeIcon: "storage"
|
activeIcon: "storage"
|
||||||
icon: modelData === Storage.primaryDisk ? "check" : ""
|
icon: modelData === Storage.primaryDisk ? "check" : ""
|
||||||
text: modelData.mount
|
text: modelData.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
import qs.Helpers
|
||||||
|
|
||||||
|
Scope {
|
||||||
|
Component.onCompleted: {
|
||||||
|
Wallpapers;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ CustomRect {
|
|||||||
bottomLeftRadius: last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
bottomLeftRadius: last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
bottomRightRadius: last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
bottomRightRadius: last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
color: Colors.tPalette.m3surfaceContainer
|
color: Colors.tPalette.m3surfaceContainer
|
||||||
opacity: enabled && parent.enabled ? 1 : 0.5
|
opacity: enabled && (parent?.enabled ?? false) ? 1 : 0.5
|
||||||
topLeftRadius: first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
topLeftRadius: first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
topRightRadius: first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
topRightRadius: first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
|
|
||||||
|
|||||||
@@ -141,11 +141,11 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
bottomLeftRadius: root.last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
bottomLeftRadius: root.last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
bottomRightRadius: root.last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
bottomRightRadius: root.last ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
topRightRadius: root.first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
|
||||||
topLeftRadius: root.first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
|
||||||
deformScale: 0
|
deformScale: 0
|
||||||
group: blobGroup
|
group: blobGroup
|
||||||
opacity: blobGroup.color.a * (root.enabled ? 1 : 0.5)
|
opacity: blobGroup.color.a * (root.enabled ? 1 : 0.5)
|
||||||
|
topLeftRadius: root.first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
|
topRightRadius: root.first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall
|
||||||
}
|
}
|
||||||
|
|
||||||
RowButton {
|
RowButton {
|
||||||
@@ -154,11 +154,11 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
first: root.first
|
||||||
height: Math.min(implicitHeight, parent.height)
|
height: Math.min(implicitHeight, parent.height)
|
||||||
icon: root.icon
|
icon: root.icon
|
||||||
subtext: root.subtext
|
|
||||||
last: root.last
|
last: root.last
|
||||||
first: root.first
|
subtext: root.subtext
|
||||||
text: root.label
|
text: root.label
|
||||||
|
|
||||||
transform: Matrix4x4 {
|
transform: Matrix4x4 {
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ ColumnLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalFadeFlickable {
|
CustomFlickable {
|
||||||
id: flickable
|
id: flickable
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
@@ -158,7 +158,8 @@ ColumnLayout {
|
|||||||
|
|
||||||
bottomMargin: Tokens.padding.extraLarge
|
bottomMargin: Tokens.padding.extraLarge
|
||||||
topMargin: Tokens.padding.large
|
topMargin: Tokens.padding.large
|
||||||
fadeAmount: 0.1
|
clip: true
|
||||||
|
// fadeAmount: 0.1
|
||||||
|
|
||||||
contentHeight: root.contentChild?.implicitHeight ?? 0
|
contentHeight: root.contentChild?.implicitHeight ?? 0
|
||||||
contentItem.children: [root.contentChild]
|
contentItem.children: [root.contentChild]
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: Tokens.spacing.small
|
spacing: Tokens.spacing.small
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: imgWrapper
|
id: imgWrapper
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@@ -100,16 +100,13 @@ Item {
|
|||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
Anim {
|
Anim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
@@ -120,9 +117,8 @@ Item {
|
|||||||
Qt.callLater(syncCropToScreen);
|
Qt.callLater(syncCropToScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonRow {
|
Loader {
|
||||||
id: screenSelector
|
id: selectorLoader
|
||||||
|
|
||||||
anchors.bottom: imageSlot.top
|
anchors.bottom: imageSlot.top
|
||||||
anchors.bottomMargin: Tokens.spacing.medium
|
anchors.bottomMargin: Tokens.spacing.medium
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@@ -130,25 +126,32 @@ Item {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: Tokens.padding.extraLarge * 2
|
anchors.rightMargin: Tokens.padding.extraLarge * 2
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
spacing: Tokens.spacing.small
|
|
||||||
|
|
||||||
Repeater {
|
active: wrapper.screens.length > 1
|
||||||
model: wrapper.screens
|
|
||||||
|
|
||||||
delegate: TextButton {
|
sourceComponent: ButtonRow {
|
||||||
required property int index
|
id: screenSelector
|
||||||
readonly property bool isCurrent: wrapper.selectedScreenIndex === index
|
|
||||||
required property var modelData
|
|
||||||
|
|
||||||
fillWidth: true
|
spacing: Tokens.spacing.small
|
||||||
font: Tokens.font.body.builders.large.weight(Font.DemiBold).build()
|
|
||||||
inactiveColor: isCurrent ? Colors.palette.m3primary : Qt.alpha(Colors.palette.m3surfaceContainer, 0.7)
|
|
||||||
inactiveOnColor: isCurrent ? Colors.palette.m3onPrimary : Qt.alpha(Colors.palette.m3onSurface, 0.7)
|
|
||||||
isRound: true
|
|
||||||
shapeMorph: true
|
|
||||||
text: modelData.name
|
|
||||||
|
|
||||||
onClicked: wrapper.selectScreen(index)
|
Repeater {
|
||||||
|
model: wrapper.screens
|
||||||
|
|
||||||
|
delegate: TextButton {
|
||||||
|
required property int index
|
||||||
|
readonly property bool isCurrent: wrapper.selectedScreenIndex === index
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
fillWidth: true
|
||||||
|
font: Tokens.font.body.builders.large.weight(Font.DemiBold).build()
|
||||||
|
inactiveColor: isCurrent ? Colors.palette.m3primary : Qt.alpha(Colors.palette.m3surfaceContainer, 0.7)
|
||||||
|
inactiveOnColor: isCurrent ? Colors.palette.m3onPrimary : Qt.alpha(Colors.palette.m3onSurface, 0.7)
|
||||||
|
isRound: true
|
||||||
|
shapeMorph: true
|
||||||
|
text: modelData.name
|
||||||
|
|
||||||
|
onClicked: wrapper.selectScreen(index)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,9 +225,9 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: wrapper.buttonRowHeight + Tokens.spacing.medium
|
anchors.topMargin: selectorLoader.active ? wrapper.buttonRowHeight + Tokens.spacing.medium : Tokens.spacing.medium
|
||||||
|
|
||||||
CustomClippingRect {
|
ClipRect {
|
||||||
id: fitBox
|
id: fitBox
|
||||||
|
|
||||||
readonly property real aspect: scaledImg.implicitHeight > 0 ? scaledImg.implicitWidth / scaledImg.implicitHeight : 1
|
readonly property real aspect: scaledImg.implicitHeight > 0 ? scaledImg.implicitWidth / scaledImg.implicitHeight : 1
|
||||||
@@ -235,8 +238,6 @@ Item {
|
|||||||
implicitWidth: Math.round(fitW)
|
implicitWidth: Math.round(fitW)
|
||||||
radius: Tokens.rounding.largeIncreased
|
radius: Tokens.rounding.largeIncreased
|
||||||
|
|
||||||
onAspectChanged: console.log(aspect)
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: opacity > 0
|
active: opacity > 0
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -274,6 +275,10 @@ Item {
|
|||||||
retainWhileLoading: true
|
retainWhileLoading: true
|
||||||
smooth: true
|
smooth: true
|
||||||
source: Wallpapers.current
|
source: Wallpapers.current
|
||||||
|
sourceSize.height: {
|
||||||
|
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
|
||||||
|
return imageSlot.height * dpr;
|
||||||
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -355,8 +360,7 @@ Item {
|
|||||||
width: Math.round(baseWidth / zoom)
|
width: Math.round(baseWidth / zoom)
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
CAnim {
|
CAnim {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import qs.Components
|
|||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
CustomClippingRect {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property color blobColor: Colors.tPalette.m3surfaceContainerLow
|
property color blobColor: Colors.tPalette.m3surfaceContainerLow
|
||||||
@@ -21,7 +21,6 @@ CustomClippingRect {
|
|||||||
|
|
||||||
implicitHeight: sState.screen.height * 0.7
|
implicitHeight: sState.screen.height * 0.7
|
||||||
implicitWidth: implicitHeight * ratio
|
implicitWidth: implicitHeight * ratio
|
||||||
radius: Tokens.rounding.largeIncreased + Tokens.padding.small
|
|
||||||
|
|
||||||
Behavior on blobColor {
|
Behavior on blobColor {
|
||||||
CAnim {}
|
CAnim {}
|
||||||
@@ -39,6 +38,7 @@ CustomClippingRect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BlobInvertedRect {
|
BlobInvertedRect {
|
||||||
|
id: blobRect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
borderBottom: Tokens.padding.small
|
borderBottom: Tokens.padding.small
|
||||||
borderLeft: navPane.width + navPane.anchors.margins * 2
|
borderLeft: navPane.width + navPane.anchors.margins * 2
|
||||||
@@ -46,6 +46,8 @@ CustomClippingRect {
|
|||||||
borderTop: Tokens.padding.small
|
borderTop: Tokens.padding.small
|
||||||
group: blobGroup
|
group: blobGroup
|
||||||
opacity: root.blobColor.a
|
opacity: root.blobColor.a
|
||||||
|
// outerRadius: 10
|
||||||
|
outerRadius: Tokens.rounding.largeIncreased + Tokens.padding.small
|
||||||
radius: Tokens.rounding.largeIncreased
|
radius: Tokens.rounding.largeIncreased
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +66,7 @@ CustomClippingRect {
|
|||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: navPane.right
|
anchors.left: navPane.right
|
||||||
anchors.leftMargin: navPane.anchors.margins + anchors.margins
|
anchors.leftMargin: navPane.anchors.margins + anchors.margins
|
||||||
|
anchors.bottomMargin: blobRect.borderBottom
|
||||||
anchors.margins: Tokens.padding.extraLarge
|
anchors.margins: Tokens.padding.extraLarge
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ pragma Singleton
|
|||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Components
|
|
||||||
import ZShell.Config
|
import ZShell.Config
|
||||||
|
import qs.Components
|
||||||
import qs.Modules.Settings.Common
|
import qs.Modules.Settings.Common
|
||||||
import qs.Modules.Settings.Pages
|
import qs.Modules.Settings.Pages
|
||||||
import qs.Modules.Settings.Pages.Wallpaper
|
import qs.Modules.Settings.Pages.Wallpaper
|
||||||
@@ -13,6 +13,7 @@ import qs.Modules.Settings.Pages.Panels
|
|||||||
import qs.Modules.Settings.Pages.Panels.Bar
|
import qs.Modules.Settings.Pages.Panels.Bar
|
||||||
import qs.Modules.Settings.Pages.Panels.Sidebar
|
import qs.Modules.Settings.Pages.Panels.Sidebar
|
||||||
import qs.Modules.Settings.Pages.Services
|
import qs.Modules.Settings.Pages.Services
|
||||||
|
import qs.Modules.Settings.Pages.Network
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
@@ -47,7 +48,27 @@ QtObject {
|
|||||||
|
|
||||||
// Connectivity
|
// Connectivity
|
||||||
Component {
|
Component {
|
||||||
PlaceholderComp {}
|
StackPage {
|
||||||
|
Component {
|
||||||
|
NetworkPage {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
AllNetworks {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
SavedNetworks {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
AddNetwork {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
OldNetwork {}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Component {
|
Component {
|
||||||
PlaceholderComp {}
|
PlaceholderComp {}
|
||||||
|
|||||||
@@ -42,18 +42,6 @@ Item {
|
|||||||
objectName: "PageContainer"
|
objectName: "PageContainer"
|
||||||
|
|
||||||
Component.onCompleted: root.loadPage(root.sState.currentPageIdx)
|
Component.onCompleted: root.loadPage(root.sState.currentPageIdx)
|
||||||
|
|
||||||
// CustomRect {
|
|
||||||
// anchors.fill: parent
|
|
||||||
// color: Qt.alpha(Colors.palette.m3shadow, 0.3)
|
|
||||||
// opacity: root.sState.dimmed ? 1 : 0
|
|
||||||
// visible: opacity > 0
|
|
||||||
// z: 0
|
|
||||||
//
|
|
||||||
// Behavior on opacity {
|
|
||||||
// Anim {}
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ PageBase {
|
|||||||
anchors.leftMargin: Tokens.padding.largeIncreased
|
anchors.leftMargin: Tokens.padding.largeIncreased
|
||||||
anchors.margins: Tokens.padding.small
|
anchors.margins: Tokens.padding.small
|
||||||
anchors.rightMargin: Tokens.padding.largeIncreased
|
anchors.rightMargin: Tokens.padding.largeIncreased
|
||||||
spacing: Tokens.spacing.small
|
spacing: Tokens.spacing.medium
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
implicitSize: Math.round(Tokens.font.icon.large * 1.8)
|
implicitSize: Math.round(Tokens.font.icon.large.pointSize * 1.8)
|
||||||
source: Quickshell.iconPath(appItem.modelData.icon, "image-missing")
|
source: Quickshell.iconPath(appItem.modelData.icon, "image-missing")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user