Skip to content

Commit d81eeae

Browse files
committed
fix: Ensure the show desktop line is always 1 physical pixel regardless of system scaling
as title Log: as title Pms: BUG-302035
1 parent 413ba10 commit d81eeae

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

panels/dock/showdesktop/package/showdesktop.qml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import QtQuick 2.15
66
import QtQuick.Controls 2.15
7+
import QtQuick.Window 2.15
78

89
import org.deepin.ds 1.0
910
import org.deepin.dtk 1.0 as D
@@ -32,8 +33,10 @@ AppletItem {
3233

3334
Rectangle {
3435
property D.Palette lineColor: DockPalette.showDesktopLineColor
35-
implicitWidth: useColumnLayout ? showdesktop.implicitWidth : 1
36-
implicitHeight: useColumnLayout ? 1 : showdesktop.implicitHeight
36+
// Use device pixel ratio to ensure the line is always 1 physical pixel regardless of system scaling
37+
property real devicePixelRatio: Screen.devicePixelRatio
38+
implicitWidth: showdesktop.useColumnLayout ? showdesktop.implicitWidth : (1 / devicePixelRatio)
39+
implicitHeight: showdesktop.useColumnLayout ? (1 / devicePixelRatio) : showdesktop.implicitHeight
3740

3841
color: D.ColorSelector.lineColor
3942
}

0 commit comments

Comments
 (0)