Commit 04c25409 authored by Ismael Asensio's avatar Ismael Asensio
Browse files

IconMode: Switch to the selected KCM

When systemsettings is launched in Icon Mode to open a specific KCM,
switch to that KCM.

BUG: 444565
FIXED-IN: 5.26
parent ce0a4ce3
......@@ -587,3 +587,14 @@ qreal ModuleView::headerHeight() const
{
return d->mCustomHeader->minimumHeight();
}
void ModuleView::setActiveModule(const QString &moduleName)
{
const auto pageList = d->mPagesPluginIdMap.keys();
for (const auto page : pageList) {
if (d->mPagesPluginIdMap.value(page) == moduleName) {
d->mPageWidget->setCurrentPage(page);
break;
}
}
}
......@@ -124,6 +124,8 @@ public:
qreal headerHeight() const;
void setHeaderHeight(qreal height);
void setActiveModule(const QString &moduleName);
public Q_SLOTS:
/**
* Loads the module specified by menuItem.\n
......
......@@ -169,6 +169,11 @@ void IconMode::changeModuleWithArgs(const QModelIndex &activeModule, const QStri
QModelIndex subpageItem = activeModule.model()->index(done, 0, activeModule);
d->moduleView->loadModule(subpageItem, args);
}
MenuItem *item = activeModule.data(Qt::UserRole).value<MenuItem *>();
if (item) {
d->moduleView->setActiveModule(item->name());
}
}
void IconMode::moduleLoaded()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment