diff options
| author | Akseli Lahtinen <[email protected]> | 2024-11-29 09:24:55 +0000 |
|---|---|---|
| committer | Akseli Lahtinen <[email protected]> | 2024-11-29 09:24:55 +0000 |
| commit | 15e0c2a98f480f203ce168b6fa9a2e1f2b0ed8f8 (patch) | |
| tree | 6bc955bb18cf6ff1ded9fb95e2f9b168d8f155ca /src/kitemviews/private | |
| parent | ac1e52ce46120d269ce1b8b49c85ab59d9aeccd1 (diff) | |
Make "open path" and "open path in new tab" scroll to the selected item
**Open Path**
When user clicks on "Open Path" after searching for an item,
user expects the view to show the item immediately.
We wait for the KItemListSmoothScroller to be done with its animation before the
scrollbar sizes are being changed.
**Open Path in New Tab**
When user selects "Open Path in New Tab", we open a new tab to the folder where the file is, then select and set the file current. We need to get the correct tab when opening one, so it has been added as a return value.
BUG:495613
Diffstat (limited to 'src/kitemviews/private')
| -rw-r--r-- | src/kitemviews/private/kitemlistsmoothscroller.cpp | 8 | ||||
| -rw-r--r-- | src/kitemviews/private/kitemlistsmoothscroller.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/kitemviews/private/kitemlistsmoothscroller.cpp b/src/kitemviews/private/kitemlistsmoothscroller.cpp index fd26d198f..517f6d983 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.cpp +++ b/src/kitemviews/private/kitemlistsmoothscroller.cpp @@ -214,4 +214,12 @@ void KItemListSmoothScroller::handleWheelEvent(QWheelEvent *event) m_smoothScrolling = previous; } +bool KItemListSmoothScroller::isAnimating() +{ + if (m_animation) { + return (m_animation->state() == QAbstractAnimation::Running); + } + return false; +} + #include "moc_kitemlistsmoothscroller.cpp" diff --git a/src/kitemviews/private/kitemlistsmoothscroller.h b/src/kitemviews/private/kitemlistsmoothscroller.h index 32effa3d6..9cbfbc1b8 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.h +++ b/src/kitemviews/private/kitemlistsmoothscroller.h @@ -68,6 +68,7 @@ public: */ void handleWheelEvent(QWheelEvent *event); + bool isAnimating(); Q_SIGNALS: /** * Emitted when the scrolling animation has finished |
