summaryrefslogtreecommitdiff
path: root/src/icondelegate.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-06 19:43:21 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-10 10:27:22 +0100
commit1ac3f4d8e8ee7461f047d34e196df40499e89557 (patch)
tree803e663c2da154d0d48a4f284185b37c53e0b2f2 /src/icondelegate.cpp
parent76796796bec37a1670cfc4e0b1e42e7b1096b237 (diff)
Display children contents in collapsed separator.
Diffstat (limited to 'src/icondelegate.cpp')
-rw-r--r--src/icondelegate.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/icondelegate.cpp b/src/icondelegate.cpp
index 901b5731..813395a2 100644
--- a/src/icondelegate.cpp
+++ b/src/icondelegate.cpp
@@ -27,9 +27,16 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
using namespace MOBase;
-IconDelegate::IconDelegate(QObject* parent)
- : QStyledItemDelegate(parent)
+IconDelegate::IconDelegate(QTreeView* view, int column, int compactSize) :
+ QStyledItemDelegate(view), m_column(column), m_compactSize(compactSize), m_compact(false)
{
+ if (view) {
+ connect(view->header(), &QHeaderView::sectionResized, [=](int column, int, int size) {
+ if (column == m_column) {
+ m_compact = size < m_compactSize;
+ }
+ });
+ }
}
void IconDelegate::paintIcons(