mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix dock cant shown
Change-Id: Ic5171acbf87b18ac4acb7a2f28517bd809a53b00
This commit is contained in:
parent
2584e82226
commit
a6e3a9b15b
Notes:
Deepin Code Review
2016-08-31 03:27:52 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Wed, 31 Aug 2016 03:27:51 +0000 Reviewed-on: https://cr.deepin.io/15714 Project: dde/dde-dock Branch: refs/heads/master
@ -160,9 +160,20 @@ const QSize DockSettings::windowSize() const
|
||||
return m_mainWindowSize;
|
||||
}
|
||||
|
||||
const QRect DockSettings::windowRect(const Position position) const
|
||||
const QRect DockSettings::windowRect(const Position position, const bool hide) const
|
||||
{
|
||||
const QSize size = m_mainWindowSize;
|
||||
QSize size = m_mainWindowSize;
|
||||
if (hide)
|
||||
{
|
||||
switch (position)
|
||||
{
|
||||
case Top:
|
||||
case Bottom: size.setHeight(1);
|
||||
case Left:
|
||||
case Right: size.setWidth(1);
|
||||
}
|
||||
}
|
||||
|
||||
const QRect primaryRect = m_primaryRect;
|
||||
const int offsetX = (primaryRect.width() - size.width()) / 2;
|
||||
const int offsetY = (primaryRect.height() - size.height()) / 2;
|
||||
@ -171,13 +182,13 @@ const QRect DockSettings::windowRect(const Position position) const
|
||||
switch (position)
|
||||
{
|
||||
case Top:
|
||||
p = QPoint(offsetX, 0); break;
|
||||
p = QPoint(offsetX, 0); break;
|
||||
case Left:
|
||||
p = QPoint(0, offsetY); break;
|
||||
p = QPoint(0, offsetY); break;
|
||||
case Right:
|
||||
p = QPoint(primaryRect.width() - size.width(), offsetY); break;
|
||||
p = QPoint(primaryRect.width() - size.width(), offsetY); break;
|
||||
case Bottom:
|
||||
p = QPoint(offsetX, primaryRect.height() - size.height()); break;
|
||||
p = QPoint(offsetX, primaryRect.height() - size.height()); break;
|
||||
default:Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
bool autoHide() const;
|
||||
const QRect primaryRect() const;
|
||||
const QSize windowSize() const;
|
||||
const QRect windowRect(const Position position) const;
|
||||
const QRect windowRect(const Position position, const bool hide = false) const;
|
||||
|
||||
void showDockSettingsMenu();
|
||||
|
||||
|
@ -242,7 +242,7 @@ void MainWindow::updateGeometry()
|
||||
// default:
|
||||
// Q_ASSERT(false);
|
||||
// }
|
||||
const QRect windowRect = m_settings->windowRect(position);
|
||||
const QRect windowRect = m_settings->windowRect(position, m_settings->hideState() == Hide);
|
||||
move(windowRect.x(), windowRect.y());
|
||||
|
||||
m_mainPanel->update();
|
||||
|
Loading…
x
Reference in New Issue
Block a user