Removed NLoader in favor of Loader, as it was not doing anything anymore
This commit is contained in:
parent
c6eb613e38
commit
caffbe45e0
10 changed files with 65 additions and 115 deletions
|
|
@ -4,7 +4,10 @@ import Quickshell.Wayland
|
|||
import qs.Commons
|
||||
import qs.Services
|
||||
|
||||
Variants {
|
||||
Loader {
|
||||
active: !Settings.data.wallpaper.swww.enabled
|
||||
|
||||
sourceComponent: Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
delegate: PanelWindow {
|
||||
|
|
@ -49,4 +52,5 @@ Variants {
|
|||
mipmap: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import qs.Commons
|
|||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
NLoader {
|
||||
Loader {
|
||||
active: CompositorService.isNiri
|
||||
|
||||
Component.onCompleted: {
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ import qs.Commons
|
|||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
NLoader {
|
||||
isLoaded: Settings.data.general.showScreenCorners
|
||||
Loader {
|
||||
active: Settings.data.general.showScreenCorners
|
||||
|
||||
content: Variants {
|
||||
sourceComponent: Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ Item {
|
|||
|
||||
onClicked: {
|
||||
settingsPanel.requestedTab = SettingsPanel.Tab.Brightness
|
||||
settingsPanel.isLoaded = true
|
||||
settingsPanel.open(screen)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,26 +14,5 @@ NIconButton {
|
|||
colorBorderHover: Color.transparent
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: {
|
||||
sidePanel.toggle(screen)
|
||||
// sidePanel.isLoaded = !sidePanel.isLoaded
|
||||
// Logger.log("SidePanelToggle", sidePanel.isLoaded)
|
||||
// // Map this button's center to the screen and open the side panel below it
|
||||
// const localCenterX = width / 2
|
||||
// const localCenterY = height / 2
|
||||
// const globalPoint = mapToItem(null, localCenterX, localCenterY)
|
||||
// if (sidePanel.isLoaded) {
|
||||
// // Call hide() instead of directly setting isLoaded to false
|
||||
// if (sidePanel.item && sidePanel.item.hide) {
|
||||
// sidePanel.item.hide()
|
||||
// } else {
|
||||
// sidePanel.isLoaded = false
|
||||
// }
|
||||
// } else if (sidePanel.openAt) {
|
||||
// sidePanel.openAt(globalPoint.x, screen)
|
||||
// } else {
|
||||
// // Fallback: toggle if API unavailable
|
||||
// sidePanel.isLoaded = true
|
||||
// }
|
||||
}
|
||||
onClicked: sidePanel.toggle(screen)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import qs.Commons
|
|||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
NLoader {
|
||||
isLoaded: (Settings.data.dock.monitors.length > 0)
|
||||
content: Component {
|
||||
Loader {
|
||||
active: (Settings.data.dock.monitors.length > 0)
|
||||
sourceComponent: Component {
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ Item {
|
|||
function toggle() {
|
||||
// Only lock if not already locked (prevents the red screen issue)
|
||||
// Note: No unlock via IPC for security reasons
|
||||
if (!lockScreen.isLoaded) {
|
||||
lockScreen.isLoaded = true
|
||||
if (!lockScreen.active) {
|
||||
lockScreen.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,13 @@ import qs.Commons
|
|||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
NLoader {
|
||||
Loader {
|
||||
id: lockScreen
|
||||
active: false
|
||||
|
||||
// Log state changes to help debug lock screen issues
|
||||
onIsLoadedChanged: {
|
||||
Logger.log("LockScreen", "State changed - isLoaded:", isLoaded)
|
||||
onActiveChanged: {
|
||||
Logger.log("LockScreen", "State changed:", active)
|
||||
}
|
||||
|
||||
// Allow a small grace period after unlocking so the compositor releases the lock surfaces
|
||||
|
|
@ -26,23 +27,28 @@ NLoader {
|
|||
interval: 250
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
Logger.log("LockScreen", "Unload timer triggered - setting isLoaded to false")
|
||||
lockScreen.isLoaded = false
|
||||
Logger.log("LockScreen", "Unload timer triggered - deactivating")
|
||||
lockScreen.active = false
|
||||
}
|
||||
}
|
||||
function scheduleUnloadAfterUnlock() {
|
||||
Logger.log("LockScreen", "Scheduling unload after unlock")
|
||||
unloadAfterUnlockTimer.start()
|
||||
}
|
||||
content: Component {
|
||||
sourceComponent: Component {
|
||||
WlSessionLock {
|
||||
id: lock
|
||||
|
||||
// Tie session lock to loader visibility
|
||||
locked: lockScreen.isLoaded
|
||||
locked: lockScreen.active
|
||||
|
||||
// Lockscreen is a different beast, needs a capital 'S' in 'Screen' to access the current screen
|
||||
// Also we use a different scaling algorithm based on the resolution, as the design is full screen
|
||||
readonly property real scaling: ScalingService.dynamicScale(Screen)
|
||||
readonly property real scaling: {
|
||||
var tt = ScalingService.dynamicScale(Screen)
|
||||
console.log(tt)
|
||||
return tt
|
||||
}
|
||||
|
||||
property string errorMessage: ""
|
||||
property bool authenticating: false
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ NPanel {
|
|||
switch (action) {
|
||||
case "lock":
|
||||
// Access lockScreen directly like IPCManager does
|
||||
if (!lockScreen.isLoaded) {
|
||||
lockScreen.isLoaded = true
|
||||
if (!lockScreen.active) {
|
||||
lockScreen.active = true
|
||||
}
|
||||
break
|
||||
case "suspend":
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
import QtQuick
|
||||
|
||||
// Example usage:
|
||||
// NLoader {
|
||||
// content: Component {
|
||||
// YourComponent {
|
||||
Loader {
|
||||
id: loader
|
||||
|
||||
// Boolean control to load/unload the item
|
||||
property bool isLoaded: false
|
||||
|
||||
// Provide the component to be loaded.
|
||||
property Component content
|
||||
|
||||
active: isLoaded
|
||||
asynchronous: true
|
||||
sourceComponent: content
|
||||
|
||||
onActiveChanged: {
|
||||
if (active && item && item.show) {
|
||||
item.show()
|
||||
}
|
||||
}
|
||||
|
||||
onItemChanged: {
|
||||
if (active && item && item.show) {
|
||||
item.show()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: loader.item
|
||||
ignoreUnknownSignals: true
|
||||
function onDismissed() {
|
||||
loader.isLoaded = false
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue