diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-10-04 18:12:25 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-10-04 18:12:25 +0800 |
| commit | cc70dc5e0e7f9444c4ae1a5c6cd3d9300b2c3ae3 (patch) | |
| tree | e58e181c580ee4c9a7f01e326e5bf90ed8282fa3 | |
| parent | 1aed1c0b13fb5a7e3ec2f19b9ef1403623d18123 (diff) | |
basic stepping stone
| -rw-r--r-- | Global.qml | 16 | ||||
| -rw-r--r-- | bar/Bar.qml | 14 | ||||
| -rw-r--r-- | bar/TimeDate.qml | 3 | ||||
| -rw-r--r-- | config/CC.qml | 28 | ||||
| -rw-r--r-- | popups/CC/CC.qml | 59 | ||||
| -rw-r--r-- | shell.qml | 8 |
6 files changed, 125 insertions, 3 deletions
diff --git a/Global.qml b/Global.qml new file mode 100644 index 0000000..1e5d10c --- /dev/null +++ b/Global.qml @@ -0,0 +1,16 @@ +pragma Singleton + +import Quickshell + +Singleton { + PersistentProperties { + id: ccProp + reloadableId: "ccLoaderProp" + + property int x + property int y + property bool active: false + } + + property alias ccProp: ccProp +} diff --git a/bar/Bar.qml b/bar/Bar.qml index 70a633c..5e4523d 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -4,6 +4,8 @@ import QtQuick.Layouts import qs.components import qs.config +import ".." + Scope { id: root @@ -154,6 +156,15 @@ Scope { easing.type: Easing.InOutQuad } } + MouseArea { + anchors.fill: parent + onPressed: { + Global.ccProp.active = !Global.ccProp.active; + let pos = parent.mapToGlobal(0, 0); + Global.ccProp.x = pos.x; + Global.ccProp.y = pos.y; + } + } } } } @@ -168,8 +179,9 @@ Scope { } MouseArea { anchors.fill: parent - cursorShape: Qt.PointingHandCursor hoverEnabled: true + cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.NoButton // propagate to timedate onEntered: { timeDateCC.showcc = true; } diff --git a/bar/TimeDate.qml b/bar/TimeDate.qml index 3f557c6..20bf446 100644 --- a/bar/TimeDate.qml +++ b/bar/TimeDate.qml @@ -10,8 +10,8 @@ Item { implicitWidth: layout.implicitWidth implicitHeight: layout.implicitHeight + property bool isAlt: false - property bool isCollapsed: false RowLayout { id: layout @@ -110,7 +110,6 @@ Item { } MouseArea { anchors.fill: parent - cursorShape: Qt.PointingHandCursor onPressed: { root.isAlt = !root.isAlt; } diff --git a/config/CC.qml b/config/CC.qml new file mode 100644 index 0000000..9fdc2b9 --- /dev/null +++ b/config/CC.qml @@ -0,0 +1,28 @@ +pragma Singleton + +import Quickshell + +Singleton { + id: root + + readonly property int width: 500 + readonly property int height: 700 + + readonly property int innerMargin: 10 + + readonly property int borderRadius: Style.rounding.large + readonly property int borderWidth: 1 + + readonly property int widgetRadius: Style.rounding.small + readonly property int widgetFontSize: Style.font.size.large + + readonly property double bgTransparency: 0.4 + readonly property double widgetBgTransparency: 0.3 + readonly property double widgetTitleBgTransparency: 0.2 // as it's on top of it + + readonly property bool showWidgetTitle: false + + readonly property int topMargin: 400 + + readonly property int predictiveCompletionRadius: 6 +} diff --git a/popups/CC/CC.qml b/popups/CC/CC.qml new file mode 100644 index 0000000..73cdc80 --- /dev/null +++ b/popups/CC/CC.qml @@ -0,0 +1,59 @@ +import ".." +import "../.." +import qs.components +import qs.config +import Quickshell +import QtQuick +import Quickshell.Hyprland + +IPopup { + id: root + anchors.top: true + anchors.left: true + + name: "quickshell::CC" + implicitWidth: Global.ccProp.x + implicitHeight: Global.ccProp.y + CC.height * 2 + Bar.topMargin * 2 + + aboveWindows: true + exclusionMode: ExclusionMode.Ignore + + mask: Region { + item: rect + } + + IRect { + id: rect + + x: Global.ccProp.x - CC.width + y: Bar.height + Bar.topMargin * 2 + width: CC.width + height: CC.height + + color: Qt.rgba(Colors.background1.r, Colors.background1.g, Colors.background1.b, CC.bgTransparency) + radius: CC.borderRadius + + anchors.margins: 560 + + IRect { + id: container + color: "transparent" + anchors { + fill: parent + margins: CC.innerMargin + } + + IText { + text: "hiasdfkjhadslkfasdjkflhj" + } + } + } + + HyprlandFocusGrab { + active: true + windows: [root] + onCleared: { + parentLoader.active = false; // or active = true again + } + } +} @@ -2,6 +2,7 @@ import Quickshell import Quickshell.Io import "bar" import "popups/launcher" +import "popups/CC" import QtQuick @@ -27,6 +28,13 @@ Scope { parentLoader: loaderProp } } + LazyLoader { + active: Global.ccProp.active + + component: CC { + parentLoader: Global.ccProp + } + } IpcHandler { target: "qs" |
