Dimming: replaced dimmer by panel dimming, now that we have no margins it works fine.
This commit is contained in:
parent
7acca17b83
commit
0b790c219d
3 changed files with 6 additions and 82 deletions
|
|
@ -1,76 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Effects
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.Commons
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Variants {
|
|
||||||
model: Quickshell.screens
|
|
||||||
|
|
||||||
delegate: Loader {
|
|
||||||
required property ShellScreen modelData
|
|
||||||
|
|
||||||
// Dimmer is only active on the screen where the panel is currently open.
|
|
||||||
active: {
|
|
||||||
if (Settings.isLoaded && Settings.data.general.dimDesktop && modelData !== undefined && PanelService.openedPanel !== null && PanelService.openedPanel.item !== undefined && PanelService.openedPanel.item !== null) {
|
|
||||||
return (PanelService.openedPanel.item.screen === modelData)
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceComponent: PanelWindow {
|
|
||||||
id: panel
|
|
||||||
|
|
||||||
property real customOpacity: 0
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (modelData) {
|
|
||||||
Logger.log("Dimmer", "Loaded on", modelData.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// When a NPanel opens it seems it is initialized with the primary screen for a very brief moment
|
|
||||||
// before the screen actually updates to the proper value. We use a timer to delay the fade in to avoid
|
|
||||||
// a single frame flicker on the main screen when opening a panel on another screen.
|
|
||||||
fadeInTimer.start()
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: PanelService
|
|
||||||
function onWillClose() {
|
|
||||||
customOpacity = Style.opacityNone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: fadeInTimer
|
|
||||||
interval: 100
|
|
||||||
onTriggered: customOpacity = Style.opacityHeavy
|
|
||||||
}
|
|
||||||
|
|
||||||
screen: modelData
|
|
||||||
|
|
||||||
WlrLayershell.layer: WlrLayer.Top
|
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
|
||||||
WlrLayershell.namespace: "quickshell-dimmer"
|
|
||||||
|
|
||||||
// mask: Region {}
|
|
||||||
anchors {
|
|
||||||
top: true
|
|
||||||
bottom: true
|
|
||||||
right: true
|
|
||||||
left: true
|
|
||||||
}
|
|
||||||
|
|
||||||
color: Qt.alpha(Color.mShadow, customOpacity)
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Style.animationSlow
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -38,6 +38,7 @@ Loader {
|
||||||
readonly property real originalOpacity: 0.0
|
readonly property real originalOpacity: 0.0
|
||||||
property real scaleValue: originalScale
|
property real scaleValue: originalScale
|
||||||
property real opacityValue: originalOpacity
|
property real opacityValue: originalOpacity
|
||||||
|
property real dimmingOpacity: 0
|
||||||
|
|
||||||
property alias isClosing: hideTimer.running
|
property alias isClosing: hideTimer.running
|
||||||
|
|
||||||
|
|
@ -108,6 +109,7 @@ Loader {
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
function close() {
|
function close() {
|
||||||
|
dimmingOpacity = 0
|
||||||
scaleValue = originalScale
|
scaleValue = originalScale
|
||||||
opacityValue = originalOpacity
|
opacityValue = originalOpacity
|
||||||
hideTimer.start()
|
hideTimer.start()
|
||||||
|
|
@ -149,6 +151,7 @@ Loader {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Logger.log("NPanel", "Opened", root.objectName)
|
Logger.log("NPanel", "Opened", root.objectName)
|
||||||
|
dimmingOpacity = Style.opacityHeavy
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
|
@ -174,17 +177,14 @@ Loader {
|
||||||
|
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
// No dimming here
|
color: Settings.data.general.dimDesktop ? Qt.alpha(Color.mShadow, dimmingOpacity) : Color.transparent
|
||||||
color: Color.transparent
|
|
||||||
|
|
||||||
WlrLayershell.layer: Settings.data.general.dimDesktop ? WlrLayer.Overlay : WlrLayer.Top
|
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.namespace: "noctalia-panel"
|
WlrLayershell.namespace: "noctalia-panel"
|
||||||
WlrLayershell.keyboardFocus: root.panelKeyboardFocus ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: root.panelKeyboardFocus ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: Style.animationNormal
|
duration: Style.animationSlow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -208,6 +208,7 @@ Loader {
|
||||||
onClicked: root.close()
|
onClicked: root.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The actual panel's content
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: panelBackground
|
id: panelBackground
|
||||||
color: panelBackgroundColor
|
color: panelBackgroundColor
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ ShellRoot {
|
||||||
Background {}
|
Background {}
|
||||||
Overview {}
|
Overview {}
|
||||||
ScreenCorners {}
|
ScreenCorners {}
|
||||||
Dimmer {}
|
|
||||||
Bar {}
|
Bar {}
|
||||||
Dock {}
|
Dock {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue