File indexing completed on 2025-01-05 03:51:10
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2015-08-30 0007 * Description : fullscreen overlay 0008 * 0009 * SPDX-FileCopyrightText: 2015 by Luca Carlon <carlon dot luca at gmail dot com> 0010 * SPDX-FileCopyrightText: 2015-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_ITEM_FULL_SCREEN_OVERLAY_H 0017 #define DIGIKAM_ITEM_FULL_SCREEN_OVERLAY_H 0018 0019 // Qt includes 0020 0021 #include <QAbstractButton> 0022 #include <QAbstractItemView> 0023 0024 // Local includes 0025 0026 #include "itemviewhoverbutton.h" 0027 #include "itemdelegateoverlay.h" 0028 0029 namespace Digikam 0030 { 0031 0032 class ItemFullScreenOverlayButton : public ItemViewHoverButton 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 0038 explicit ItemFullScreenOverlayButton(QAbstractItemView* const parentView); 0039 QSize sizeHint() const override; 0040 0041 protected: 0042 0043 QIcon icon() override; 0044 void updateToolTip() override; 0045 }; 0046 0047 // -------------------------------------------------------------------- 0048 0049 class ItemFullScreenOverlay : public HoverButtonDelegateOverlay 0050 { 0051 Q_OBJECT 0052 0053 public: 0054 0055 explicit ItemFullScreenOverlay(QObject* const parent); 0056 void setActive(bool active) override; 0057 0058 static ItemFullScreenOverlay* instance(QObject* const parent); 0059 0060 Q_SIGNALS: 0061 0062 void signalFullscreen(const QList<QModelIndex>& indexes); 0063 0064 protected: 0065 0066 ItemViewHoverButton* createButton() override; 0067 void updateButton(const QModelIndex& index) override; 0068 bool checkIndex(const QModelIndex& index) const override; 0069 void widgetEnterEvent() override; 0070 void widgetLeaveEvent() override; 0071 0072 private Q_SLOTS: 0073 0074 void slotClicked(); 0075 }; 0076 0077 } // namespace Digikam 0078 0079 #endif // DIGIKAM_ITEM_FULL_SCREEN_OVERLAY_H