From d0db071a751febb169cdc2ef8de950f1a14db42b Mon Sep 17 00:00:00 2001 From: juju <296768324@qq.com> Date: Thu, 12 May 2022 15:44:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6size?= =?UTF-8?q?Policy=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第三方插件设置了sizePolicy,但是仍然被遮挡,这是因为dock中未对插件的sizePolicy作出判断,当前已修改 Log: 修复第三方插件sizePolicy无效问题 --- frame/window/mainpanelcontrol.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/window/mainpanelcontrol.cpp b/frame/window/mainpanelcontrol.cpp index ab692675c..815b810a3 100755 --- a/frame/window/mainpanelcontrol.cpp +++ b/frame/window/mainpanelcontrol.cpp @@ -1151,14 +1151,14 @@ void MainPanelControl::calcuDockIconSize(int w, int h, int traySize) m_appAreaSonLayout->setContentsMargins(appLeftAndRightMargin, appTopAndBottomMargin, appLeftAndRightMargin, appTopAndBottomMargin); m_trayAreaLayout->setContentsMargins(trayLeftAndRightMargin, trayTopAndBottomMargin, trayLeftAndRightMargin, trayTopAndBottomMargin); - //因为日期时间插件大小和其他插件大小有异,需要单独设置各插件的边距 - //而不对日期时间插件设置边距 + //因为日期时间插件或第三方插件声明自定义大小 + //而不对自定义大小插件设置边距 for (int i = 0; i < m_pluginLayout->count(); ++ i) { QLayout *layout = m_pluginLayout->itemAt(i)->layout(); if (layout && layout->itemAt(0)) { PluginsItem *pItem = static_cast(layout->itemAt(0)->widget()); - if (pItem && pItem->pluginName() != "datetime") { + if (pItem && pItem->pluginSizePolicy() != PluginsItemInterface::Custom) { layout->setContentsMargins(trayLeftAndRightMargin, trayTopAndBottomMargin, trayLeftAndRightMargin, trayTopAndBottomMargin); } }