diff --git a/app/SettingsBase.cpp b/app/SettingsBase.cpp --- a/app/SettingsBase.cpp +++ b/app/SettingsBase.cpp @@ -145,6 +145,11 @@ initHelpMenu(); configureAction->setIcon(QIcon::fromTheme(QStringLiteral("settings-configure"))); + // There's nothing to configure in info center mode + if (m_mode == BaseMode::InfoCenter) { + configureAction->setVisible(false); + } + // Then a spacer so the search line-edit is kept separate spacerAction = new QWidgetAction( this ); spacerAction->setDefaultWidget(spacerWidget); diff --git a/sidebar/SidebarMode.cpp b/sidebar/SidebarMode.cpp --- a/sidebar/SidebarMode.cpp +++ b/sidebar/SidebarMode.cpp @@ -276,8 +276,8 @@ bool m_introPageVisible = true; }; -SidebarMode::SidebarMode( QObject *parent, const QVariantList& ) - : BaseMode( parent ) +SidebarMode::SidebarMode( QObject *parent, const QVariantList &args ) + : BaseMode( parent, args ) , d( new Private() ) { qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); @@ -374,6 +374,12 @@ connect( d->moduleView, &ModuleView::moduleChanged, this, &SidebarMode::moduleLoaded ); d->quickWidget = nullptr; moduleView()->setFaceType(KPageView::Plain); + if (applicationMode() == BaseMode::InfoCenter) { + d->moduleView->setSaveStatistics(false); + d->moduleView->setApplyVisible(false); + d->moduleView->setDefaultsVisible(false); + d->moduleView->setResetVisible(false); + } } QAction *SidebarMode::action(const QString &name) const @@ -452,7 +458,13 @@ return; } - setIntroPageVisible(false); + if (homeItem()) { + d->m_introPageVisible = activeModule == d->categorizedModel->mapFromSource(d->model->indexForItem(homeItem())); + emit introPageVisibleChanged(); + } else { + setIntroPageVisible(false); + } + if ( mi->children().length() < 1) { d->moduleView->loadModule( activeModule ); } else { @@ -575,16 +587,25 @@ return; } - if (introPageVisible) { - d->activeCategoryRow = -1; - emit activeCategoryRowChanged(); - d->activeSubCategoryRow = -1; - emit activeSubCategoryRowChanged(); - d->placeHolderWidget->show(); - d->moduleView->hide(); - } else { + // TODO: Make the intro page of SystemSettings a KCM as well + if (homeItem()) { d->placeHolderWidget->hide(); d->moduleView->show(); + if (introPageVisible) { + loadModule(d->categorizedModel->mapFromSource(d->model->indexForItem(homeItem()))); + } + } else { + if (introPageVisible) { + d->activeCategoryRow = -1; + emit activeCategoryRowChanged(); + d->activeSubCategoryRow = -1; + emit activeSubCategoryRowChanged(); + d->placeHolderWidget->show(); + d->moduleView->hide(); + } else { + d->placeHolderWidget->hide(); + d->moduleView->show(); + } } d->m_introPageVisible = introPageVisible; @@ -682,6 +703,12 @@ d->mostUsedToolTipManager = new ToolTipManager(d->mostUsedModel, d->placeHolderWidget, ToolTipManager::ToolTipPosition::BottomCenter); d->mostUsedModel->setResultModel(new ResultModel( AllResources | Agent(QStringLiteral("org.kde.systemsettings")) | HighScoredFirst | Limit(5), this)); + + if (homeItem()) { + d->placeHolderWidget->hide(); + d->moduleView->show(); + loadModule(d->categorizedModel->mapFromSource(d->model->indexForItem(homeItem()))); + } } bool SidebarMode::eventFilter(QObject* watched, QEvent* event)