┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/statusbar/statusbarspaceinfo.h
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2023-11-18 12:31:00 +0100
committerFelix Ernst <[email protected]>2023-11-24 11:52:54 +0000
commitd3637f380ccca26a281331a02ce76ed60e84cfe3 (patch)
tree82f998010a89bb37bd6fbb88695c284666f85484 /src/statusbar/statusbarspaceinfo.h
parente8fcef32b25b847e997df3a8232eb20980989794 (diff)
Turn free space label into a flat button
The usage of a label to show this space information is problematic because there are features/actions hidden behind clicking the label. A button makes this clear. It also fixes the accessibility of this control because previously this info would never be read out by screen readers as it couldn't get keyboard focus. A side-effect of this change is that the free disk space bar looks more normal with non-Breeze styles. This had been a long-standing issue.
Diffstat (limited to 'src/statusbar/statusbarspaceinfo.h')
-rw-r--r--src/statusbar/statusbarspaceinfo.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/statusbar/statusbarspaceinfo.h b/src/statusbar/statusbarspaceinfo.h
index 932f09b7b..9048bd10c 100644
--- a/src/statusbar/statusbarspaceinfo.h
+++ b/src/statusbar/statusbarspaceinfo.h
@@ -6,13 +6,16 @@
#ifndef STATUSBARSPACEINFO_H
#define STATUSBARSPACEINFO_H
-#include <KCapacityBar>
-
#include <QUrl>
+#include <QWidget>
class QHideEvent;
class QShowEvent;
+class QMenu;
class QMouseEvent;
+class QToolButton;
+
+class KCapacityBar;
class SpaceInfoObserver;
@@ -20,7 +23,7 @@ class SpaceInfoObserver;
* @short Shows the available space for the volume represented
* by the given URL as part of the status bar.
*/
-class StatusBarSpaceInfo : public KCapacityBar
+class StatusBarSpaceInfo : public QWidget
{
Q_OBJECT
@@ -40,13 +43,17 @@ public:
protected:
void showEvent(QShowEvent *event) override;
void hideEvent(QHideEvent *event) override;
- void mousePressEvent(QMouseEvent *event) override;
+
+ void updateMenu();
private Q_SLOTS:
void slotValuesChanged();
private:
QScopedPointer<SpaceInfoObserver> m_observer;
+ KCapacityBar *m_capacityBar;
+ QToolButton *m_textInfoButton;
+ QMenu *m_buttonMenu;
QUrl m_url;
bool m_ready;
bool m_shown;