mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix(mainwindow):fix bug for mainwindow pos
This commit is contained in:
parent
f3d8494454
commit
f4089b2073
@ -173,9 +173,9 @@ const QRect DockSettings::primaryRect() const
|
|||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int DockSettings::dockMargin(const Position position) const
|
const int DockSettings::dockMargin() const
|
||||||
{
|
{
|
||||||
if (position == Dock::Efficient)
|
if (m_displayMode == Dock::Efficient)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 10;
|
return 10;
|
||||||
@ -201,7 +201,7 @@ const QRect DockSettings::windowRect(const Position position, const bool hide) c
|
|||||||
const QRect primaryRect = this->primaryRect();
|
const QRect primaryRect = this->primaryRect();
|
||||||
const int offsetX = (primaryRect.width() - size.width()) / 2;
|
const int offsetX = (primaryRect.width() - size.width()) / 2;
|
||||||
const int offsetY = (primaryRect.height() - size.height()) / 2;
|
const int offsetY = (primaryRect.height() - size.height()) / 2;
|
||||||
const int margin = this->dockMargin(position);
|
const int margin = this->dockMargin();
|
||||||
QPoint p(0, 0);
|
QPoint p(0, 0);
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case Top:
|
case Top:
|
||||||
|
@ -78,7 +78,7 @@ public:
|
|||||||
inline const QSize windowSize() const { return m_mainWindowSize; }
|
inline const QSize windowSize() const { return m_mainWindowSize; }
|
||||||
inline const quint8 Opacity() const { return m_opacity * 255; }
|
inline const quint8 Opacity() const { return m_opacity * 255; }
|
||||||
inline const QSize fashionTraySize() const { return m_fashionTraySize; }
|
inline const QSize fashionTraySize() const { return m_fashionTraySize; }
|
||||||
const int dockMargin(const Position position) const;
|
const int dockMargin() const;
|
||||||
|
|
||||||
const QSize panelSize() const;
|
const QSize panelSize() const;
|
||||||
const QRect windowRect(const Position position, const bool hide = false) const;
|
const QRect windowRect(const Position position, const bool hide = false) const;
|
||||||
@ -130,6 +130,7 @@ private:
|
|||||||
int m_screenRawHeight;
|
int m_screenRawHeight;
|
||||||
int m_screenRawWidth;
|
int m_screenRawWidth;
|
||||||
double m_opacity;
|
double m_opacity;
|
||||||
|
int m_dockMargin;
|
||||||
QSet<Position> m_forbidPositions;
|
QSet<Position> m_forbidPositions;
|
||||||
Position m_position;
|
Position m_position;
|
||||||
HideMode m_hideMode;
|
HideMode m_hideMode;
|
||||||
|
@ -615,7 +615,7 @@ void MainWindow::setStrutPartial()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_xcbMisc->set_strut_partial(winId(), orientation, strut + m_settings->dockMargin(m_settings->position()), strutStart, strutEnd);
|
m_xcbMisc->set_strut_partial(winId(), orientation, strut + m_settings->dockMargin(), strutStart, strutEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::expand()
|
void MainWindow::expand()
|
||||||
@ -730,7 +730,7 @@ void MainWindow::updatePanelVisible()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
QRectF r(pos(), size());
|
QRectF r(pos(), size());
|
||||||
const int margin = m_settings->dockMargin(m_settings->position());
|
const int margin = m_settings->dockMargin();
|
||||||
switch (m_settings->position()) {
|
switch (m_settings->position()) {
|
||||||
case Dock::Top:
|
case Dock::Top:
|
||||||
r.setY(r.y() - margin);
|
r.setY(r.y() - margin);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user