From a27443d904bc220615f2c4e8df74187b0c806d8a Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Mon, 24 Feb 2025 18:39:22 +0000 Subject: 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 --- src/statusbar/dolphinstatusbar.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'src/statusbar/dolphinstatusbar.h') diff --git a/src/statusbar/dolphinstatusbar.h b/src/statusbar/dolphinstatusbar.h index a620a0117..b4ddcd95e 100644 --- a/src/statusbar/dolphinstatusbar.h +++ b/src/statusbar/dolphinstatusbar.h @@ -39,7 +39,10 @@ public: QString text() const; - enum class CancelLoading { Allowed, Disallowed }; + enum class CancelLoading { + Allowed, + Disallowed + }; /** * Shows progress for a task on the status bar. * @@ -85,6 +88,22 @@ public: */ void updateSpaceInfo(); + /** + * Changes the statusbar between disabled, small, and full width + * depending on settings enabled. + */ + void updateMode(); + + /** + * Updates the statusbar width to fit all content. + */ + void updateWidthToContent(); + + /** + * @return The amount of clipping done to the small statusbar side and bottom. + */ + int clippingAmount() const; + public Q_SLOTS: void setText(const QString &text); void setUrl(const QUrl &url); @@ -103,6 +122,21 @@ Q_SIGNALS: */ void showMessage(const QString &message, KMessageWidget::MessageType messageType); + /** + * Emitted when statusbar mode is changed. + */ + void modeUpdated(); + + /** + * Emitted when statusbar width is updated to fit content. + */ + void widthUpdated(); + + /** + * Emitted when statusbar url has changed. + */ + void urlChanged(); + protected: void contextMenuEvent(QContextMenuEvent *event) override; void paintEvent(QPaintEvent *paintEvent) override; -- cgit v1.3.1