From 3498bc8d8f13ba1fdc0abf01e9d6b16671b4c2fd Mon Sep 17 00:00:00 2001 From: wangxuwen Date: Sun, 26 Apr 2020 18:42:42 +0800 Subject: [PATCH] =?UTF-8?q?fixed(dde-dock):=20dock=20item=20display=20erro?= =?UTF-8?q?r=20when=20startup=20for=20bug=2019279=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=BC=80?= =?UTF-8?q?=E6=9C=BA=E6=97=B6=E5=80=99=EF=BC=8Clanucher=E4=BC=9A=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E5=88=B7=E6=96=B0=E6=85=A2=E5=AF=BC=E8=87=B4=E5=85=88?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=9C=A8=E4=B8=AD=E9=97=B4=EF=BC=8C=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E5=86=8D=E6=98=BE=E7=A4=BA=E6=AD=A3=E7=A1=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 9fe0985d8365b761e9741fa43956f1a1037d0568) --- frame/panel/mainpanelcontrol.cpp | 16 ++++++++++++++++ frame/window/mainwindow.cpp | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/frame/panel/mainpanelcontrol.cpp b/frame/panel/mainpanelcontrol.cpp index 803e1173a..ced6d12fd 100755 --- a/frame/panel/mainpanelcontrol.cpp +++ b/frame/panel/mainpanelcontrol.cpp @@ -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(); } diff --git a/frame/window/mainwindow.cpp b/frame/window/mainwindow.cpp index 7502ddfdb..c650864ec 100755 --- a/frame/window/mainwindow.cpp +++ b/frame/window/mainwindow.cpp @@ -302,7 +302,6 @@ void MainWindow::launch() QWidget::move(m_settings->windowRect(m_curDockPos).topLeft()); setVisible(true); updatePanelVisible(); - expand(); resetPanelEnvironment(false); }); }