mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
Merge "fix display mode error"
This commit is contained in:
commit
42831a2c94
@ -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