steal reverse corners from noctalia

This commit is contained in:
lucy 2025-12-24 15:41:03 +01:00
parent 1b51d1a9b3
commit d2a8d0b563
14 changed files with 262 additions and 9 deletions

View File

@ -3,5 +3,5 @@ import QtQuick
QtObject { QtObject {
readonly property string font: "JetBrainsMono Nerd Font" readonly property string font: "JetBrainsMono Nerd Font"
readonly property real fontSize: 12 readonly property real fontSize: 14
} }

View File

@ -1,7 +1,7 @@
import Quickshell import Quickshell
import QtQuick import QtQuick
import qs.modules.bar
import QtQuick.Layouts import QtQuick.Layouts
import qs
PanelWindow { PanelWindow {
id: root id: root

View File

@ -1,6 +1,8 @@
import Quickshell.Services.UPower import Quickshell.Services.UPower
import QtQuick import QtQuick
import Quickshell.Widgets import Quickshell.Widgets
import "."
import qs
Item { Item {
id: root id: root
@ -9,7 +11,7 @@ Item {
Row { Row {
id: batRow id: batRow
anchors.centerIn: parent anchors.centerIn: parent
spacing: 0 spacing: 5
IconImage { IconImage {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
source: "root:/icons/" + UPower.displayDevice.iconName + ".svg" source: "root:/icons/" + UPower.displayDevice.iconName + ".svg"
@ -25,5 +27,26 @@ Item {
color: Colors.foreground color: Colors.foreground
text: Math.round(UPower.displayDevice.percentage * 100) + "%" text: Math.round(UPower.displayDevice.percentage * 100) + "%"
} }
Text {
id: powerProfile
text: PowerProfile.toString(PowerProfiles.profile)
font.weight: 900
color: Colors.foreground
font.family: Appearance.font
font.pixelSize: Appearance.fontSize
}
}
MouseArea {
acceptedButtons: Qt.LeftButton
cursorShape: Qt.OpenHandCursor
anchors.fill: parent
onClicked: {
const modes = [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance];
let current = PowerProfiles.profile;
let currentIndex = modes.indexOf(current);
let nextIndex = (currentIndex + 1) % modes.length;
PowerProfiles.profile = modes[nextIndex];
PowerProfiles.profile = profiles[nextIndex];
}
} }
} }

View File

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs
Item { Item {
id: root id: root

View File

@ -2,6 +2,7 @@ import QtQuick
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import Quickshell.Widgets import Quickshell.Widgets
import Quickshell.Io import Quickshell.Io
import qs
Item { Item {
id: root id: root

View File

@ -1,6 +1,7 @@
import Quickshell.Hyprland import Quickshell.Hyprland
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs
Item { Item {
id: root id: root
@ -14,8 +15,8 @@ Item {
Repeater { Repeater {
id: workspaceRepeater id: workspaceRepeater
Rectangle { Rectangle {
width: 14 width: 16
height: 14 height: 16
radius: 10 radius: 10
//color: modelData.active ? myPallete.accent : myPallete.window //color: modelData.active ? myPallete.accent : myPallete.window
color: modelData.active ? Colors.foreground : "transparent" color: modelData.active ? Colors.foreground : "transparent"

View File

@ -1,7 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.modules.bar import qs
import "." import "."
import QtQuick.Layouts import QtQuick.Layouts
@ -49,16 +49,23 @@ WlrLayershell {
// ... other imports // ... other imports
// Inside your ListView... // Inside your ListView...
model: NotifServer.trackedNotifications
delegate: Item { delegate: Item {
width: ListView.view.width width: ListView.view.width
height: 60 // Fixed height is usually better for icon layouts height: 60 // Fixed height is usually better for icon layouts
required property var modelData required property var modelData
Timer {
id: timout
interval: 5000
running: true
onRunningChanged: modelData.dismiss()
}
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: Colors.background color: Colors.background
radius: 10 radius: 20
border.color: Colors.color5 border.color: Colors.color5
// 2. Use RowLayout to put Image | Text side-by-side // 2. Use RowLayout to put Image | Text side-by-side
@ -124,6 +131,5 @@ WlrLayershell {
} }
} }
} }
model: NotifServer.trackedNotifications
} }
} }

View File

@ -0,0 +1,38 @@
import QtQuick
import Quickshell
import Quickshell.Wayland
import "." // <--- Ensures we can find ScreenCorners.qml
WlrLayershell {
id: overlayRoot
// 1. Fill the entire screen
anchors {
top: true
bottom: true
left: true
right: true
}
// 2. Sit on top of EVERYTHING (even fullscreen apps if compositor allows)
layer: WlrLayer.Overlay
// 3. Invisible background
color: "transparent"
// 4. 👻 GHOST MODE ENABLED 👻
// An empty Region means "I accept mouse events nowhere".
// This guarantees you can click through the black corners.
mask: Region {}
// 5. Load the corners!
ScreenCorners {
// Adjust these to match your screen's aesthetic
cornerRadius: 25
cornerColor: "black"
shouldShow: true
// Ensure it stays on top of any other items in this window
z: 999
}
}

View File

@ -0,0 +1,178 @@
import QtQuick
import QtQuick.Shapes
import qs
// removed "import qs.Commons" because you don't have it!
Item {
id: root
anchors.fill: parent
// ---------------------------------------------------------
// 🛠 CONFIGURATION (Tweaked to match your setup)
// ---------------------------------------------------------
// How round do you want the screen?
property real cornerRadius: 20
// What color should the corners be? (Usually black to match the bezel)
// You can change this to "transparent" or a theme color if you want.
property color cornerColor: Colors.background
// Enable/Disable toggle
property bool shouldShow: true
// ---------------------------------------------------------
// Wrapper with layer caching to reduce GPU usage
Item {
anchors.fill: parent
layer.enabled: true
Shape {
id: cornersShape
anchors.fill: parent
preferredRendererType: Shape.CurveRenderer
enabled: false // Click-through
ShapePath {
id: cornersPath
// Map our local properties to the variables the code expects
readonly property real cornerRadius: root.cornerRadius
readonly property real cornerSize: root.cornerRadius // Usually same as radius
// Margins (Leave 0 unless your bar overlaps)
readonly property real topMargin: 0
readonly property real bottomMargin: 0
readonly property real leftMargin: 0
readonly property real rightMargin: 0
readonly property real screenWidth: cornersShape.width
readonly property real screenHeight: cornersShape.height
strokeWidth: -1 // No outline
fillColor: Colors.background
// Smooth fade if you toggle it
// ==========================================
// 📐 GEOMETRY LOGIC (Untouched)
// ==========================================
// Top-Left
startX: leftMargin
startY: topMargin
PathLine {
relativeX: cornersPath.cornerSize
relativeY: 0
}
PathLine {
relativeX: 0
relativeY: cornersPath.cornerSize - cornersPath.cornerRadius
}
PathArc {
relativeX: -cornersPath.cornerRadius
relativeY: cornersPath.cornerRadius
radiusX: cornersPath.cornerRadius
radiusY: cornersPath.cornerRadius
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: -(cornersPath.cornerSize - cornersPath.cornerRadius)
relativeY: 0
}
PathLine {
relativeX: 0
relativeY: -cornersPath.cornerSize
}
// Top-Right
PathMove {
x: cornersPath.screenWidth - cornersPath.rightMargin - cornersPath.cornerSize
y: cornersPath.topMargin
}
PathLine {
relativeX: cornersPath.cornerSize
relativeY: 0
}
PathLine {
relativeX: 0
relativeY: cornersPath.cornerSize
}
PathLine {
relativeX: -(cornersPath.cornerSize - cornersPath.cornerRadius)
relativeY: 0
}
PathArc {
relativeX: -cornersPath.cornerRadius
relativeY: -cornersPath.cornerRadius
radiusX: cornersPath.cornerRadius
radiusY: cornersPath.cornerRadius
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: 0
relativeY: -(cornersPath.cornerSize - cornersPath.cornerRadius)
}
// Bottom-Left
PathMove {
x: cornersPath.leftMargin
y: cornersPath.screenHeight - cornersPath.bottomMargin - cornersPath.cornerSize
}
PathLine {
relativeX: cornersPath.cornerSize - cornersPath.cornerRadius
relativeY: 0
}
PathArc {
relativeX: cornersPath.cornerRadius
relativeY: cornersPath.cornerRadius
radiusX: cornersPath.cornerRadius
radiusY: cornersPath.cornerRadius
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: 0
relativeY: cornersPath.cornerSize - cornersPath.cornerRadius
}
PathLine {
relativeX: -cornersPath.cornerSize
relativeY: 0
}
PathLine {
relativeX: 0
relativeY: -cornersPath.cornerSize
}
// Bottom-Right
PathMove {
x: cornersPath.screenWidth - cornersPath.rightMargin
y: cornersPath.screenHeight - cornersPath.bottomMargin
}
PathLine {
relativeX: -cornersPath.cornerSize
relativeY: 0
}
PathLine {
relativeX: 0
relativeY: -(cornersPath.cornerSize - cornersPath.cornerRadius)
}
PathArc {
relativeX: cornersPath.cornerRadius
relativeY: -cornersPath.cornerRadius
radiusX: cornersPath.cornerRadius
radiusY: cornersPath.cornerRadius
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: cornersPath.cornerSize - cornersPath.cornerRadius
relativeY: 0
}
PathLine {
relativeX: 0
relativeY: cornersPath.cornerSize
}
}
}
}
}

View File

@ -5,6 +5,7 @@ import Quickshell.Hyprland
import Quickshell.Io import Quickshell.Io
import "." import "."
import qs.modules.bar import qs.modules.bar
import qs
FloatingWindow { FloatingWindow {
id: root id: root

View File

@ -2,10 +2,11 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import "." import "."
import Quickshell.Io import qs
WlrLayershell { WlrLayershell {
id: root id: root
// Inside your Wallpaper Window
// 1. Send it to the bottom of the stack! // 1. Send it to the bottom of the stack!
layer: WlrLayer.Background layer: WlrLayer.Background

View File

@ -1,3 +1,5 @@
singleton WallpaperStore 1.0 WallpaperStore.qml singleton WallpaperStore 1.0 WallpaperStore.qml
Wallpaper 1.0 Wallpaper.qml Wallpaper 1.0 Wallpaper.qml
WallSwitcher 1.0 WallSwitcher.qml WallSwitcher 1.0 WallSwitcher.qml
Overlay 1.0 Overlay.qml
ScreenCorners 1.0 ScreenCorners.qml

View File

@ -22,4 +22,5 @@ Scope {
} }
} }
NotiPopup {} NotiPopup {}
Overlay {}
} }