fix: 修复从启动器拖动应用到任务栏上面始终显示到任务栏最后面的问题
调用驻留接口的时候,将当前的应用图标根据索引插入到合适的位置 Log: Influence: 将启动器中的图标拖动到任务栏上,观察该图标是否显示在任务栏合适的位置 Task: https://pms.uniontech.com/task-view-217779.html Change-Id: I1a0109cba21ff7edc9f9ad508b00557089e026a8
This commit is contained in:
parent
2a229d30c8
commit
f6e6739532
@ -536,7 +536,7 @@ bool Dock::requestDock(QString desktopFile, int index)
|
||||
return false;
|
||||
|
||||
entry->startExport();
|
||||
m_entries->append(entry);
|
||||
m_entries->insert(entry, index);
|
||||
|
||||
saveDockedApps();
|
||||
return true;
|
||||
|
@ -52,15 +52,15 @@ Entry *Entries::getByInnerId(QString innerId)
|
||||
|
||||
void Entries::append(Entry *entry)
|
||||
{
|
||||
// 如果当前应用在列表中存在(通常是该应用为最近打开应用但是关闭了最近打开应用的接口或者当前为高效模式)
|
||||
if (m_items.contains(entry))
|
||||
m_items.removeOne(entry);
|
||||
|
||||
insert(entry, -1);
|
||||
}
|
||||
|
||||
void Entries::insert(Entry *entry, int index)
|
||||
{
|
||||
// 如果当前应用在列表中存在(通常是该应用为最近打开应用但是关闭了最近打开应用的接口或者当前为高效模式)
|
||||
if (m_items.contains(entry))
|
||||
m_items.removeOne(entry);
|
||||
|
||||
if (index < 0 || index >= m_items.size()) {
|
||||
// append
|
||||
index = m_items.size();
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
QVector<Entry *> filterDockedEntries();
|
||||
Entry *getByInnerId(QString innerId);
|
||||
void append(Entry *entry);
|
||||
void insert(Entry *entry, int index);
|
||||
void remove(Entry *entry);
|
||||
void move(int oldIndex, int newIndex);
|
||||
Entry *getByWindowPid(int pid);
|
||||
@ -61,7 +62,6 @@ public:
|
||||
private:
|
||||
void insertCb(Entry *entry, int index);
|
||||
void removeCb(Entry *entry);
|
||||
void insert(Entry *entry, int index);
|
||||
|
||||
private:
|
||||
QList<Entry *> m_items;
|
||||
|
Loading…
Reference in New Issue
Block a user