aboutsummaryrefslogtreecommitdiff
path: root/qdeduper/imageitem.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-26 22:14:18 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-26 22:17:44 -0400
commit2e7924a07d45c1d1468552f951dcd2f2dcc948fa (patch)
tree24b6788b505a82f70f7dd82f8d9f1570fc88fef1 /qdeduper/imageitem.cpp
parent43a058c0957bec3fc564a7a019bdc03829e32e70 (diff)
downloaddeduper-2e7924a07d45c1d1468552f951dcd2f2dcc948fa.tar.xz
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.
Diffstat (limited to 'qdeduper/imageitem.cpp')
-rw-r--r--qdeduper/imageitem.cpp12
1 files changed, 10 insertions, 2 deletions
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<QSize>();
@@ -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;