Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
digiKam
Commits
ea4241cd
Commit
ea4241cd
authored
Sep 06, 2015
by
Gilles Caulier
🗼
Browse files
adjust face rejection overlay icon size to be dynamic with thumbnail size
CCBUGS: 261568
parent
7c98dd97
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/items/overlays/facerejectionoverlay.cpp
View file @
ea4241cd
...
...
@@ -40,21 +40,21 @@
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
);
}
QPixmap
FaceRejectionOverlayButton
::
icon
()
{
return
KIconLoader
::
global
()
->
loadIcon
(
"dialog-close"
,
KIconLoader
::
NoGroup
,
KIconLoader
::
Size
Small
);
KIconLoader
::
Size
Medium
);
}
void
FaceRejectionOverlayButton
::
updateToolTip
()
...
...
@@ -64,7 +64,7 @@ void FaceRejectionOverlayButton::updateToolTip()
// --------------------------------------------------------------------
FaceRejectionOverlay
::
FaceRejectionOverlay
(
QObject
*
parent
)
FaceRejectionOverlay
::
FaceRejectionOverlay
(
QObject
*
const
parent
)
:
HoverButtonDelegateOverlay
(
parent
)
{
}
...
...
@@ -92,9 +92,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
));
}
...
...
app/items/overlays/facerejectionoverlay.h
View file @
ea4241cd
...
...
@@ -42,7 +42,7 @@ class FaceRejectionOverlayButton : public ItemViewHoverButton
{
public:
explicit
FaceRejectionOverlayButton
(
QAbstractItemView
*
parentView
);
explicit
FaceRejectionOverlayButton
(
QAbstractItemView
*
const
parentView
);
virtual
QSize
sizeHint
()
const
;
protected:
...
...
@@ -59,7 +59,7 @@ class FaceRejectionOverlay : public HoverButtonDelegateOverlay
public:
explicit
FaceRejectionOverlay
(
QObject
*
parent
);
explicit
FaceRejectionOverlay
(
QObject
*
const
parent
);
virtual
void
setActive
(
bool
active
);
Q_SIGNALS:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment