diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-24 20:15:34 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-24 20:15:34 -0700 |
commit | 086a7e19f099c6c9b9529afb2360300e534876bf (patch) | |
tree | 1ab5d7313e406ef8e07091a528792d17fbc7149f /launcher/minecraft/mod/TexturePackFolderModel.cpp | |
parent | 74e7c13a177afdb503a642cb9c97d71e72249291 (diff) | |
download | PrismLauncher-086a7e19f099c6c9b9529afb2360300e534876bf.tar.gz PrismLauncher-086a7e19f099c6c9b9529afb2360300e534876bf.tar.bz2 PrismLauncher-086a7e19f099c6c9b9529afb2360300e534876bf.zip |
feat: Column on left, hideable
- columns are hideable (saves to settings)
- image column moved to left
- datamodals can provide resize modes
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft/mod/TexturePackFolderModel.cpp')
-rw-r--r-- | launcher/minecraft/mod/TexturePackFolderModel.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/launcher/minecraft/mod/TexturePackFolderModel.cpp b/launcher/minecraft/mod/TexturePackFolderModel.cpp index e115cce6..c88f8f37 100644 --- a/launcher/minecraft/mod/TexturePackFolderModel.cpp +++ b/launcher/minecraft/mod/TexturePackFolderModel.cpp @@ -45,7 +45,9 @@ TexturePackFolderModel::TexturePackFolderModel(const QString& dir, std::shared_ptr<const BaseInstance> instance) : ResourceFolderModel(QDir(dir), instance) { - m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::DATE, SortType::NAME }; + m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::NAME, SortType::DATE }; + m_column_resize_modes = { QHeaderView::ResizeToContents, QHeaderView::ResizeToContents, QHeaderView::Stretch, QHeaderView::ResizeToContents}; + } Task* TexturePackFolderModel::createUpdateTask() @@ -115,6 +117,8 @@ QVariant TexturePackFolderModel::headerData(int section, Qt::Orientation orienta switch (role) { case Qt::DisplayRole: switch (section) { + case ActiveColumn: + return tr("Enable"); case NameColumn: return tr("Name"); case DateColumn: @@ -149,4 +153,5 @@ QVariant TexturePackFolderModel::headerData(int section, Qt::Orientation orienta int TexturePackFolderModel::columnCount(const QModelIndex& parent) const { return parent.isValid() ? 0 : NUM_COLUMNS; -}
\ No newline at end of file +} + |