mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fixed(dock):fixed bug 4391
This commit is contained in:
parent
1b27151568
commit
fedb0db7f9
@ -153,6 +153,39 @@ void MainPanelControl::updateMainPanelLayout()
|
||||
m_trayAreaLayout->setContentsMargins(10, 0, 10, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (m_position == Dock::Position::Top || m_position == Dock::Position::Bottom) {
|
||||
m_fixedSpliter->setFixedSize(SPLITER_SIZE, height() * 0.6);
|
||||
m_appSpliter->setFixedSize(SPLITER_SIZE, height() * 0.6);
|
||||
m_traySpliter->setFixedSize(SPLITER_SIZE, height() * 0.5);
|
||||
} else {
|
||||
m_fixedSpliter->setFixedSize(width() * 0.6, SPLITER_SIZE);
|
||||
m_appSpliter->setFixedSize(width() * 0.6, SPLITER_SIZE);
|
||||
m_traySpliter->setFixedSize(width() * 0.5, SPLITER_SIZE);
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_appAreaSonLayout->count(); ++i) {
|
||||
QWidget *w = m_appAreaSonLayout->itemAt(i)->widget();
|
||||
if (w) {
|
||||
if ((m_position == Position::Top) || (m_position == Position::Bottom)) {
|
||||
w->setMaximumSize(height(), height());
|
||||
} else {
|
||||
w->setMaximumSize(width(), width());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_fixedAreaLayout->count(); ++i) {
|
||||
QWidget *w = m_fixedAreaLayout->itemAt(i)->widget();
|
||||
if (w) {
|
||||
if ((m_position == Position::Top) || (m_position == Position::Bottom)) {
|
||||
w->setMaximumSize(height(), height());
|
||||
} else {
|
||||
w->setMaximumSize(width(), width());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainPanelControl::addFixedAreaItem(int index, QWidget *wdg)
|
||||
@ -233,16 +266,6 @@ void MainPanelControl::resizeEvent(QResizeEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_position == Dock::Position::Top || m_position == Dock::Position::Bottom) {
|
||||
m_fixedSpliter->setFixedSize(SPLITER_SIZE, height() * 0.6);
|
||||
m_appSpliter->setFixedSize(SPLITER_SIZE, height() * 0.6);
|
||||
m_traySpliter->setFixedSize(SPLITER_SIZE, height() * 0.5);
|
||||
} else {
|
||||
m_fixedSpliter->setFixedSize(width() * 0.6, SPLITER_SIZE);
|
||||
m_appSpliter->setFixedSize(width() * 0.6, SPLITER_SIZE);
|
||||
m_traySpliter->setFixedSize(width() * 0.5, SPLITER_SIZE);
|
||||
}
|
||||
|
||||
return QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user