load higher resolution tray icons for high-dpi screens
This commit is contained in:
+18
-6
@@ -305,31 +305,43 @@ Variants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Drawing {
|
Loader {
|
||||||
|
id: drawingLoader
|
||||||
|
|
||||||
|
active: visibilities.isDrawing
|
||||||
|
|
||||||
|
sourceComponent: Drawing {
|
||||||
id: drawing
|
id: drawing
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 2
|
z: 2
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DrawingInput {
|
Loader {
|
||||||
|
id: inputLoader
|
||||||
|
|
||||||
|
active: visibilities.isDrawing
|
||||||
|
|
||||||
|
sourceComponent: DrawingInput {
|
||||||
id: input
|
id: input
|
||||||
|
|
||||||
bar: bar
|
bar: bar
|
||||||
drawing: drawing
|
drawing: drawingLoader.item
|
||||||
panels: panels
|
panels: panels
|
||||||
popout: panels.drawing
|
popout: panels.drawing
|
||||||
visibilities: visibilities
|
visibilities: visibilities
|
||||||
z: 2
|
z: 2
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Interactions {
|
Interactions {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
bar: bar
|
bar: bar
|
||||||
drawing: drawing
|
drawing: drawingLoader.item
|
||||||
input: input
|
input: inputLoader.item
|
||||||
panels: panels
|
panels: panels
|
||||||
popouts: panels.popouts
|
popouts: panels.popouts
|
||||||
screen: scope.modelData
|
screen: scope.modelData
|
||||||
@@ -340,7 +352,7 @@ Variants {
|
|||||||
id: panels
|
id: panels
|
||||||
|
|
||||||
bar: bar
|
bar: bar
|
||||||
drawingItem: drawing
|
drawingItem: drawingLoader.item
|
||||||
screen: scope.modelData
|
screen: scope.modelData
|
||||||
visibilities: visibilities
|
visibilities: visibilities
|
||||||
|
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ Item {
|
|||||||
Loader {
|
Loader {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
active: Qt.binding(() => root.shouldBeActive || root.visible)
|
active: root.shouldBeActive || root.visible
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
height: content.contentItem.height
|
height: content.item.height
|
||||||
opacity: root.expanded ? 0 : 1
|
opacity: root.expanded ? 0 : 1
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
@@ -64,6 +64,7 @@ Item {
|
|||||||
Loader {
|
Loader {
|
||||||
id: content
|
id: content
|
||||||
|
|
||||||
|
active: root.shouldBeActive || root.visible
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
@@ -77,7 +78,5 @@ Item {
|
|||||||
drawing: root.drawing
|
drawing: root.drawing
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: active = Qt.binding(() => root.shouldBeActive || root.visible)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import QtQuick
|
|||||||
import QtQuick.VectorImage
|
import QtQuick.VectorImage
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Services.SystemTray
|
import Quickshell.Services.SystemTray
|
||||||
|
import qs.Helpers
|
||||||
import qs.Modules
|
import qs.Modules
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Config
|
import qs.Config
|
||||||
@@ -11,6 +12,7 @@ Item {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool current: popouts.currentName.startsWith(`traymenu${ind}`) && popouts.hasCurrent
|
property bool current: popouts.currentName.startsWith(`traymenu${ind}`) && popouts.hasCurrent
|
||||||
|
readonly property real dpr: Hypr.monitorFor(loader.screen).scale
|
||||||
property bool hasLoaded: false
|
property bool hasLoaded: false
|
||||||
required property int ind
|
required property int ind
|
||||||
required property SystemTrayItem item
|
required property SystemTrayItem item
|
||||||
@@ -48,9 +50,11 @@ Item {
|
|||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
antialiasing: true
|
||||||
color: root.current ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
|
color: root.current ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
|
||||||
implicitSize: 22
|
implicitSize: 24 * root.dpr
|
||||||
layer.enabled: Config.general.color.smart || Config.general.color.scheduleDark
|
layer.enabled: Config.general.color.smart || Config.general.color.scheduleDark
|
||||||
|
scale: 1 / root.dpr
|
||||||
source: root.item.icon
|
source: root.item.icon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user