fix: 修复任务栏显示位置错误的问题

计算任务栏可显示的位置时,计算错误导致,已修复,且添加了屏幕位置示意图,方便理解

Log: 修复任务栏显示位置错误的问题
Bug: https://pms.uniontech.com/zentao/bug-view-80486.html
Change-Id: I59082d5321cf16874da418a0127c6abd35102949
This commit is contained in:
Fan PengCheng 2021-05-19 22:31:35 +08:00
parent 73aee6b7f5
commit 03716ac9f8

View File

@ -188,13 +188,33 @@ void DisplayManager::updateScreenDockInfo()
QPoint s1bottomRight = QPoint(s1.x() + s1.width(), s1.y() + s1.height());
QPoint s1bottomLeft = QPoint(s1.x(), s1.y() + s1.height());
// 对角拼接,重置,默认均可停靠
/*
*
--------- ---------
| | | |
| s0 | | s1 |
| | | |
----------------- -----------------
| | | |
| s1 | s0 |
| | | |
--------- ---------
*/
if (s0bottomRight == s1topLeft
|| s0topRight == s1bottomRight) {
|| s0topLeft == s1bottomRight) {
return;
}
// 左右拼接s0左s1右
/*
* s0左s1右
--------------------- -------------
| | | | |
| | s1 | | |--------
| s0 | | | s0 | |
| |-------- | | s1 |
| | | | |
------------- ---------------------
*/
if (s0Right == s1left
&& (s0topRight == s1topLeft || s0bottomRight == s1bottomLeft)) {
m_screenPositionMap[m_screens.at(0)].insert(Position::Right, false);
@ -202,15 +222,37 @@ void DisplayManager::updateScreenDockInfo()
return;
}
// 左右拼接s0右s1左
/*
* s1左s0右
--------------------- -------------
| | | | |
| | s0 | | |--------
| s1 | | | s1 | |
| |-------- | | s0 |
| | | | |
------------- ---------------------
*/
if (s0left== s1Right
&& (s0topRight == s1topRight || s0bottomLeft == s1bottomRight)) {
&& (s0topLeft == s1topRight || s0bottomLeft == s1bottomRight)) {
m_screenPositionMap[m_screens.at(0)].insert(Position::Left, false);
m_screenPositionMap[m_screens.at(1)].insert(Position::Right, false);
return;
}
// 上下拼接s0上s1下
/*
* s0上s1下
--------- ---------
| | | |
| s0 | | s0 |
| | | |
------------- -------------
| | | |
| | | |
| s1 | | s1 |
| | | |
| | | |
------------- -------------
*/
if (s0bottom == s1top
&& (s0bottomLeft == s1topLeft || s0bottomRight == s1topRight)) {
m_screenPositionMap[m_screens.at(0)].insert(Position::Bottom, false);
@ -218,7 +260,20 @@ void DisplayManager::updateScreenDockInfo()
return;
}
// 上下拼接s0下s1上
/*
* s1上s0下
--------- ---------
| | | |
| s1 | | s1 |
| | | |
------------- -------------
| | | |
| | | |
| s0 | | s0 |
| | | |
| | | |
------------- -------------
*/
if (s0top == s1bottom
&& (s0topLeft == s1bottomLeft || s0topRight == s1bottomRight)) {
m_screenPositionMap[m_screens.at(0)].insert(Position::Top, false);