diff options
| author | Felix Ernst <[email protected]> | 2024-02-18 13:15:18 +0100 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2024-02-23 10:19:39 +0000 |
| commit | 94828aa307af32191124d4fb8c0033a365dc3568 (patch) | |
| tree | 7d8adddf34132ddc36a6600548a11aac0c4e4ab5 /src/kitemviews/kstandarditemlistwidget.h | |
| parent | 796332d63a32e6fdea83001f4a14c03a8b81228b (diff) | |
Add drag-open animation
This commit adds an animation for folders that makes clear that
they will open or expand soon. This is the case when the option to
open folders during drag operations is enabled and a user drags an
item on top of a folder.
The animation goes like this:
- Replace the folder's icon with the "folder-open" icon
- Go back to the folder's original icon
- Replace the folder's icon with the "folder-open" icon once more
Diffstat (limited to 'src/kitemviews/kstandarditemlistwidget.h')
| -rw-r--r-- | src/kitemviews/kstandarditemlistwidget.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index 06bf0529a..5afadd8cd 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -17,6 +17,7 @@ class KItemListRoleEditor; class KItemListStyleOption; class KItemListView; +class QVariantAnimation; /** * @brief standard implementation of the ItemList widget informant for use with KStandardItemListView and KStandardItemModel. @@ -103,6 +104,8 @@ public: QRectF expansionToggleRect() const override; QRectF selectionToggleRect() const override; QPixmap createDragPixmap(const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; + /** @see KItemListWidget::startActivateSoonAnimation() */ + void startActivateSoonAnimation(int timeUntilActivation) override; static KItemListWidgetInformant *createInformant(); @@ -282,6 +285,9 @@ private: KItemListRoleEditor *m_roleEditor; KItemListRoleEditor *m_oldRoleEditor; + /** @see startActivateSoonAnimation() */ + QPointer<QVariantAnimation> m_activateSoonAnimation; + friend class KStandardItemListWidgetInformant; // Accesses private static methods to be able to // share a common layout calculation }; |
