Commit c7833dfc authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

backport commit #ea4241cd from git/master to frameworks branch

CCBUGS: 261568
parent 5f2bf2fa
......@@ -6,7 +6,7 @@
* Date : 2009-04-30
* Description : selection icon view item at mouse hover
*
* Copyright (C) 2008 by Peter Penz <peter.penz@gmx.at>
* Copyright (C) 2008 by Peter Penz <peter.penz@gmx.at>
* Copyright (C) 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* This program is free software; you can redistribute it
......@@ -39,14 +39,14 @@
namespace Digikam
{
FaceRejectionOverlayButton::FaceRejectionOverlayButton(QAbstractItemView* parentView)
FaceRejectionOverlayButton::FaceRejectionOverlayButton(QAbstractItemView* const parentView)
: ItemViewHoverButton(parentView)
{
}
QSize FaceRejectionOverlayButton::sizeHint() const
{
return QSize(16, 16);
return QSize(32, 32);
}
QIcon FaceRejectionOverlayButton::icon()
......@@ -61,7 +61,7 @@ void FaceRejectionOverlayButton::updateToolTip()
// --------------------------------------------------------------------
FaceRejectionOverlay::FaceRejectionOverlay(QObject* parent)
FaceRejectionOverlay::FaceRejectionOverlay(QObject* const parent)
: HoverButtonDelegateOverlay(parent)
{
}
......@@ -89,9 +89,11 @@ ItemViewHoverButton* FaceRejectionOverlay::createButton()
void FaceRejectionOverlay::updateButton(const QModelIndex& index)
{
const QRect rect = m_view->visualRect(index);
const int size = qBound(16, rect.width() / 8 - 2, 48);
const int gap = 5;
const int x = rect.right() - button()->sizeHint().width() - gap;
const int y = rect.top() + gap;
const int x = rect.right() - gap - size;
const int y = rect.top() + gap;
button()->resize(size, size);
button()->move(QPoint(x, y));
}
......
......@@ -41,7 +41,7 @@ class FaceRejectionOverlayButton : public ItemViewHoverButton
{
public:
explicit FaceRejectionOverlayButton(QAbstractItemView* parentView);
explicit FaceRejectionOverlayButton(QAbstractItemView* const parentView);
virtual QSize sizeHint() const;
protected:
......@@ -58,7 +58,7 @@ class FaceRejectionOverlay : public HoverButtonDelegateOverlay
public:
explicit FaceRejectionOverlay(QObject* parent);
explicit FaceRejectionOverlay(QObject* const parent);
virtual void setActive(bool active);
Q_SIGNALS:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment