| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
#pragma once |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#include <QAbstractButton> |
| 20 |
#include <QAbstractItemView> |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#include "itemviewhoverbutton.h" |
| 25 |
#include "itemdelegateoverlay.h" |
| 26 |
#include "showfotoitemviewdelegate.h" |
| 27 |
|
| 28 |
using namespace Digikam; |
| 29 |
|
| 30 |
namespace ShowFoto |
| 31 |
{ |
| 32 |
|
| 33 |
class ShowfotoCoordinatesOverlayWidget : public QAbstractButton |
| 34 |
{ |
| 35 |
Q_OBJECT |
| 36 |
|
| 37 |
public: |
| 38 |
|
| 39 |
explicit ShowfotoCoordinatesOverlayWidget(QWidget* const parent = nullptr); |
| 40 |
|
| 41 |
protected: |
| 42 |
|
| 43 |
void paintEvent(QPaintEvent*) override; |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
class ShowfotoCoordinatesOverlay : public AbstractWidgetDelegateOverlay |
| 49 |
{ |
| 50 |
Q_OBJECT |
| 51 |
REQUIRE_DELEGATE(ShowfotoItemViewDelegate) |
| 52 |
|
| 53 |
public: |
| 54 |
|
| 55 |
explicit ShowfotoCoordinatesOverlay(QObject* const parent); |
| 56 |
ShowfotoCoordinatesOverlayWidget* buttonWidget() const; |
| 57 |
|
| 58 |
protected: |
| 59 |
|
| 60 |
void updatePosition(); |
| 61 |
|
| 62 |
QWidget* createWidget() override; |
| 63 |
void setActive(bool active) override; |
| 64 |
void visualChange() override; |
| 65 |
bool checkIndex(const QModelIndex& index) const override; |
| 66 |
void slotEntered(const QModelIndex& index) override; |
| 67 |
|
| 68 |
protected: |
| 69 |
|
| 70 |
QPersistentModelIndex m_index; |
| 71 |
}; |
| 72 |
|
| 73 |
} |