mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fixed(fixed plugin):save fixed plugin pos
固定区域的插件位置保存
This commit is contained in:
parent
4f96990fa3
commit
7b88efa80f
@ -165,8 +165,6 @@ void DockItemManager::itemMoved(DockItem *const sourceItem, DockItem *const targ
|
|||||||
// for app move, index 0 is launcher item, need to pass it.
|
// for app move, index 0 is launcher item, need to pass it.
|
||||||
if (moveType == DockItem::App && replaceType == DockItem::App)
|
if (moveType == DockItem::App && replaceType == DockItem::App)
|
||||||
m_appInter->MoveEntry(moveIndex - 1, replaceIndex - 1);
|
m_appInter->MoveEntry(moveIndex - 1, replaceIndex - 1);
|
||||||
|
|
||||||
refreshFSTItemSpliterVisible();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockItemManager::itemAdded(const QString &appDesktop, int idx)
|
void DockItemManager::itemAdded(const QString &appDesktop, int idx)
|
||||||
@ -174,22 +172,6 @@ void DockItemManager::itemAdded(const QString &appDesktop, int idx)
|
|||||||
m_appInter->RequestDock(appDesktop, idx);
|
m_appInter->RequestDock(appDesktop, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh right spliter visible of fashion tray plugin item
|
|
||||||
void DockItemManager::refreshFSTItemSpliterVisible()
|
|
||||||
{
|
|
||||||
if (DockSettings::Instance().displayMode() != Dock::DisplayMode::Fashion) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < m_itemList.size(); ++i) {
|
|
||||||
if (m_itemList.at(i)->itemType() == DockItem::ItemType::TrayPlugin) {
|
|
||||||
static_cast<TrayPluginItem *>(m_itemList.at(i).data())
|
|
||||||
->setRightSplitVisible(i != (m_itemList.size() - 1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DockItemManager::appItemAdded(const QDBusObjectPath &path, const int index)
|
void DockItemManager::appItemAdded(const QDBusObjectPath &path, const int index)
|
||||||
{
|
{
|
||||||
// 第一个是启动器
|
// 第一个是启动器
|
||||||
@ -248,11 +230,13 @@ void DockItemManager::pluginItemInserted(PluginsItem *item)
|
|||||||
{
|
{
|
||||||
manageItem(item);
|
manageItem(item);
|
||||||
|
|
||||||
|
DockItem::ItemType pluginType = item->itemType();
|
||||||
|
|
||||||
// find first plugins item position
|
// find first plugins item position
|
||||||
int firstPluginPosition = -1;
|
int firstPluginPosition = -1;
|
||||||
for (int i(0); i != m_itemList.size(); ++i) {
|
for (int i(0); i != m_itemList.size(); ++i) {
|
||||||
DockItem::ItemType type = m_itemList[i]->itemType();
|
DockItem::ItemType type = m_itemList[i]->itemType();
|
||||||
if (type != DockItem::Plugins)
|
if (type != pluginType)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
firstPluginPosition = i;
|
firstPluginPosition = i;
|
||||||
@ -284,9 +268,10 @@ void DockItemManager::pluginItemInserted(PluginsItem *item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_itemList.insert(insertIndex, item);
|
m_itemList.insert(insertIndex, item);
|
||||||
emit itemInserted(insertIndex - firstPluginPosition, item);
|
if(pluginType == DockItem::FixedPlugin)
|
||||||
|
insertIndex ++;
|
||||||
|
|
||||||
refreshFSTItemSpliterVisible();
|
emit itemInserted(insertIndex - firstPluginPosition, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockItemManager::pluginItemRemoved(PluginsItem *item)
|
void DockItemManager::pluginItemRemoved(PluginsItem *item)
|
||||||
|
@ -60,7 +60,6 @@ public slots:
|
|||||||
void updatePluginsItemOrderKey();
|
void updatePluginsItemOrderKey();
|
||||||
void itemMoved(DockItem *const sourceItem, DockItem *const targetItem);
|
void itemMoved(DockItem *const sourceItem, DockItem *const targetItem);
|
||||||
void itemAdded(const QString &appDesktop, int idx);
|
void itemAdded(const QString &appDesktop, int idx);
|
||||||
void refreshFSTItemSpliterVisible();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit DockItemManager(QObject *parent = nullptr);
|
explicit DockItemManager(QObject *parent = nullptr);
|
||||||
|
@ -246,9 +246,6 @@ void MainPanelControl::insertItem(int index, DockItem *item)
|
|||||||
addFixedAreaItem(0, item);
|
addFixedAreaItem(0, item);
|
||||||
break;
|
break;
|
||||||
case DockItem::FixedPlugin:
|
case DockItem::FixedPlugin:
|
||||||
if (index == 0) {
|
|
||||||
index += 1;
|
|
||||||
}
|
|
||||||
addFixedAreaItem(index, item);
|
addFixedAreaItem(index, item);
|
||||||
break;
|
break;
|
||||||
case DockItem::App:
|
case DockItem::App:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user