diff --git a/src/modules/plasmalnf/Config.cpp b/src/modules/plasmalnf/Config.cpp index f5fa59b89..123adecdb 100644 --- a/src/modules/plasmalnf/Config.cpp +++ b/src/modules/plasmalnf/Config.cpp @@ -43,6 +43,8 @@ Config::Config( QObject* parent ) filter->setFilterRole( ThemesModel::ShownRole ); filter->setFilterFixedString( QStringLiteral( "true" ) ); filter->setSourceModel( m_themeModel ); + filter->setSortRole( ThemesModel::LabelRole ); + filter->sort( 0 ); m_filteredModel = filter; } diff --git a/src/modules/plasmalnf/PlasmaLnfPage.cpp b/src/modules/plasmalnf/PlasmaLnfPage.cpp index 095bd3ec9..cf1330912 100644 --- a/src/modules/plasmalnf/PlasmaLnfPage.cpp +++ b/src/modules/plasmalnf/PlasmaLnfPage.cpp @@ -17,7 +17,8 @@ #include "utils/Logger.h" #include "utils/Retranslator.h" -#include +#include + #include #include @@ -42,4 +43,18 @@ PlasmaLnfPage::PlasmaLnfPage( Config* config, QWidget* parent ) "selection will give you a live preview of that look-and-feel." ) ); } ) connect( this, &PlasmaLnfPage::plasmaThemeSelected, config, &Config::setTheme ); + + QComboBox* box = new QComboBox(); + box->setModel( m_config->themeModel() ); + ui->verticalLayout->addWidget( box ); + + connect( box, QOverload< int >::of( &QComboBox::currentIndexChanged ), [this]( int index ) { + auto* model = m_config->themeModel(); + auto id = model->data( model->index( index, 0 ), ThemesModel::KeyRole ).toString(); + cDebug() << "ComboBox selected" << index << id; + if ( !id.isEmpty() ) + { + emit plasmaThemeSelected( id ); + } + } ); }