mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-15 11:54:32 -04:00
[plasmalnf] Add a description
- add a role for description - change view to a table view
This commit is contained in:
parent
258a14bea2
commit
58ea40c14d
3 changed files with 9 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue