steal reverse corners from noctalia
This commit is contained in:
parent
1b51d1a9b3
commit
d2a8d0b563
@ -3,5 +3,5 @@ import QtQuick
|
||||
|
||||
QtObject {
|
||||
readonly property string font: "JetBrainsMono Nerd Font"
|
||||
readonly property real fontSize: 12
|
||||
readonly property real fontSize: 14
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import qs.modules.bar
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import Quickshell.Services.UPower
|
||||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import "."
|
||||
import qs
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@ -9,7 +11,7 @@ Item {
|
||||
Row {
|
||||
id: batRow
|
||||
anchors.centerIn: parent
|
||||
spacing: 0
|
||||
spacing: 5
|
||||
IconImage {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
source: "root:/icons/" + UPower.displayDevice.iconName + ".svg"
|
||||
@ -25,5 +27,26 @@ Item {
|
||||
color: Colors.foreground
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
@ -2,6 +2,7 @@ import QtQuick
|
||||
import Quickshell.Services.Pipewire
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Io
|
||||
import qs
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import Quickshell.Hyprland
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@ -14,8 +15,8 @@ Item {
|
||||
Repeater {
|
||||
id: workspaceRepeater
|
||||
Rectangle {
|
||||
width: 14
|
||||
height: 14
|
||||
width: 16
|
||||
height: 16
|
||||
radius: 10
|
||||
//color: modelData.active ? myPallete.accent : myPallete.window
|
||||
color: modelData.active ? Colors.foreground : "transparent"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.modules.bar
|
||||
import qs
|
||||
import "."
|
||||
import QtQuick.Layouts
|
||||
|
||||
@ -49,16 +49,23 @@ WlrLayershell {
|
||||
// ... other imports
|
||||
|
||||
// Inside your ListView...
|
||||
model: NotifServer.trackedNotifications
|
||||
delegate: Item {
|
||||
width: ListView.view.width
|
||||
height: 60 // Fixed height is usually better for icon layouts
|
||||
|
||||
required property var modelData
|
||||
Timer {
|
||||
id: timout
|
||||
interval: 5000
|
||||
running: true
|
||||
onRunningChanged: modelData.dismiss()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Colors.background
|
||||
radius: 10
|
||||
radius: 20
|
||||
border.color: Colors.color5
|
||||
|
||||
// 2. Use RowLayout to put Image | Text side-by-side
|
||||
@ -124,6 +131,5 @@ WlrLayershell {
|
||||
}
|
||||
}
|
||||
}
|
||||
model: NotifServer.trackedNotifications
|
||||
}
|
||||
}
|
||||
|
||||
38
modules/wallpaper/Overlay.qml
Normal file
38
modules/wallpaper/Overlay.qml
Normal 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
|
||||
}
|
||||
}
|
||||
178
modules/wallpaper/ScreenCorners.qml
Normal file
178
modules/wallpaper/ScreenCorners.qml
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
import "."
|
||||
import qs.modules.bar
|
||||
import qs
|
||||
|
||||
FloatingWindow {
|
||||
id: root
|
||||
|
||||
@ -2,10 +2,11 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "."
|
||||
import Quickshell.Io
|
||||
import qs
|
||||
|
||||
WlrLayershell {
|
||||
id: root
|
||||
// Inside your Wallpaper Window
|
||||
|
||||
// 1. Send it to the bottom of the stack!
|
||||
layer: WlrLayer.Background
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
singleton WallpaperStore 1.0 WallpaperStore.qml
|
||||
Wallpaper 1.0 Wallpaper.qml
|
||||
WallSwitcher 1.0 WallSwitcher.qml
|
||||
Overlay 1.0 Overlay.qml
|
||||
ScreenCorners 1.0 ScreenCorners.qml
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user