diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-28 16:44:11 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-31 11:54:31 -0400 |
| commit | 64604c966aaade7ceb9f5e547dfad8f51372434c (patch) | |
| tree | 9885497bada96d852b05725817d3340c7a37cb4c /src/modinfodialog.cpp | |
| parent | a202170aab35bc486114896e011239b1ef560aad (diff) | |
elide first two columns of the advanced list
Diffstat (limited to 'src/modinfodialog.cpp')
| -rw-r--r-- | src/modinfodialog.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index c936f150..9db31da3 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -319,6 +319,20 @@ bool ExpanderWidget::opened() const } +class ElideLeftDelegate : public QStyledItemDelegate +{ +public: + using QStyledItemDelegate::QStyledItemDelegate; + +protected: + void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const + { + QStyledItemDelegate::initStyleOption(option, index); + option->textElideMode = Qt::ElideLeft; + } +}; + + ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directory, bool unmanaged, OrganizerCore *organizerCore, PluginContainer *pluginContainer, QWidget *parent) : TutorableDialog("ModInfoDialog", parent), ui(new Ui::ModInfoDialog), m_ModInfo(modInfo), m_ThumbnailMapper(this), m_RequestStarted(false), @@ -438,6 +452,17 @@ ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directo m_overwrittenExpander.set(ui->overwrittenExpander, ui->overwrittenTree, true); m_nonconflictExpander.set(ui->noConflictExpander, ui->noConflictTree); + + // left-elide the overwrites column so that the nearest are visible + ui->conflictsAdvancedList->setItemDelegateForColumn( + 0, new ElideLeftDelegate(ui->conflictsAdvancedList)); + + // left-elide the file column to see filenames + ui->conflictsAdvancedList->setItemDelegateForColumn( + 1, new ElideLeftDelegate(ui->conflictsAdvancedList)); + + // don't elide the overwritten by column so that the nearest are visible + connect(ui->conflictsAdvancedShowNoConflict, &QCheckBox::clicked, [&] { refreshConflictLists(false, true); }); |
