fix(frontend): Mianwindow is not shown incorrectly when panel is hidden.
Description: 修复任务栏隐藏时主界面显示位置有误的问题 Log: 修复任务栏隐藏时主界面显示位置有误的问题 Bug: http://172.17.66.192/biz/bug-view-43730.html
This commit is contained in:
parent
171d506c3f
commit
3ac456f7d6
|
@ -364,21 +364,21 @@ void MainWindow::moveToPanel()
|
|||
QDBusConnection::sessionBus() );
|
||||
|
||||
int position = QDBusReply<int>(interface.call("GetPanelPosition", "position"));
|
||||
int height = QDBusReply<int>(interface.call("GetPanelPosition", "height"));
|
||||
int height = QDBusReply<int>(interface.call("GetPanelSize", "height"));
|
||||
int d = 8; //窗口边沿到任务栏距离
|
||||
|
||||
if (position == 0) {
|
||||
//任务栏在下侧
|
||||
this->move(availableGeometry.x() + availableGeometry.width() - this->width() - d, screenMainRect.y() + availableGeometry.height() - this->height() - height - d);
|
||||
this->move(availableGeometry.x() + availableGeometry.width() - this->width() - d, screenGeometry.y() + screenGeometry.height() - this->height() - height - d);
|
||||
} else if(position == 1) {
|
||||
//任务栏在上侧
|
||||
this->move(availableGeometry.x() + availableGeometry.width() - this->width() - d, screenMainRect.y() + screenGeometry.height() - availableGeometry.height() + height + d);
|
||||
this->move(availableGeometry.x() + availableGeometry.width() - this->width() - d, screenGeometry.y() + height + d);
|
||||
} else if (position == 2) {
|
||||
//任务栏在左侧
|
||||
this->move(screenGeometry.x() + screenGeometry.width() - availableGeometry.width() + d, screenGeometry.y() + screenGeometry.height() - this->height() - d);
|
||||
this->move(screenGeometry.x() + height + d, screenGeometry.y() + screenGeometry.height() - this->height() - d);
|
||||
} else if (position == 3) {
|
||||
//任务栏在右侧
|
||||
this->move(screenGeometry.x() + availableGeometry.width() - this->width() - d, screenGeometry.y() + screenGeometry.height() - this->height() - d);
|
||||
this->move(screenGeometry.x() + screenGeometry.width() - this->width() - height - d, screenGeometry.y() + screenGeometry.height() - this->height() - d);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue