mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 修复高缩放率下显示问题
1、开始菜单位置显示错误问题 2、应用图标显示错误问题 Log: 修复高缩放率下的显示问题 Influence: 设置高缩放率,观察开始菜单的位置,任务栏图标占满区域,左右位置,观察任务栏图标是否拥挤 Bug: https://pms.uniontech.com/bug-view-176421.html Change-Id: I038e28df2e9676fbfc8cf3732c6bee5c335f20d3
This commit is contained in:
parent
253d0af770
commit
105df289cc
@ -1255,6 +1255,7 @@ void MainPanelControl::resizeDockIcon()
|
||||
iconSize = (totalLength - yu) / iconCount;
|
||||
}
|
||||
|
||||
iconSize = iconSize / qApp->devicePixelRatio();
|
||||
if ((m_position == Position::Top) || (m_position == Position::Bottom)) {
|
||||
if (iconSize >= height()) {
|
||||
calcuDockIconSize(height(), height(), tray_item_size);
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <QScreen>
|
||||
#include <QX11Info>
|
||||
#include <QtConcurrent>
|
||||
#include <QScreen>
|
||||
|
||||
#include <qpa/qplatformscreen.h>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
@ -676,8 +677,18 @@ void WindowManager::onRequestUpdateFrontendGeometry()
|
||||
if (rect.width() == 0 || rect.height() == 0)
|
||||
return;
|
||||
|
||||
int x = rect.x();
|
||||
int y = rect.y();
|
||||
QScreen *screen = DIS_INS->screen(DOCKSCREEN_INS->current());
|
||||
if (screen) {
|
||||
if (m_position == Dock::Position::Top || m_position == Dock::Position::Bottom)
|
||||
x = (screen->handle()->geometry().width() - (rect.width() * qApp->devicePixelRatio())) / 2;
|
||||
else
|
||||
y = (screen->handle()->geometry().height() - (rect.height() * qApp->devicePixelRatio())) / 2;
|
||||
}
|
||||
|
||||
DockInter dockInter(dockServiceName(), dockServicePath(), QDBusConnection::sessionBus());
|
||||
dockInter.SetFrontendWindowRect(int(rect.x()), int(rect.y()), uint(rect.width()), uint(rect.height()));
|
||||
dockInter.SetFrontendWindowRect(x, y, uint(rect.width()), uint(rect.height()));
|
||||
}
|
||||
|
||||
void WindowManager::onRequestNotifyWindowManager()
|
||||
|
Loading…
x
Reference in New Issue
Block a user