mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix display mode error
Change-Id: I7f99171b76c3095b0bd93b0051b7361320648427
This commit is contained in:
parent
008a2858d9
commit
2815276f71
Notes:
Deepin Code Review
2016-08-04 02:26:08 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Thu, 04 Aug 2016 02:26:07 +0000 Reviewed-on: https://cr.deepin.io/14908 Project: dde/dde-dock Branch: refs/heads/master
@ -95,7 +95,7 @@ DockSettings::DockSettings(QWidget *parent)
|
||||
connect(m_dockInter, &DBusDock::PositionChanged, this, &DockSettings::positionChanged);
|
||||
connect(m_dockInter, &DBusDock::IconSizeChanged, this, &DockSettings::iconSizeChanged);
|
||||
connect(m_dockInter, &DBusDock::DisplayModeChanged, this, &DockSettings::displayModeChanged);
|
||||
connect(m_dockInter, &DBusDock::HideModeChanged, this, &DockSettings::hideModeChanged);
|
||||
connect(m_dockInter, &DBusDock::HideModeChanged, this, &DockSettings::hideModeChanged, Qt::QueuedConnection);
|
||||
connect(m_dockInter, &DBusDock::HideStateChanged, this, &DockSettings::hideStateChanegd);
|
||||
connect(m_dockInter, &DBusDock::ServiceRestarted, this, &DockSettings::resetFrontendGeometry);
|
||||
|
||||
|
@ -129,6 +129,7 @@ void MainWindow::initConnections()
|
||||
connect(m_settings, &DockSettings::dataChanged, m_positionUpdateTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||
connect(m_settings, &DockSettings::windowGeometryChanged, this, &MainWindow::updateGeometry, Qt::DirectConnection);
|
||||
connect(m_settings, &DockSettings::windowHideModeChanged, this, &MainWindow::setStrutPartial, Qt::QueuedConnection);
|
||||
connect(m_settings, &DockSettings::windowHideModeChanged, this, &MainWindow::resetPanelEnvironment);
|
||||
connect(m_settings, &DockSettings::windowVisibleChanegd, this, &MainWindow::updatePanelVisible, Qt::QueuedConnection);
|
||||
connect(m_settings, &DockSettings::autoHideChanged, this, &MainWindow::updatePanelVisible);
|
||||
|
||||
@ -326,22 +327,27 @@ void MainWindow::resetPanelEnvironment()
|
||||
const int offsetX = (primaryRect.width() - size.width()) / 2;
|
||||
const int offsetY = (primaryRect.height() - size.height()) / 2;
|
||||
|
||||
QWidget::setFixedSize(size);
|
||||
m_mainPanel->setFixedSize(size);
|
||||
m_mainPanel->move(0, 0);
|
||||
m_mainPanel->setFixedSize(size);
|
||||
QWidget::setFixedSize(size);
|
||||
m_sizeChangeAni->setEndValue(size);
|
||||
|
||||
QPoint position;
|
||||
switch (m_settings->position())
|
||||
{
|
||||
case Top:
|
||||
QWidget::move(primaryRect.topLeft().x() + offsetX, 0); break;
|
||||
position = QPoint(primaryRect.topLeft().x() + offsetX, 0); break;
|
||||
case Left:
|
||||
QWidget::move(primaryRect.topLeft().x(), offsetY); break;
|
||||
position = QPoint(primaryRect.topLeft().x(), offsetY); break;
|
||||
case Right:
|
||||
QWidget::move(primaryRect.right() - size.width() + 1, offsetY); break;
|
||||
position = QPoint(primaryRect.right() - size.width() + 1, offsetY); break;
|
||||
case Bottom:
|
||||
QWidget::move(offsetX, primaryRect.bottom() - size.height() + 1); break;
|
||||
position = QPoint(offsetX, primaryRect.bottom() - size.height() + 1); break;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
QWidget::move(position);
|
||||
m_posChangeAni->setEndValue(position);
|
||||
}
|
||||
|
||||
void MainWindow::updatePanelVisible()
|
||||
|
Loading…
x
Reference in New Issue
Block a user