switches and popouts
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Helpers
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: root
|
id: root
|
||||||
@@ -12,62 +11,46 @@ Row {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property alias active: menu.active
|
property alias active: menu.active
|
||||||
property color color: type == CustomSplitButton.Filled ? DynamicColors.palette.m3primary : DynamicColors.palette.m3secondaryContainer
|
property color colour: type == CustomSplitButton.Filled ? DynamicColors.palette.m3primary : DynamicColors.palette.m3secondaryContainer
|
||||||
property bool disabled
|
property bool disabled
|
||||||
property color disabledColor: Qt.alpha(DynamicColors.palette.m3onSurface, 0.1)
|
property color disabledColour: Qt.alpha(DynamicColors.palette.m3onSurface, 0.1)
|
||||||
property color disabledTextColor: Qt.alpha(DynamicColors.palette.m3onSurface, 0.38)
|
property color disabledTextColour: Qt.alpha(DynamicColors.palette.m3onSurface, 0.38)
|
||||||
|
readonly property alias expandBtn: expandBtn
|
||||||
property alias expanded: menu.expanded
|
property alias expanded: menu.expanded
|
||||||
property string fallbackIcon
|
property string fallbackIcon
|
||||||
property string fallbackText
|
property string fallbackText
|
||||||
property real horizontalPadding: Appearance.padding.normal
|
property real horizontalPadding: Appearance.padding.larger
|
||||||
property alias iconLabel: iconLabel
|
readonly property alias iconLabel: iconLabel
|
||||||
property alias label: label
|
readonly property alias label: label
|
||||||
property alias menu: menu
|
readonly property alias menu: menu
|
||||||
property alias menuItems: menu.items
|
property alias menuItems: menu.items
|
||||||
property bool menuOnTop
|
property bool menuOnTop
|
||||||
property alias stateLayer: stateLayer
|
property real minLeftWidth
|
||||||
property color textColor: type == CustomSplitButton.Filled ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSecondaryContainer
|
readonly property alias stateLayer: stateLayer
|
||||||
|
property color textColour: type == CustomSplitButton.Filled ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSecondaryContainer
|
||||||
|
readonly property alias textRow: textRow
|
||||||
property int type: CustomSplitButton.Filled
|
property int type: CustomSplitButton.Filled
|
||||||
property real verticalPadding: Appearance.padding.smaller
|
property real verticalPadding: Appearance.padding.small
|
||||||
|
|
||||||
function closeDropdown(): void {
|
spacing: Math.floor(Appearance.spacing.extraSmall)
|
||||||
SettingsDropdowns.close(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
function openDropdown(): void {
|
|
||||||
SettingsDropdowns.open(menu, root);
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleDropdown(): void {
|
|
||||||
SettingsDropdowns.toggle(menu, root);
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: Math.floor(Appearance.spacing.small / 2)
|
|
||||||
|
|
||||||
onExpandedChanged: {
|
|
||||||
if (!expanded)
|
|
||||||
SettingsDropdowns.forget(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomRect {
|
CustomRect {
|
||||||
bottomRightRadius: Appearance.rounding.small / 2
|
bottomRightRadius: Appearance.rounding.small / 2
|
||||||
color: !root.enabled ? root.disabledColor : root.color
|
color: root.disabled ? root.disabledColour : root.colour
|
||||||
implicitHeight: expandBtn.implicitHeight
|
implicitHeight: expandBtn.implicitHeight
|
||||||
implicitWidth: textRow.implicitWidth + root.horizontalPadding * 2
|
implicitWidth: Math.max(root.minLeftWidth, textRow.implicitWidth + root.horizontalPadding * 2)
|
||||||
radius: implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
|
radius: implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
|
||||||
topRightRadius: Appearance.rounding.small / 2
|
topRightRadius: Appearance.rounding.small / 2
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
id: stateLayer
|
id: stateLayer
|
||||||
|
|
||||||
function onClicked(): void {
|
bottomRightRadius: parent.bottomRightRadius
|
||||||
root.active?.clicked();
|
color: root.textColour
|
||||||
}
|
disabled: root.disabled
|
||||||
|
topRightRadius: parent.topRightRadius
|
||||||
|
|
||||||
color: root.textColor
|
onClicked: root.active?.clicked()
|
||||||
disabled: !root.enabled
|
|
||||||
rect.bottomRightRadius: parent.bottomRightRadius
|
|
||||||
rect.topRightRadius: parent.topRightRadius
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
@@ -82,7 +65,7 @@ Row {
|
|||||||
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
animate: true
|
animate: true
|
||||||
color: !root.enabled ? root.disabledTextColor : root.textColor
|
color: root.disabled ? root.disabledTextColour : root.textColour
|
||||||
fill: 1
|
fill: 1
|
||||||
text: root.active?.activeIcon ?? root.fallbackIcon
|
text: root.active?.activeIcon ?? root.fallbackIcon
|
||||||
}
|
}
|
||||||
@@ -94,12 +77,12 @@ Row {
|
|||||||
Layout.preferredWidth: implicitWidth
|
Layout.preferredWidth: implicitWidth
|
||||||
animate: true
|
animate: true
|
||||||
clip: true
|
clip: true
|
||||||
color: !root.enabled ? root.disabledTextColor : root.textColor
|
color: root.disabled ? root.disabledTextColour : root.textColour
|
||||||
text: root.active?.activeText ?? root.fallbackText
|
text: root.active?.activeText ?? root.fallbackText
|
||||||
|
|
||||||
Behavior on Layout.preferredWidth {
|
Behavior on Layout.preferredWidth {
|
||||||
Anim {
|
Anim {
|
||||||
easing.bezierCurve: Appearance.anim.curves.emphasized
|
type: Anim.Emphasized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +95,7 @@ Row {
|
|||||||
property real rad: root.expanded ? implicitHeight / 2 * Math.min(1, Appearance.rounding.scale) : Appearance.rounding.small / 2
|
property real rad: root.expanded ? implicitHeight / 2 * Math.min(1, Appearance.rounding.scale) : Appearance.rounding.small / 2
|
||||||
|
|
||||||
bottomLeftRadius: rad
|
bottomLeftRadius: rad
|
||||||
color: !root.enabled ? root.disabledColor : root.color
|
color: root.disabled ? root.disabledColour : root.colour
|
||||||
implicitHeight: expandIcon.implicitHeight + root.verticalPadding * 2
|
implicitHeight: expandIcon.implicitHeight + root.verticalPadding * 2
|
||||||
implicitWidth: implicitHeight
|
implicitWidth: implicitHeight
|
||||||
radius: implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
|
radius: implicitHeight / 2 * Math.min(1, Appearance.rounding.scale)
|
||||||
@@ -126,14 +109,12 @@ Row {
|
|||||||
StateLayer {
|
StateLayer {
|
||||||
id: expandStateLayer
|
id: expandStateLayer
|
||||||
|
|
||||||
function onClicked(): void {
|
color: root.textColour
|
||||||
root.toggleDropdown();
|
disabled: root.disabled
|
||||||
}
|
|
||||||
|
|
||||||
color: root.textColor
|
|
||||||
disabled: !root.enabled
|
|
||||||
rect.bottomLeftRadius: parent.bottomLeftRadius
|
rect.bottomLeftRadius: parent.bottomLeftRadius
|
||||||
rect.topLeftRadius: parent.topLeftRadius
|
rect.topLeftRadius: parent.topLeftRadius
|
||||||
|
|
||||||
|
onClicked: root.expanded = !root.expanded
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
@@ -141,7 +122,7 @@ Row {
|
|||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
anchors.horizontalCenterOffset: root.expanded ? 0 : -Math.floor(root.verticalPadding / 4)
|
anchors.horizontalCenterOffset: root.expanded ? 0 : -Math.floor(root.verticalPadding / 4)
|
||||||
color: !root.enabled ? root.disabledTextColor : root.textColor
|
color: root.disabled ? root.disabledTextColour : root.textColour
|
||||||
rotation: root.expanded ? 180 : 0
|
rotation: root.expanded ? 180 : 0
|
||||||
text: "expand_more"
|
text: "expand_more"
|
||||||
|
|
||||||
@@ -154,24 +135,14 @@ Row {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
id: menu
|
id: menu
|
||||||
|
|
||||||
anchors.bottomMargin: Appearance.spacing.small
|
attachSideY: root.menuOnTop ? Menu.Top : Menu.Bottom
|
||||||
anchors.right: parent.right
|
attachTo: expandBtn
|
||||||
anchors.top: parent.bottom
|
marginY: Appearance.spacing.small * (root.menuOnTop ? -1 : 1)
|
||||||
anchors.topMargin: Appearance.spacing.small
|
thisSideY: root.menuOnTop ? Menu.Bottom : Menu.Top
|
||||||
|
|
||||||
states: State {
|
|
||||||
when: root.menuOnTop
|
|
||||||
|
|
||||||
AnchorChanges {
|
|
||||||
anchors.bottom: expandBtn.top
|
|
||||||
anchors.top: undefined
|
|
||||||
target: menu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ Item {
|
|||||||
|
|
||||||
property alias active: splitButton.active
|
property alias active: splitButton.active
|
||||||
property alias buttonAlias: splitButton
|
property alias buttonAlias: splitButton
|
||||||
property bool enabled: true
|
|
||||||
property alias expanded: splitButton.expanded
|
property alias expanded: splitButton.expanded
|
||||||
property int expandedZ: 100
|
property int expandedZ: 100
|
||||||
required property string label
|
required property string label
|
||||||
@@ -25,7 +24,7 @@ Item {
|
|||||||
implicitHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
implicitHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
||||||
opacity: shouldBeActive ? 1 : 0
|
opacity: shouldBeActive ? 1 : 0
|
||||||
scale: shouldBeActive ? 1 : 0.8
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
z: root.expanded ? expandedZ : -1
|
z: splitButton.menu.implicitHeight > 0 ? expandedZ : 1
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -50,7 +49,6 @@ Item {
|
|||||||
color: root.enabled ? DynamicColors.palette.m3onSurface : DynamicColors.palette.m3onSurfaceVariant
|
color: root.enabled ? DynamicColors.palette.m3onSurface : DynamicColors.palette.m3onSurfaceVariant
|
||||||
font.pointSize: Appearance.font.size.larger
|
font.pointSize: Appearance.font.size.larger
|
||||||
text: root.label
|
text: root.label
|
||||||
z: root.expanded ? root.expandedZ : -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomSplitButton {
|
CustomSplitButton {
|
||||||
@@ -58,14 +56,16 @@ Item {
|
|||||||
|
|
||||||
enabled: root.enabled
|
enabled: root.enabled
|
||||||
type: CustomSplitButton.Filled
|
type: CustomSplitButton.Filled
|
||||||
z: root.expanded ? root.expandedZ : -1
|
z: 2
|
||||||
|
|
||||||
menu.onItemSelected: item => {
|
menu.onItemSelected: item => {
|
||||||
root.selected(item);
|
root.selected(item);
|
||||||
splitButton.closeDropdown();
|
// splitButton.closeDropdown();
|
||||||
}
|
}
|
||||||
stateLayer.onClicked: {
|
stateLayer.onClicked: {
|
||||||
splitButton.toggleDropdown();
|
// splitButton.toggleDropdown();
|
||||||
|
splitButton.expanded = !splitButton.expanded;
|
||||||
|
console.log(root.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-12
@@ -1,6 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Templates
|
|
||||||
import QtQuick.Shapes
|
import QtQuick.Shapes
|
||||||
|
import QtQuick.Templates
|
||||||
import qs.Config
|
import qs.Config
|
||||||
|
|
||||||
Switch {
|
Switch {
|
||||||
@@ -13,26 +13,28 @@ Switch {
|
|||||||
|
|
||||||
indicator: CustomRect {
|
indicator: CustomRect {
|
||||||
color: root.checked && root.enabled ? DynamicColors.palette.m3primary : DynamicColors.layer(DynamicColors.palette.m3surfaceContainerHighest, root.cLayer)
|
color: root.checked && root.enabled ? DynamicColors.palette.m3primary : DynamicColors.layer(DynamicColors.palette.m3surfaceContainerHighest, root.cLayer)
|
||||||
implicitHeight: 13 + 7 * 2
|
implicitHeight: Appearance.font.size.medium + Appearance.padding.normal * 2
|
||||||
implicitWidth: implicitHeight * 1.7
|
implicitWidth: implicitHeight * 1.7
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
|
|
||||||
CustomRect {
|
CustomRect {
|
||||||
readonly property real nonAnimWidth: root.pressed ? implicitHeight * 1.3 : implicitHeight
|
readonly property real nonAnimWidth: root.pressed ? implicitHeight * 1.2 : implicitHeight
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
color: root.checked && root.enabled ? DynamicColors.palette.m3onPrimary : DynamicColors.layer(DynamicColors.palette.m3outline, root.cLayer + 1)
|
color: root.checked && root.enabled ? DynamicColors.palette.m3onPrimary : DynamicColors.layer(DynamicColors.palette.m3outline, root.cLayer + 1)
|
||||||
implicitHeight: parent.implicitHeight - 10
|
implicitHeight: parent.implicitHeight - Appearance.padding.extraSmall
|
||||||
implicitWidth: nonAnimWidth
|
implicitWidth: nonAnimWidth
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
x: root.checked ? parent.implicitWidth - nonAnimWidth - 10 / 2 : 10 / 2
|
x: root.checked ? parent.implicitWidth - nonAnimWidth - Appearance.padding.extraSmall / 2 : Appearance.padding.extraSmall / 2
|
||||||
|
|
||||||
Behavior on implicitWidth {
|
Behavior on implicitWidth {
|
||||||
Anim {
|
Anim {
|
||||||
|
type: Anim.FastSpatial
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
Anim {
|
Anim {
|
||||||
|
type: Anim.FastSpatial
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ Switch {
|
|||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {
|
||||||
|
type: Anim.DefaultEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,14 +66,14 @@ Switch {
|
|||||||
}
|
}
|
||||||
property point end2: {
|
property point end2: {
|
||||||
if (root.pressed)
|
if (root.pressed)
|
||||||
return Qt.point(width, height / 2);
|
return Qt.point(width * 0.8, height / 2);
|
||||||
if (root.checked)
|
if (root.checked)
|
||||||
return Qt.point(width * 0.85, height * 0.2);
|
return Qt.point(width * 0.85, height * 0.2);
|
||||||
return Qt.point(width * 0.85, height * 0.15);
|
return Qt.point(width * 0.85, height * 0.15);
|
||||||
}
|
}
|
||||||
property point start1: {
|
property point start1: {
|
||||||
if (root.pressed)
|
if (root.pressed)
|
||||||
return Qt.point(width * 0.1, height / 2);
|
return Qt.point(width * 0.2, height / 2);
|
||||||
if (root.checked)
|
if (root.checked)
|
||||||
return Qt.point(width * 0.15, height / 2);
|
return Qt.point(width * 0.15, height / 2);
|
||||||
return Qt.point(width * 0.15, height * 0.15);
|
return Qt.point(width * 0.15, height * 0.15);
|
||||||
@@ -88,7 +91,7 @@ Switch {
|
|||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
height: parent.implicitHeight - Appearance.padding.small * 2
|
height: parent.implicitHeight - Appearance.padding.larger
|
||||||
preferredRendererType: Shape.CurveRenderer
|
preferredRendererType: Shape.CurveRenderer
|
||||||
width: height
|
width: height
|
||||||
|
|
||||||
@@ -110,7 +113,7 @@ Switch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ShapePath {
|
ShapePath {
|
||||||
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
capStyle: ShapePath.RoundCap
|
||||||
fillColor: "transparent"
|
fillColor: "transparent"
|
||||||
startX: icon.start1.x
|
startX: icon.start1.x
|
||||||
startY: icon.start1.y
|
startY: icon.start1.y
|
||||||
@@ -148,8 +151,7 @@ Switch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
component PropAnim: PropertyAnimation {
|
component PropAnim: PropertyAnimation {
|
||||||
duration: MaterialEasing.expressiveEffectsTime
|
duration: Appearance.anim.durations.expressiveFastSpatial
|
||||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import qs.Config
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
|
import qs.Config
|
||||||
|
|
||||||
RectangularShadow {
|
RectangularShadow {
|
||||||
property real dp: [0, 1, 3, 6, 8, 12][level]
|
property real dp: [0, 1, 3, 6, 8, 12][level]
|
||||||
@@ -13,6 +13,7 @@ RectangularShadow {
|
|||||||
|
|
||||||
Behavior on dp {
|
Behavior on dp {
|
||||||
Anim {
|
Anim {
|
||||||
|
type: Anim.SlowEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+129
-69
@@ -2,109 +2,169 @@ pragma ComponentBehavior: Bound
|
|||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
import qs.Config
|
import qs.Config
|
||||||
|
import qs.Drawers
|
||||||
|
|
||||||
Elevation {
|
MouseArea {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
enum Side {
|
||||||
|
Top,
|
||||||
|
Bottom,
|
||||||
|
Left,
|
||||||
|
Right
|
||||||
|
}
|
||||||
|
|
||||||
property MenuItem active: items[0] ?? null
|
property MenuItem active: items[0] ?? null
|
||||||
|
property int attachSideX: Menu.Right
|
||||||
|
property int attachSideY: Menu.Bottom
|
||||||
|
required property Item attachTo
|
||||||
property bool expanded
|
property bool expanded
|
||||||
property list<MenuItem> items
|
property list<MenuItem> items
|
||||||
|
property real marginX
|
||||||
|
property real marginY
|
||||||
|
property int thisSideX: Menu.Right
|
||||||
|
property int thisSideY: Menu.Top
|
||||||
|
|
||||||
signal itemSelected(item: MenuItem)
|
signal itemSelected(item: MenuItem)
|
||||||
|
|
||||||
implicitHeight: root.expanded ? column.implicitHeight + Appearance.padding.small * 2 : 0
|
anchors.fill: parent
|
||||||
implicitWidth: Math.max(200, column.implicitWidth)
|
enabled: expanded
|
||||||
level: 2
|
layer.enabled: opacity < 1
|
||||||
opacity: root.expanded ? 1 : 0
|
opacity: expanded ? 1 : 0
|
||||||
radius: Appearance.rounding.normal
|
parent: {
|
||||||
|
const win = QsWindow.window;
|
||||||
Behavior on implicitHeight {
|
const contentWin = win as Windows;
|
||||||
Anim {
|
return contentWin ? contentWin.interactionWrapper : (win as QsWindow).contentItem;
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
Anim {
|
Anim {
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
type: Anim.DefaultEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
onClicked: expanded = false
|
||||||
anchors.fill: parent
|
|
||||||
color: DynamicColors.palette.m3surfaceContainer
|
|
||||||
radius: parent.radius
|
|
||||||
|
|
||||||
ColumnLayout {
|
TransformWatcher {
|
||||||
id: column
|
id: watcher
|
||||||
|
|
||||||
anchors.left: parent.left
|
a: root.parent
|
||||||
anchors.right: parent.right
|
b: root.attachTo
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
}
|
||||||
spacing: 5
|
|
||||||
|
|
||||||
Repeater {
|
Elevation {
|
||||||
model: root.items
|
id: menu
|
||||||
|
|
||||||
CustomRect {
|
implicitHeight: column.implicitHeight + column.anchors.margins * 2
|
||||||
id: item
|
implicitWidth: Math.max(200, column.implicitWidth + column.anchors.margins * 2)
|
||||||
|
level: 2
|
||||||
|
radius: Appearance.rounding.medium
|
||||||
|
x: {
|
||||||
|
watcher.transform;
|
||||||
|
const item = root.attachTo;
|
||||||
|
let off = root.attachSideX === Menu.Left ? 0 : item.width;
|
||||||
|
if (root.thisSideX === Menu.Right)
|
||||||
|
off -= width;
|
||||||
|
return item.mapToItem(root.parent, off, 0).x + root.marginX;
|
||||||
|
}
|
||||||
|
y: {
|
||||||
|
watcher.transform;
|
||||||
|
const item = root.attachTo;
|
||||||
|
let off = root.attachSideY === Menu.Top ? 0 : item.height;
|
||||||
|
if (root.thisSideY === Menu.Bottom)
|
||||||
|
off -= height;
|
||||||
|
return item.mapToItem(root.parent, 0, off).y + root.marginY;
|
||||||
|
}
|
||||||
|
|
||||||
readonly property bool active: modelData === root.active
|
transform: Scale {
|
||||||
required property int index
|
origin.y: root.thisSideY === Menu.Bottom ? menu.height : 0
|
||||||
required property MenuItem modelData
|
yScale: root.expanded ? 1 : 0.1
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Behavior on yScale {
|
||||||
implicitHeight: menuOptionRow.implicitHeight + Appearance.padding.normal * 2
|
Anim {
|
||||||
implicitWidth: menuOptionRow.implicitWidth + Appearance.padding.normal * 2
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomRect {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: DynamicColors.palette.m3surfaceContainerLow
|
||||||
|
radius: parent.radius
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: column
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Appearance.padding.extraSmall
|
||||||
|
spacing: Appearance.spacing.extraSmall
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
id: repeater
|
||||||
|
|
||||||
|
model: root.items
|
||||||
|
|
||||||
CustomRect {
|
CustomRect {
|
||||||
anchors.fill: parent
|
id: item
|
||||||
anchors.leftMargin: Appearance.padding.small
|
|
||||||
anchors.rightMargin: Appearance.padding.small
|
readonly property bool active: modelData === root.active
|
||||||
color: Qt.alpha(DynamicColors.palette.m3secondaryContainer, active ? 1 : 0)
|
required property int index
|
||||||
radius: Appearance.rounding.normal - Appearance.padding.small
|
required property MenuItem modelData
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
color: Qt.alpha(DynamicColors.palette.m3tertiaryContainer, active ? 1 : 0)
|
||||||
|
implicitHeight: menuOptionRow.implicitHeight + Appearance.padding.larger * 2
|
||||||
|
implicitWidth: menuOptionRow.implicitWidth + Appearance.padding.larger * 2
|
||||||
|
radius: Appearance.rounding.small
|
||||||
|
|
||||||
|
Behavior on radius {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
function onClicked(): void {
|
color: item.active ? DynamicColors.palette.m3onTertiaryContainer : DynamicColors.palette.m3onSurface
|
||||||
|
disabled: !root.expanded
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
root.itemSelected(item.modelData);
|
root.itemSelected(item.modelData);
|
||||||
root.active = item.modelData;
|
root.active = item.modelData;
|
||||||
|
item.modelData.clicked();
|
||||||
root.expanded = false;
|
root.expanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
color: item.active ? DynamicColors.palette.m3onSecondaryContainer : DynamicColors.palette.m3onSurface
|
|
||||||
disabled: !root.expanded
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: menuOptionRow
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Appearance.padding.normal
|
|
||||||
spacing: Appearance.spacing.small
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
color: item.active ? DynamicColors.palette.m3onSecondaryContainer : DynamicColors.palette.m3onSurfaceVariant
|
|
||||||
text: item.modelData.icon
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
RowLayout {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
id: menuOptionRow
|
||||||
Layout.fillWidth: true
|
|
||||||
color: item.active ? DynamicColors.palette.m3onSecondaryContainer : DynamicColors.palette.m3onSurface
|
|
||||||
text: item.modelData.text
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
anchors.fill: parent
|
||||||
Layout.alignment: Qt.AlignVCenter
|
anchors.margins: Appearance.padding.larger
|
||||||
active: item.modelData.trailingIcon.length > 0
|
spacing: Appearance.spacing.small
|
||||||
visible: active
|
|
||||||
|
|
||||||
sourceComponent: MaterialIcon {
|
MaterialIcon {
|
||||||
color: item.active ? DynamicColors.palette.m3onSecondaryContainer : DynamicColors.palette.m3onSurface
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text: item.modelData.trailingIcon
|
color: item.active ? DynamicColors.palette.m3onTertiaryContainer : DynamicColors.palette.m3onSurfaceVariant
|
||||||
|
text: item.modelData.icon
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
Layout.fillWidth: true
|
||||||
|
color: item.active ? DynamicColors.palette.m3onTertiaryContainer : DynamicColors.palette.m3onSurface
|
||||||
|
text: item.modelData.text
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
active: item.modelData.trailingIcon.length > 0
|
||||||
|
asynchronous: true
|
||||||
|
visible: active
|
||||||
|
|
||||||
|
sourceComponent: MaterialIcon {
|
||||||
|
color: item.active ? DynamicColors.palette.m3onTertiaryContainer : DynamicColors.palette.m3onSurfaceVariant
|
||||||
|
text: item.modelData.trailingIcon
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ JsonObject {
|
|||||||
component FontSize: JsonObject {
|
component FontSize: JsonObject {
|
||||||
property int extraLarge: 28 * scale
|
property int extraLarge: 28 * scale
|
||||||
property int large: 18 * scale
|
property int large: 18 * scale
|
||||||
property int larger: 15 * scale
|
property int larger: 16 * scale
|
||||||
|
property int medium: 14 * scale
|
||||||
property int normal: 13 * scale
|
property int normal: 13 * scale
|
||||||
property real scale: 1
|
property real scale: 1
|
||||||
property int small: 11 * scale
|
property int small: 11 * scale
|
||||||
@@ -76,9 +77,11 @@ JsonObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
component Padding: JsonObject {
|
component Padding: JsonObject {
|
||||||
property int large: 15 * scale
|
property int extraLargeIncreased: 32 * scale
|
||||||
|
property int extraSmall: 4 * scale
|
||||||
|
property int large: 16 * scale
|
||||||
property int larger: 12 * scale
|
property int larger: 12 * scale
|
||||||
property int normal: 9 * scale
|
property int normal: 8 * scale
|
||||||
property real scale: 1
|
property real scale: 1
|
||||||
property int small: 5 * scale
|
property int small: 5 * scale
|
||||||
property int smaller: 7 * scale
|
property int smaller: 7 * scale
|
||||||
@@ -88,6 +91,7 @@ JsonObject {
|
|||||||
property int extraSmall: 4 * scale
|
property int extraSmall: 4 * scale
|
||||||
property int full: 1000 * scale
|
property int full: 1000 * scale
|
||||||
property int large: 24 * scale
|
property int large: 24 * scale
|
||||||
|
property int medium: 16 * scale
|
||||||
property int normal: 18 * scale
|
property int normal: 18 * scale
|
||||||
property real scale: 1
|
property real scale: 1
|
||||||
property int small: 12 * scale
|
property int small: 12 * scale
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: Quickshell.screens
|
||||||
|
|
||||||
|
Scope {
|
||||||
|
id: scope
|
||||||
|
|
||||||
|
required property ShellScreen modelData
|
||||||
|
|
||||||
|
Exclusions {
|
||||||
|
bar: content.bar
|
||||||
|
screen: scope.modelData
|
||||||
|
}
|
||||||
|
|
||||||
|
Windows {
|
||||||
|
id: content
|
||||||
|
|
||||||
|
screen: scope.modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -59,7 +59,7 @@ Item {
|
|||||||
|
|
||||||
cursorShape: (active && centroid.pressPosition.y < root.bar.implicitHeight) ? Qt.ClosedHandCursor : undefined
|
cursorShape: (active && centroid.pressPosition.y < root.bar.implicitHeight) ? Qt.ClosedHandCursor : undefined
|
||||||
dragThreshold: 0
|
dragThreshold: 0
|
||||||
grabPermissions: PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything
|
grabPermissions: PointerHandler.CanTakeOverFromHandlersOfSameType | PointerHandler.ApprovesTakeOverByAnything
|
||||||
maximumPointCount: 1
|
maximumPointCount: 1
|
||||||
minimumPointCount: 1
|
minimumPointCount: 1
|
||||||
target: null
|
target: null
|
||||||
|
|||||||
+343
-358
@@ -9,397 +9,382 @@ import Quickshell.Hyprland
|
|||||||
import ZShell.Blobs
|
import ZShell.Blobs
|
||||||
import qs.Daemons
|
import qs.Daemons
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Modules
|
|
||||||
import qs.Modules.Bar
|
import qs.Modules.Bar
|
||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Drawers
|
import qs.Drawers
|
||||||
|
|
||||||
Variants {
|
CustomWindow {
|
||||||
model: Quickshell.screens
|
id: root
|
||||||
|
|
||||||
Scope {
|
readonly property alias bar: bar
|
||||||
id: scope
|
readonly property bool hasFullscreen: Hypr.monitorFor(screen)?.activeWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen === 2)
|
||||||
|
readonly property alias interactionWrapper: interactions
|
||||||
|
property var root: Quickshell.shellDir
|
||||||
|
|
||||||
required property var modelData
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
|
// WlrLayershell.keyboardFocus: visibilities.dock || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
|
color: "transparent"
|
||||||
|
contentItem.focus: true
|
||||||
|
mask: visibilities.isDrawing ? null : region
|
||||||
|
name: "Bar"
|
||||||
|
|
||||||
Exclusions {
|
contentItem.Keys.onEscapePressed: {
|
||||||
bar: bar
|
if (Config.barConfig.autoHide)
|
||||||
screen: scope.modelData
|
visibilities.bar = false;
|
||||||
|
visibilities.sidebar = false;
|
||||||
|
visibilities.dashboard = false;
|
||||||
|
visibilities.osd = false;
|
||||||
|
visibilities.settings = false;
|
||||||
|
visibilities.resources = false;
|
||||||
|
}
|
||||||
|
onHasFullscreenChanged: {
|
||||||
|
visibilities.launcher = false;
|
||||||
|
visibilities.dashboard = false;
|
||||||
|
visibilities.osd = false;
|
||||||
|
visibilities.settings = false;
|
||||||
|
visibilities.resources = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Region {
|
||||||
|
id: region
|
||||||
|
|
||||||
|
height: root.height - bar.implicitHeight - Config.barConfig.border
|
||||||
|
intersection: Intersection.Xor
|
||||||
|
regions: popoutRegions.instances
|
||||||
|
width: root.width - Config.barConfig.border * 2
|
||||||
|
x: Config.barConfig.border
|
||||||
|
y: bar.implicitHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
bottom: true
|
||||||
|
left: true
|
||||||
|
right: true
|
||||||
|
top: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
id: popoutRegions
|
||||||
|
|
||||||
|
model: panels.children
|
||||||
|
|
||||||
|
Region {
|
||||||
|
required property Item modelData
|
||||||
|
|
||||||
|
height: modelData.height
|
||||||
|
intersection: Intersection.Subtract
|
||||||
|
width: modelData.width
|
||||||
|
x: modelData.x + Config.barConfig.border
|
||||||
|
y: modelData.y + bar.implicitHeight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HyprlandFocusGrab {
|
||||||
|
id: focusGrab
|
||||||
|
|
||||||
|
active: visibilities.dock || visibilities.resources || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || (panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu"))
|
||||||
|
windows: [root]
|
||||||
|
|
||||||
|
onCleared: {
|
||||||
|
visibilities.launcher = false;
|
||||||
|
visibilities.sidebar = false;
|
||||||
|
visibilities.dashboard = false;
|
||||||
|
visibilities.osd = false;
|
||||||
|
visibilities.settings = false;
|
||||||
|
visibilities.resources = false;
|
||||||
|
visibilities.dock = false;
|
||||||
|
panels.popouts.hasCurrent = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PersistentProperties {
|
||||||
|
id: visibilities
|
||||||
|
|
||||||
|
property bool bar
|
||||||
|
property bool dashboard
|
||||||
|
property bool dock
|
||||||
|
property bool isDrawing
|
||||||
|
property bool launcher
|
||||||
|
property bool notif: NotifServer.popups.length > 0
|
||||||
|
property bool osd
|
||||||
|
property bool resources
|
||||||
|
property bool settings
|
||||||
|
property bool sidebar
|
||||||
|
|
||||||
|
Component.onCompleted: Visibilities.load(root.screen, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
IpcHandler {
|
||||||
|
function toggleLauncher(fix: string): void {
|
||||||
|
visibilities.launcher = !visibilities.launcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomWindow {
|
target: "visibilities"
|
||||||
id: win
|
}
|
||||||
|
|
||||||
readonly property bool hasFullscreen: Hypr.monitorFor(screen)?.activeWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen === 2)
|
Binding {
|
||||||
property var root: Quickshell.shellDir
|
property: "bar"
|
||||||
|
target: visibilities
|
||||||
|
value: visibilities.sidebar || visibilities.dashboard || visibilities.osd || (!Config.barConfig.hideWhenNotif && visibilities.notif) || visibilities.resources || visibilities.settings || bar.isHovered
|
||||||
|
when: Config.barConfig.autoHide
|
||||||
|
}
|
||||||
|
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
Item {
|
||||||
// WlrLayershell.keyboardFocus: visibilities.dock || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
anchors.fill: parent
|
||||||
color: "transparent"
|
layer.enabled: true
|
||||||
contentItem.focus: true
|
opacity: Appearance.transparency.enabled ? DynamicColors.transparency.base : 1
|
||||||
mask: visibilities.isDrawing ? null : region
|
|
||||||
name: "Bar"
|
|
||||||
screen: scope.modelData
|
|
||||||
|
|
||||||
contentItem.Keys.onEscapePressed: {
|
layer.effect: MultiEffect {
|
||||||
if (Config.barConfig.autoHide)
|
blurMax: 32
|
||||||
visibilities.bar = false;
|
shadowColor: Qt.alpha(DynamicColors.palette.m3shadow, 1)
|
||||||
visibilities.sidebar = false;
|
shadowEnabled: true
|
||||||
visibilities.dashboard = false;
|
}
|
||||||
visibilities.osd = false;
|
|
||||||
visibilities.settings = false;
|
|
||||||
visibilities.resources = false;
|
|
||||||
}
|
|
||||||
onHasFullscreenChanged: {
|
|
||||||
visibilities.launcher = false;
|
|
||||||
visibilities.dashboard = false;
|
|
||||||
visibilities.osd = false;
|
|
||||||
visibilities.settings = false;
|
|
||||||
visibilities.resources = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Region {
|
BlobGroup {
|
||||||
id: region
|
id: blobGroup
|
||||||
|
|
||||||
height: win.height - bar.implicitHeight - Config.barConfig.border
|
color: DynamicColors.palette.m3surface
|
||||||
intersection: Intersection.Xor
|
smoothing: Config.barConfig.smoothing
|
||||||
regions: popoutRegions.instances
|
|
||||||
width: win.width - Config.barConfig.border * 2
|
|
||||||
x: Config.barConfig.border
|
|
||||||
y: bar.implicitHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
Behavior on color {
|
||||||
bottom: true
|
CAnim {
|
||||||
left: true
|
|
||||||
right: true
|
|
||||||
top: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
|
||||||
id: popoutRegions
|
|
||||||
|
|
||||||
model: panels.children
|
|
||||||
|
|
||||||
Region {
|
|
||||||
required property Item modelData
|
|
||||||
|
|
||||||
height: modelData.height
|
|
||||||
intersection: Intersection.Subtract
|
|
||||||
width: modelData.width
|
|
||||||
x: modelData.x + Config.barConfig.border
|
|
||||||
y: modelData.y + bar.implicitHeight
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HyprlandFocusGrab {
|
BlobInvertedRect {
|
||||||
id: focusGrab
|
anchors.fill: parent
|
||||||
|
anchors.margins: -50
|
||||||
|
borderBottom: Config.barConfig.border - anchors.margins
|
||||||
|
borderLeft: Config.barConfig.border - anchors.margins
|
||||||
|
borderRight: Config.barConfig.border - anchors.margins
|
||||||
|
borderTop: bar.implicitHeight - anchors.margins
|
||||||
|
group: blobGroup
|
||||||
|
radius: Config.barConfig.rounding
|
||||||
|
}
|
||||||
|
|
||||||
active: visibilities.dock || visibilities.resources || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || (panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu"))
|
PanelBg {
|
||||||
windows: [win]
|
id: dashBg
|
||||||
|
|
||||||
onCleared: {
|
property real extraHeight: 0.2
|
||||||
visibilities.launcher = false;
|
|
||||||
visibilities.sidebar = false;
|
deformAmount: 0.06
|
||||||
visibilities.dashboard = false;
|
implicitHeight: panels.dashboard.height * (1 + extraHeight)
|
||||||
visibilities.osd = false;
|
implicitWidth: panels.dashboard.width
|
||||||
visibilities.settings = false;
|
panel: panels.dashboardWrapper
|
||||||
visibilities.resources = false;
|
radius: Appearance.rounding.normal
|
||||||
visibilities.dock = false;
|
x: panels.dashboardWrapper.x + panels.dashboard.x + Config.barConfig.border
|
||||||
panels.popouts.hasCurrent = false;
|
y: panels.dashboardWrapper.y + panels.dashboard.y + bar.implicitHeight - panels.dashboard.height * extraHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: launcherBg
|
||||||
|
|
||||||
|
property real extraHeight: 0.2
|
||||||
|
|
||||||
|
deformAmount: 0.06
|
||||||
|
implicitHeight: panels.launcher.height * (1 + extraHeight)
|
||||||
|
panel: panels.launcher
|
||||||
|
radius: Appearance.rounding.smallest + 5
|
||||||
|
y: panels.launcher.y + bar.implicitHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: sidebarBg
|
||||||
|
|
||||||
|
bottomLeftRadius: 0
|
||||||
|
deformAmount: 0.04
|
||||||
|
exclude: panels.sidebar.offsetScale > 0.08 ? [] : [utilsBg]
|
||||||
|
implicitHeight: panel.height * (1 / rawDeformMatrix.m22) + 2
|
||||||
|
panel: panels.sidebar
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: osdBg
|
||||||
|
|
||||||
|
deformAmount: 0.1
|
||||||
|
implicitHeight: panels.osd.height
|
||||||
|
implicitWidth: panels.osd.width
|
||||||
|
panel: panels.osdWrapper
|
||||||
|
radius: 20
|
||||||
|
x: panels.osdWrapper.x + panels.osd.x + Config.barConfig.border
|
||||||
|
y: panels.osdWrapper.y + panels.osd.y + bar.implicitHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: notifsBg
|
||||||
|
|
||||||
|
panel: panels.notifications
|
||||||
|
radius: Appearance.rounding.normal
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: utilsBg
|
||||||
|
|
||||||
|
deformAmount: panels.sidebar.visible ? (0.1) : (0.1)
|
||||||
|
exclude: panels.sidebar.offsetScale > 0.08 ? [] : [sidebarBg]
|
||||||
|
panel: panels.utilities
|
||||||
|
topLeftRadius: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: popoutBg
|
||||||
|
|
||||||
|
property real extraHeight: panels.popouts.isDetached ? 0 : 0.2
|
||||||
|
|
||||||
|
deformAmount: panels.popouts.isDetached ? 0.05 : panels.popouts.hasCurrent ? 0.15 : 0.1
|
||||||
|
implicitHeight: panels.popouts.height * (1 + extraHeight)
|
||||||
|
implicitWidth: panels.popouts.width
|
||||||
|
panel: panels.popoutsWrapper
|
||||||
|
radius: (panels.popouts.currentName.startsWith("audio") || panels.popouts.currentName.startsWith("updates")) ? Appearance.rounding.normal : 20 * Appearance.rounding.scale
|
||||||
|
x: panels.popoutsWrapper.x + panels.popouts.x + Config.barConfig.border
|
||||||
|
y: panels.popoutsWrapper.y + panels.popouts.y + bar.implicitHeight - panels.popouts.height * extraHeight
|
||||||
|
|
||||||
|
Behavior on extraHeight {
|
||||||
|
Anim {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PersistentProperties {
|
PanelBg {
|
||||||
id: visibilities
|
id: resourcesBg
|
||||||
|
|
||||||
property bool bar
|
deformAmount: 0.05
|
||||||
property bool dashboard
|
implicitHeight: panels.resources.height
|
||||||
property bool dock
|
implicitWidth: panels.resources.width
|
||||||
property bool isDrawing
|
panel: panels.resourcesWrapper
|
||||||
property bool launcher
|
radius: Appearance.rounding.normal
|
||||||
property bool notif: NotifServer.popups.length > 0
|
x: panels.resourcesWrapper.x + panels.resources.x + Config.barConfig.border
|
||||||
property bool osd
|
y: panels.resourcesWrapper.y + panels.resources.y + bar.implicitHeight
|
||||||
property bool resources
|
}
|
||||||
property bool settings
|
|
||||||
property bool sidebar
|
|
||||||
|
|
||||||
Component.onCompleted: Visibilities.load(scope.modelData, this)
|
PanelBg {
|
||||||
|
id: settingsBg
|
||||||
|
|
||||||
|
property real extraHeight: 0.2
|
||||||
|
|
||||||
|
deformAmount: 0.03
|
||||||
|
implicitHeight: panels.settings.height * (1 + extraHeight)
|
||||||
|
implicitWidth: panels.settings.width
|
||||||
|
panel: panels.settings
|
||||||
|
radius: Appearance.rounding.large
|
||||||
|
topLeftRadius: Appearance.rounding.large + Appearance.padding.smaller
|
||||||
|
topRightRadius: Appearance.rounding.large + Appearance.padding.smaller
|
||||||
|
x: panels.settingsWrapper.x + panels.settings.x + Config.barConfig.border
|
||||||
|
y: panels.settingsWrapper.y + panels.settings.y + bar.implicitHeight - panels.settings.height * extraHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: dockBg
|
||||||
|
|
||||||
|
deformAmount: 0.08
|
||||||
|
panel: panels.dock
|
||||||
|
radius: Appearance.rounding.normal
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelBg {
|
||||||
|
id: drawingBg
|
||||||
|
|
||||||
|
deformAmount: 0.08
|
||||||
|
panel: panels.drawing
|
||||||
|
radius: Appearance.rounding.normal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: drawingLoader
|
||||||
|
|
||||||
|
active: visibilities.isDrawing
|
||||||
|
anchors.fill: parent
|
||||||
|
z: 2
|
||||||
|
|
||||||
|
sourceComponent: Drawing {
|
||||||
|
id: drawing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: inputLoader
|
||||||
|
|
||||||
|
active: visibilities.isDrawing
|
||||||
|
anchors.fill: parent
|
||||||
|
z: 2
|
||||||
|
|
||||||
|
sourceComponent: DrawingInput {
|
||||||
|
id: input
|
||||||
|
|
||||||
|
bar: bar
|
||||||
|
drawing: drawingLoader.item
|
||||||
|
panels: panels
|
||||||
|
popout: panels.drawing
|
||||||
|
visibilities: visibilities
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Interactions {
|
||||||
|
id: interactions
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
bar: bar
|
||||||
|
drawing: drawingLoader.item
|
||||||
|
enabled: true
|
||||||
|
input: inputLoader.item
|
||||||
|
panels: panels
|
||||||
|
popouts: panels.popouts
|
||||||
|
screen: root.screen
|
||||||
|
visibilities: visibilities
|
||||||
|
z: 1
|
||||||
|
|
||||||
|
Panels {
|
||||||
|
id: panels
|
||||||
|
|
||||||
|
bar: bar
|
||||||
|
drawingItem: drawingLoader.item
|
||||||
|
screen: root.screen
|
||||||
|
visibilities: visibilities
|
||||||
|
|
||||||
|
dashboard.transform: Matrix4x4 {
|
||||||
|
matrix: dashBg.deformMatrix
|
||||||
}
|
}
|
||||||
|
dock.transform: Matrix4x4 {
|
||||||
IpcHandler {
|
matrix: dockBg.deformMatrix
|
||||||
function toggleLauncher(fix: string): void {
|
|
||||||
visibilities.launcher = !visibilities.launcher;
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "visibilities"
|
|
||||||
}
|
}
|
||||||
|
launcher.transform: Matrix4x4 {
|
||||||
Binding {
|
matrix: launcherBg.deformMatrix
|
||||||
property: "bar"
|
|
||||||
target: visibilities
|
|
||||||
value: visibilities.sidebar || visibilities.dashboard || visibilities.osd || (!Config.barConfig.hideWhenNotif && visibilities.notif) || visibilities.resources || visibilities.settings || bar.isHovered
|
|
||||||
when: Config.barConfig.autoHide
|
|
||||||
}
|
}
|
||||||
|
notifications.transform: Matrix4x4 {
|
||||||
Item {
|
matrix: notifsBg.deformMatrix
|
||||||
anchors.fill: parent
|
|
||||||
layer.enabled: true
|
|
||||||
opacity: Appearance.transparency.enabled ? DynamicColors.transparency.base : 1
|
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
blurMax: 32
|
|
||||||
shadowColor: Qt.alpha(DynamicColors.palette.m3shadow, 1)
|
|
||||||
shadowEnabled: true
|
|
||||||
}
|
|
||||||
|
|
||||||
BlobGroup {
|
|
||||||
id: blobGroup
|
|
||||||
|
|
||||||
color: DynamicColors.palette.m3surface
|
|
||||||
smoothing: Config.barConfig.smoothing
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
CAnim {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BlobInvertedRect {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: -50
|
|
||||||
borderBottom: Config.barConfig.border - anchors.margins
|
|
||||||
borderLeft: Config.barConfig.border - anchors.margins
|
|
||||||
borderRight: Config.barConfig.border - anchors.margins
|
|
||||||
borderTop: bar.implicitHeight - anchors.margins
|
|
||||||
group: blobGroup
|
|
||||||
radius: Config.barConfig.rounding
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: dashBg
|
|
||||||
|
|
||||||
property real extraHeight: 0.2
|
|
||||||
|
|
||||||
deformAmount: 0.06
|
|
||||||
implicitHeight: panels.dashboard.height * (1 + extraHeight)
|
|
||||||
implicitWidth: panels.dashboard.width
|
|
||||||
panel: panels.dashboardWrapper
|
|
||||||
radius: Appearance.rounding.normal
|
|
||||||
x: panels.dashboardWrapper.x + panels.dashboard.x + Config.barConfig.border
|
|
||||||
y: panels.dashboardWrapper.y + panels.dashboard.y + bar.implicitHeight - panels.dashboard.height * extraHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: launcherBg
|
|
||||||
|
|
||||||
property real extraHeight: 0.2
|
|
||||||
|
|
||||||
deformAmount: 0.06
|
|
||||||
implicitHeight: panels.launcher.height * (1 + extraHeight)
|
|
||||||
panel: panels.launcher
|
|
||||||
radius: Appearance.rounding.smallest + 5
|
|
||||||
y: panels.launcher.y + bar.implicitHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: sidebarBg
|
|
||||||
|
|
||||||
bottomLeftRadius: 0
|
|
||||||
deformAmount: 0.04
|
|
||||||
exclude: panels.sidebar.offsetScale > 0.08 ? [] : [utilsBg]
|
|
||||||
implicitHeight: panel.height * (1 / rawDeformMatrix.m22) + 2
|
|
||||||
panel: panels.sidebar
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: osdBg
|
|
||||||
|
|
||||||
deformAmount: 0.1
|
|
||||||
implicitHeight: panels.osd.height
|
|
||||||
implicitWidth: panels.osd.width
|
|
||||||
panel: panels.osdWrapper
|
|
||||||
radius: 20
|
|
||||||
x: panels.osdWrapper.x + panels.osd.x + Config.barConfig.border
|
|
||||||
y: panels.osdWrapper.y + panels.osd.y + bar.implicitHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: notifsBg
|
|
||||||
|
|
||||||
panel: panels.notifications
|
|
||||||
radius: Appearance.rounding.normal
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: utilsBg
|
|
||||||
|
|
||||||
deformAmount: panels.sidebar.visible ? (0.1) : (0.1)
|
|
||||||
exclude: panels.sidebar.offsetScale > 0.08 ? [] : [sidebarBg]
|
|
||||||
panel: panels.utilities
|
|
||||||
topLeftRadius: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: popoutBg
|
|
||||||
|
|
||||||
property real extraHeight: panels.popouts.isDetached ? 0 : 0.2
|
|
||||||
|
|
||||||
deformAmount: panels.popouts.isDetached ? 0.05 : panels.popouts.hasCurrent ? 0.15 : 0.1
|
|
||||||
implicitHeight: panels.popouts.height * (1 + extraHeight)
|
|
||||||
implicitWidth: panels.popouts.width
|
|
||||||
panel: panels.popoutsWrapper
|
|
||||||
radius: (panels.popouts.currentName.startsWith("audio") || panels.popouts.currentName.startsWith("updates")) ? Appearance.rounding.normal : 20 * Appearance.rounding.scale
|
|
||||||
x: panels.popoutsWrapper.x + panels.popouts.x + Config.barConfig.border
|
|
||||||
y: panels.popoutsWrapper.y + panels.popouts.y + bar.implicitHeight - panels.popouts.height * extraHeight
|
|
||||||
|
|
||||||
Behavior on extraHeight {
|
|
||||||
Anim {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: resourcesBg
|
|
||||||
|
|
||||||
deformAmount: 0.05
|
|
||||||
implicitHeight: panels.resources.height
|
|
||||||
implicitWidth: panels.resources.width
|
|
||||||
panel: panels.resourcesWrapper
|
|
||||||
radius: Appearance.rounding.normal
|
|
||||||
x: panels.resourcesWrapper.x + panels.resources.x + Config.barConfig.border
|
|
||||||
y: panels.resourcesWrapper.y + panels.resources.y + bar.implicitHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: settingsBg
|
|
||||||
|
|
||||||
property real extraHeight: 0.2
|
|
||||||
|
|
||||||
deformAmount: 0.03
|
|
||||||
implicitHeight: panels.settings.height * (1 + extraHeight)
|
|
||||||
implicitWidth: panels.settings.width
|
|
||||||
panel: panels.settings
|
|
||||||
radius: Appearance.rounding.large
|
|
||||||
topLeftRadius: Appearance.rounding.large + Appearance.padding.smaller
|
|
||||||
topRightRadius: Appearance.rounding.large + Appearance.padding.smaller
|
|
||||||
x: panels.settingsWrapper.x + panels.settings.x + Config.barConfig.border
|
|
||||||
y: panels.settingsWrapper.y + panels.settings.y + bar.implicitHeight - panels.settings.height * extraHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: dockBg
|
|
||||||
|
|
||||||
deformAmount: 0.08
|
|
||||||
panel: panels.dock
|
|
||||||
radius: Appearance.rounding.normal
|
|
||||||
}
|
|
||||||
|
|
||||||
PanelBg {
|
|
||||||
id: drawingBg
|
|
||||||
|
|
||||||
deformAmount: 0.08
|
|
||||||
panel: panels.drawing
|
|
||||||
radius: Appearance.rounding.normal
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
osd.transform: Matrix4x4 {
|
||||||
Loader {
|
matrix: osdBg.deformMatrix
|
||||||
id: drawingLoader
|
|
||||||
|
|
||||||
active: visibilities.isDrawing
|
|
||||||
anchors.fill: parent
|
|
||||||
z: 2
|
|
||||||
|
|
||||||
sourceComponent: Drawing {
|
|
||||||
id: drawing
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
popouts.transform: Matrix4x4 {
|
||||||
Loader {
|
matrix: popoutBg.deformMatrix
|
||||||
id: inputLoader
|
|
||||||
|
|
||||||
active: visibilities.isDrawing
|
|
||||||
anchors.fill: parent
|
|
||||||
z: 2
|
|
||||||
|
|
||||||
sourceComponent: DrawingInput {
|
|
||||||
id: input
|
|
||||||
|
|
||||||
bar: bar
|
|
||||||
drawing: drawingLoader.item
|
|
||||||
panels: panels
|
|
||||||
popout: panels.drawing
|
|
||||||
visibilities: visibilities
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
resources.transform: Matrix4x4 {
|
||||||
Interactions {
|
matrix: resourcesBg.deformMatrix
|
||||||
id: mouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
bar: bar
|
|
||||||
drawing: drawingLoader.item
|
|
||||||
enabled: true
|
|
||||||
input: inputLoader.item
|
|
||||||
panels: panels
|
|
||||||
popouts: panels.popouts
|
|
||||||
screen: scope.modelData
|
|
||||||
visibilities: visibilities
|
|
||||||
z: 1
|
|
||||||
|
|
||||||
Panels {
|
|
||||||
id: panels
|
|
||||||
|
|
||||||
bar: bar
|
|
||||||
drawingItem: drawingLoader.item
|
|
||||||
screen: scope.modelData
|
|
||||||
visibilities: visibilities
|
|
||||||
|
|
||||||
dashboard.transform: Matrix4x4 {
|
|
||||||
matrix: dashBg.deformMatrix
|
|
||||||
}
|
|
||||||
dock.transform: Matrix4x4 {
|
|
||||||
matrix: dockBg.deformMatrix
|
|
||||||
}
|
|
||||||
launcher.transform: Matrix4x4 {
|
|
||||||
matrix: launcherBg.deformMatrix
|
|
||||||
}
|
|
||||||
notifications.transform: Matrix4x4 {
|
|
||||||
matrix: notifsBg.deformMatrix
|
|
||||||
}
|
|
||||||
osd.transform: Matrix4x4 {
|
|
||||||
matrix: osdBg.deformMatrix
|
|
||||||
}
|
|
||||||
popouts.transform: Matrix4x4 {
|
|
||||||
matrix: popoutBg.deformMatrix
|
|
||||||
}
|
|
||||||
resources.transform: Matrix4x4 {
|
|
||||||
matrix: resourcesBg.deformMatrix
|
|
||||||
}
|
|
||||||
settings.transform: Matrix4x4 {
|
|
||||||
matrix: settingsBg.deformMatrix
|
|
||||||
}
|
|
||||||
sidebar.transform: Matrix4x4 {
|
|
||||||
matrix: sidebarBg.deformMatrix
|
|
||||||
}
|
|
||||||
utilities.transform: Matrix4x4 {
|
|
||||||
matrix: utilsBg.deformMatrix
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BarLoader {
|
|
||||||
id: bar
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
popouts: panels.popouts
|
|
||||||
popoutsWrapper: panels.popoutsWrapper
|
|
||||||
screen: scope.modelData
|
|
||||||
visibilities: visibilities
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
settings.transform: Matrix4x4 {
|
||||||
|
matrix: settingsBg.deformMatrix
|
||||||
|
}
|
||||||
|
sidebar.transform: Matrix4x4 {
|
||||||
|
matrix: sidebarBg.deformMatrix
|
||||||
|
}
|
||||||
|
utilities.transform: Matrix4x4 {
|
||||||
|
matrix: utilsBg.deformMatrix
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BarLoader {
|
||||||
|
id: bar
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
popouts: panels.popouts
|
||||||
|
popoutsWrapper: panels.popoutsWrapper
|
||||||
|
screen: root.screen
|
||||||
|
visibilities: visibilities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ SettingsPage {
|
|||||||
|
|
||||||
SettingsSection {
|
SettingsSection {
|
||||||
sectionId: "Color"
|
sectionId: "Color"
|
||||||
|
z: 1
|
||||||
|
|
||||||
SettingsHeader {
|
SettingsHeader {
|
||||||
name: "Color"
|
name: "Color"
|
||||||
@@ -105,7 +106,6 @@ SettingsPage {
|
|||||||
active: root.schemeTypeItem(menuItems, Config.colors.schemeType)
|
active: root.schemeTypeItem(menuItems, Config.colors.schemeType)
|
||||||
enabled: Config.general.color.schemeGeneration
|
enabled: Config.general.color.schemeGeneration
|
||||||
label: qsTr("Scheme type")
|
label: qsTr("Scheme type")
|
||||||
z: 2
|
|
||||||
|
|
||||||
menuItems: [
|
menuItems: [
|
||||||
MenuItem {
|
MenuItem {
|
||||||
@@ -250,7 +250,6 @@ SettingsPage {
|
|||||||
|
|
||||||
SettingsSection {
|
SettingsSection {
|
||||||
sectionId: "Default Apps"
|
sectionId: "Default Apps"
|
||||||
z: -1
|
|
||||||
|
|
||||||
SettingsHeader {
|
SettingsHeader {
|
||||||
name: "Default Apps"
|
name: "Default Apps"
|
||||||
|
|||||||
Reference in New Issue
Block a user