From 2e7924a07d45c1d1468552f951dcd2f2dcc948fa Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 26 Sep 2022 22:14:18 -0400 Subject: Add a few basic settings items. Yes I stole qmp's settings design and silently relicensed the (largely identical) code. But who in the world cares, plus I'm the author of qmp anyway. --- qdeduper/imageitem.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'qdeduper/imageitem.cpp') diff --git a/qdeduper/imageitem.cpp b/qdeduper/imageitem.cpp index 7be667c..896334b 100644 --- a/qdeduper/imageitem.cpp +++ b/qdeduper/imageitem.cpp @@ -149,7 +149,6 @@ QSize ImageItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QMod fnt.setBold(true); QFontMetrics fm(fnt); int extra_height = 2 * MARGIN + 2 * BORDER + LINESP + fm.height() + 2 * HKPADD + HKSHDS; - int min_height = 64; int max_height = imh; QSize dim = index.data(ImageItem::ImageItemRoles::dimension_role).value(); @@ -178,12 +177,21 @@ void ImageItemDelegate::resize() Q_EMIT sizeHintChanged(im->index(i, 0)); } -void ImageItemDelegate::setScrollbarMargins(int vw, int hh) +void ImageItemDelegate::set_scrollbar_margins(int vw, int hh) { this->vw = vw; this->hh = hh; } +void ImageItemDelegate::set_min_height(int mh) +{ + if (mh != this->min_height) + { + this->min_height = mh; + resize(); + } +} + void ImageItemDelegate::set_single_item_mode(bool enabled) { if (enabled == singlemode) return; -- cgit v1.2.3