fixed(dde-dock): dock item display error when startup for bug 19279

修复当开机时候,lanucher会因为刷新慢导致先显示在中间,然后再显示正确位置

(cherry picked from commit 9fe0985d8365b761e9741fa43956f1a1037d0568)
This commit is contained in:
wangxuwen 2020-04-26 18:42:42 +08:00 committed by “fanpengcheng_cm”
parent 8a82945fa4
commit 3498bc8d8f
2 changed files with 16 additions and 1 deletions

View File

@ -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();
}

View File

@ -302,7 +302,6 @@ void MainWindow::launch()
QWidget::move(m_settings->windowRect(m_curDockPos).topLeft());
setVisible(true);
updatePanelVisible();
expand();
resetPanelEnvironment(false);
});
}