Merge pull request #10 from ferrreo/lockscreen-fixes

fix: lockscreen fixes + systray
This commit is contained in:
Lysec 2025-07-14 13:56:57 +02:00 committed by GitHub
commit 4baab691f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 55 additions and 36 deletions

View file

@ -100,19 +100,18 @@ Scope {
Brightness { Brightness {
id: widgetsBrightness id: widgetsBrightness
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 1
} }
Volume { Volume {
id: widgetsVolume id: widgetsVolume
shell: rootScope.shell shell: rootScope.shell
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 1
} }
SystemTray { SystemTray {
id: systemTrayModule id: systemTrayModule
shell: rootScope.shell shell: rootScope.shell
anchors.verticalCenter: parent.verticalCenter
bar: panel bar: panel
trayMenu: externalTrayMenu trayMenu: externalTrayMenu
} }
@ -123,7 +122,6 @@ Scope {
ClockWidget { ClockWidget {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 1
} }
PanelPopup { PanelPopup {
@ -133,7 +131,6 @@ Scope {
Button { Button {
barBackground: barBackground barBackground: barBackground
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 1
screen: modelData screen: modelData
sidebarPopup: sidebarPopup sidebarPopup: sidebarPopup
} }

View file

@ -15,12 +15,13 @@ PanelWindow {
implicitHeight: 640 implicitHeight: 640
color: "transparent" color: "transparent"
visible: false visible: false
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: visible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None WlrLayershell.keyboardFocus: visible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
screen: (typeof modelData !== 'undefined' ? modelData : null) screen: (typeof modelData !== 'undefined' ? modelData : null)
property bool shouldBeVisible: false property bool shouldBeVisible: false
anchors.top: true anchors.top: true
margins.top: -26 margins.top: 36
function showAt() { function showAt() {
visible = true; visible = true;

View file

@ -2,8 +2,10 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Quickshell import Quickshell
import Qt5Compat.GraphicalEffects
import Quickshell.Services.SystemTray import Quickshell.Services.SystemTray
import Quickshell.Widgets import Quickshell.Widgets
import qs.Settings
Row { Row {
property var bar property var bar
@ -42,33 +44,44 @@ Row {
} }
} }
IconImage { Rectangle {
id: trayIcon
anchors.centerIn: parent anchors.centerIn: parent
width: 18 width: 16
height: 18 height: 16
smooth: false // Memory savings radius: 6
asynchronous: true color: "transparent"
source: { clip: true
let icon = modelData?.icon || "";
if (!icon) return ""; IconImage {
// Process icon path id: trayIcon
if (icon.includes("?path=")) { anchors.centerIn: parent
const [name, path] = icon.split("?path="); width: 16
const fileName = name.substring(name.lastIndexOf("/") + 1); height: 16
return `file://${path}/${fileName}`; smooth: false
asynchronous: true
backer.fillMode: Image.PreserveAspectFit
source: {
let icon = modelData?.icon || "";
if (!icon) return "";
// Process icon path
if (icon.includes("?path=")) {
const [name, path] = icon.split("?path=");
const fileName = name.substring(name.lastIndexOf("/") + 1);
return `file://${path}/${fileName}`;
}
return icon;
} }
return icon; opacity: status === Image.Ready ? 1 : 0
}
opacity: status === Image.Ready ? 1 : 0 Behavior on opacity {
Behavior on opacity { NumberAnimation {
NumberAnimation { duration: 300
duration: 300 easing.type: Easing.OutCubic
easing.type: Easing.OutCubic }
}
Component.onCompleted: {
} }
}
Component.onCompleted: {
// console.log("Tray icon for", modelData?.id, ":", modelData?.icon)
} }
} }

View file

@ -54,6 +54,7 @@ QtObject {
transitionFps = settings.value("transitionFps", transitionFps) transitionFps = settings.value("transitionFps", transitionFps)
transitionType = settings.value("transitionType", transitionType) transitionType = settings.value("transitionType", transitionType)
transitionDuration = settings.value("transitionDuration", transitionDuration) transitionDuration = settings.value("transitionDuration", transitionDuration)
WallpaperManager.setCurrentWallpaper(currentWallpaper, true);
} }
function saveSettings() { function saveSettings() {

View file

@ -129,9 +129,7 @@ WlSessionLock {
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
source: WallpaperManager.currentWallpaper !== "" ? WallpaperManager.currentWallpaper : "" source: WallpaperManager.currentWallpaper !== "" ? WallpaperManager.currentWallpaper : ""
cache: true cache: true
smooth: true smooth: false
sourceSize.width: 2560
sourceSize.height: 1440
visible: true // Show the original for FastBlur input visible: true // Show the original for FastBlur input
} }
FastBlur { FastBlur {
@ -208,7 +206,7 @@ WlSessionLock {
height: 50 height: 50
radius: 25 radius: 25
color: Theme.surface color: Theme.surface
opacity: 0.3 opacity: passwordInput.activeFocus ? 0.8 : 0.3
border.color: passwordInput.activeFocus ? Theme.accentPrimary : Theme.outline border.color: passwordInput.activeFocus ? Theme.accentPrimary : Theme.outline
border.width: 2 border.width: 2
@ -244,6 +242,10 @@ WlSessionLock {
lock.unlockAttempt() lock.unlockAttempt()
} }
} }
Component.onCompleted: {
forceActiveFocus()
}
} }
} }
@ -268,15 +270,16 @@ WlSessionLock {
width: 120 width: 120
height: 44 height: 44
radius: 22 radius: 22
color: unlockButtonArea.containsMouse ? Theme.accentPrimary : "transparent" opacity: unlockButtonArea.containsMouse ? 0.8 : 0.5
color: unlockButtonArea.containsMouse ? Theme.accentPrimary : Theme.surface
border.color: Theme.accentPrimary border.color: Theme.accentPrimary
border.width: 2 border.width: 2
opacity: lock.authenticating ? 0.5 : 0.8
enabled: !lock.authenticating enabled: !lock.authenticating
Text { Text {
id: unlockButtonText
anchors.centerIn: parent anchors.centerIn: parent
text: lock.authenticating ? "Authenticating..." : "Unlock" text: lock.authenticating ? "..." : "Unlock"
font.family: Theme.fontFamily font.family: Theme.fontFamily
font.pixelSize: 16 font.pixelSize: 16
font.bold: true font.bold: true
@ -293,6 +296,10 @@ WlSessionLock {
} }
} }
} }
Behavior on opacity {
NumberAnimation { duration: 200 }
}
} }
} }