diff options
| author | Akseli Lahtinen <[email protected]> | 2025-02-24 18:39:22 +0000 |
|---|---|---|
| committer | Akseli Lahtinen <[email protected]> | 2025-02-24 18:39:22 +0000 |
| commit | a27443d904bc220615f2c4e8df74187b0c806d8a (patch) | |
| tree | 420ff120b30bb2492a363abf9ddf80a8697d3ad9 /src/views | |
| parent | 69c4792928edef91b5aea06772d02eb0f7c873b4 (diff) | |
Add smaller statusbar and set it as default
- Statusbar has three modes: Small, FullWidth and Disabled
- FullWidth is the original statusbar
- Small is the new default statusbar
- This statusbar overlays on top of the items instead of taking space
- It changes size according to content
- Disabled turns statusbar completely off
- Zoom slider and space information is only shown in full-width statusbar
- Space information is now always on
- If user navigates with keyboard, or scrolls to selection, the scrolling will take the statusbar into account
- This makes sure the statusbar does not cover any items
Related discussion: https://invent.kde.org/system/dolphin/-/issues/50
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinview.cpp | 16 | ||||
| -rw-r--r-- | src/views/dolphinview.h | 12 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index a18f53769..fc4f5e2df 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -2285,6 +2285,22 @@ bool DolphinView::isFolderWritable() const return m_isFolderWritable; } +int DolphinView::horizontalScrollBarHeight() const +{ + if (m_container && m_container->horizontalScrollBar() && m_container->horizontalScrollBar()->isVisible()) { + return m_container->horizontalScrollBar()->height(); + } + return 0; +} + +void DolphinView::setStatusBarOffset(int offset) +{ + KItemListView *view = m_container->controller()->view(); + if (view) { + view->setStatusBarOffset(offset); + } +} + QUrl DolphinView::viewPropertiesUrl() const { if (m_viewPropertiesContext.isEmpty()) { diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index d1667334e..de4bc1af2 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -357,6 +357,18 @@ public: */ bool isFolderWritable() const; + /** + * @returns the height of the scrollbar at the bottom of the view or zero if no such scroll bar is visible. + */ + int horizontalScrollBarHeight() const; + + /** + * Set the offset for any view items that small statusbar would otherwise + * cover. For example, in compact view this is used to make sure no + * item is covered by statusbar. + */ + void setStatusBarOffset(int offset); + public Q_SLOTS: void reload(); |
