fix(toolbar): improve toolbar positioning on HiDPI displays#825
Conversation
Adjusted the toolbar positioning logic to account for pixel ratio differences in Qt6+XCB environments. The changes ensure that the toolbar remains within screen bounds by applying consistent boundary checks using logical coordinates. This fix addresses potential offscreen positioning issues when the toolbar is displayed on high-DPI screens. bug: https://pms.uniontech.com/bug-view-354679.html
deepin pr auto review代码审查意见1. 总体评价这段代码主要处理了多屏幕环境下工具栏位置计算和倒计时显示位置的问题,特别是针对Qt6+XCB环境下的坐标系统差异进行了处理。代码整体逻辑清晰,但存在一些可以优化的地方。 2. 语法与逻辑问题2.1 坐标系统转换的重复代码在多个地方( const int screenX = Utils::isQt6XcbEnv ? static_cast<int>(m_screenInfo[i].x / m_pixelRatio) : m_screenInfo[i].x;
const int screenY = Utils::isQt6XcbEnv ? static_cast<int>(m_screenInfo[i].y / m_pixelRatio) : m_screenInfo[i].y;
const int screenW = static_cast<int>(m_screenInfo[i].width / m_pixelRatio);
const int screenH = static_cast<int>(m_screenInfo[i].height / m_pixelRatio);建议:将这些转换逻辑提取为私有辅助函数或lambda表达式,减少代码重复。 2.2
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
Adjusted the toolbar positioning logic to account for pixel ratio differences in Qt6+XCB environments. The changes ensure that the toolbar remains within screen bounds by applying consistent boundary checks using logical coordinates. This fix addresses potential offscreen positioning issues when the toolbar is displayed on high-DPI screens.
bug: https://pms.uniontech.com/bug-view-354679.html