Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions qml/FolderGridViewPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import org.deepin.dtk 1.0
import org.deepin.dtk.style 1.0 as DStyle

Expand Down Expand Up @@ -53,8 +54,11 @@ Popup {
// TODO: 经验证发现:Poppu窗口高度为奇数时,会多显示一个像素的外边框;为偶数时不会显示
// 因此,这里需要保证高度是偶数来确保Popup窗口没有外边框
height: ((cs * 3) % 2 === 0 ? (cs * 3) : (cs * 3 + 1)) + 130 /* title height*/
x: centerPosition.x - (width / 2)
y: centerPosition.y - (height / 2)
// 获取当前屏幕的 DPR,用于物理像素对齐
property real dpr: Screen.devicePixelRatio

x: Math.round((centerPosition.x - (width / 2)) * dpr) / dpr
y: Math.round((centerPosition.y - (height / 2)) * dpr) / dpr

onClosed: {
// reset folder view
Expand Down
5 changes: 3 additions & 2 deletions qml/windowed/WindowedFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ InputEventItem {

FolderGridViewPopup {
id: folderGridViewPopup
width: 370
height: 330
// 物理像素对齐,确保在各种缩放比例下边缘都能对齐到整数物理像素
width: Math.round(370 * Screen.devicePixelRatio) / Screen.devicePixelRatio
height: Math.round(330 * Screen.devicePixelRatio) / Screen.devicePixelRatio
folderNameFont: LauncherController.adjustFontWeight(DTK.fontManager.t6, Font.Bold)
centerPosition: Qt.point(curPointX, curPointY)

Expand Down
Loading