mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fixed(dde-dock): dock item display error when startup for bug 19279
修复当开机时候,lanucher会因为刷新慢导致先显示在中间,然后再显示正确位置 (cherry picked from commit 9fe0985d8365b761e9741fa43956f1a1037d0568)
This commit is contained in:
parent
8a82945fa4
commit
3498bc8d8f
@ -87,6 +87,12 @@ MainPanelControl::MainPanelControl(QWidget *parent)
|
||||
m_appAreaSonWidget->installEventFilter(this);
|
||||
m_trayAreaWidget->installEventFilter(this);
|
||||
m_desktopWidget->installEventFilter(this);
|
||||
|
||||
//在设置每条线大小前,应该设置fixedsize(0,0)
|
||||
//应为paintEvent函数会先调用设置背景颜色,大小为随机值
|
||||
m_fixedSpliter->setFixedSize(0,0);
|
||||
m_appSpliter ->setFixedSize(0,0);
|
||||
m_traySpliter->setFixedSize(0,0);
|
||||
}
|
||||
|
||||
MainPanelControl::~MainPanelControl()
|
||||
@ -214,12 +220,22 @@ void MainPanelControl::updateMainPanelLayout()
|
||||
|
||||
void MainPanelControl::addFixedAreaItem(int index, QWidget *wdg)
|
||||
{
|
||||
if(m_position == Position::Top || m_position == Position::Bottom){
|
||||
wdg->setMaximumSize(height(),height());
|
||||
} else {
|
||||
wdg->setMaximumSize(width(),width());
|
||||
}
|
||||
m_fixedAreaLayout->insertWidget(index, wdg);
|
||||
resizeDockIcon();
|
||||
}
|
||||
|
||||
void MainPanelControl::addAppAreaItem(int index, QWidget *wdg)
|
||||
{
|
||||
if(m_position == Position::Top || m_position == Position::Bottom){
|
||||
wdg->setMaximumSize(height(),height());
|
||||
} else {
|
||||
wdg->setMaximumSize(width(),width());
|
||||
}
|
||||
m_appAreaSonLayout->insertWidget(index, wdg);
|
||||
resizeDockIcon();
|
||||
}
|
||||
|
@ -302,7 +302,6 @@ void MainWindow::launch()
|
||||
QWidget::move(m_settings->windowRect(m_curDockPos).topLeft());
|
||||
setVisible(true);
|
||||
updatePanelVisible();
|
||||
expand();
|
||||
resetPanelEnvironment(false);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user