mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
hide item set keep parent to MainPanel before show
Change-Id: If32f1e9a7c3eb2b2c64204137315ef93fa0a3aa7
This commit is contained in:
parent
b0c9dfb414
commit
42316299df
Notes:
Deepin Code Review
2017-04-25 09:59:46 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Tue, 25 Apr 2017 09:59:44 +0800 Reviewed-on: https://cr.deepin.io/22495 Project: dde/dde-dock Branch: refs/heads/master
@ -27,6 +27,8 @@ void DockPluginsController::itemAdded(PluginsItemInterface * const itemInter, co
|
||||
return;
|
||||
|
||||
PluginsItem *item = new PluginsItem(itemInter, itemKey);
|
||||
item->setVisible(false);
|
||||
|
||||
m_pluginList[itemInter][itemKey] = item;
|
||||
|
||||
emit pluginItemInserted(item);
|
||||
|
@ -21,16 +21,17 @@ PluginsItem::PluginsItem(PluginsItemInterface* const pluginInter, const QString
|
||||
m_itemKey(itemKey),
|
||||
m_draging(false)
|
||||
{
|
||||
Q_ASSERT(m_centralWidget);
|
||||
qDebug() << "load plugins item: " << pluginInter->pluginName() << itemKey << m_centralWidget;
|
||||
|
||||
m_centralWidget->setParent(this);
|
||||
m_centralWidget->setVisible(true);
|
||||
m_centralWidget->installEventFilter(this);
|
||||
|
||||
QBoxLayout *hLayout = new QHBoxLayout;
|
||||
hLayout->addWidget(m_centralWidget);
|
||||
hLayout->setSpacing(0);
|
||||
hLayout->setMargin(0);
|
||||
|
||||
m_centralWidget->installEventFilter(this);
|
||||
m_centralWidget->setVisible(true);
|
||||
|
||||
setLayout(hLayout);
|
||||
setAccessibleName(pluginInter->pluginName() + "-" + m_itemKey);
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
@ -578,7 +578,8 @@ void MainPanel::adjustItemSize()
|
||||
void MainPanel::itemInserted(const int index, DockItem *item)
|
||||
{
|
||||
// hide new item, display it after size adjust finished
|
||||
item->hide();
|
||||
item->setVisible(false);
|
||||
item->setParent(this);
|
||||
|
||||
manageItem(item);
|
||||
m_itemLayout->insertWidget(index, item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user