[plasmalnf] Add a description

- add a role for description
- change view to a table view
main
Adriaan de Groot 4 years ago
parent 258a14bea2
commit 58ea40c14d

@ -17,10 +17,9 @@
#include "utils/Logger.h"
#include "utils/Retranslator.h"
#include <QListView>
#include <KPackage/Package>
#include <KPackage/PackageLoader>
#include <QHeaderView>
#include <QStyledItemDelegate>
#include <QTableView>
PlasmaLnfPage::PlasmaLnfPage( Config* config, QWidget* parent )
: QWidget( parent )
@ -43,8 +42,9 @@ PlasmaLnfPage::PlasmaLnfPage( Config* config, QWidget* parent )
} )
connect( this, &PlasmaLnfPage::plasmaThemeSelected, config, &Config::setTheme );
QListView* view = new QListView( this );
view->setUniformItemSizes( true );
QTableView* view = new QTableView( this );
view->verticalHeader()->hide();
view->horizontalHeader()->hide();
view->setModel( m_config->themeModel() );
ui->verticalLayout->addWidget( view );

@ -126,6 +126,8 @@ ThemesModel::data( const QModelIndex& index, int role ) const
return item.id;
case ShownRole:
return item.show;
case DescriptionRole:
return item.description;
default:
return QVariant();
}

@ -26,6 +26,7 @@ public:
LabelRole = Qt::DisplayRole,
KeyRole = Qt::UserRole,
ShownRole,
DescriptionRole,
ImageRole
};

Loading…
Cancel
Save