From 11e2b186af64e5a962f5020be100eafc28e50e18 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sat, 25 Nov 2017 18:25:34 +0100 Subject: Use kSqueezedTextLabel for the label text on the statusbar Summary: Following up from D8927; use kSqueezedTextLabel for the label text on the statusbar: - This simplifies the code in updateLabelText() - Remove the eventFilter as it's not needed any more since kSqueezedTextLabel has a resizeEvent function - Specify a stretch factor, 1, for m_label, m_zoomSlider and m_spaceInfo, this prevents the changing of the width of m_label when the label text is updated from changing the widths of the zoomSlider and the spaceInfo widgets as that is a bit too jumpy. (Thanks to the code of konversation statusbar for the hint about using the stretch factor in addWidget()). Reviewers: elvisangelaccio Subscribers: elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D8991 --- src/statusbar/dolphinstatusbar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/statusbar/dolphinstatusbar.h') diff --git a/src/statusbar/dolphinstatusbar.h b/src/statusbar/dolphinstatusbar.h index 582e56907..0b0004e47 100644 --- a/src/statusbar/dolphinstatusbar.h +++ b/src/statusbar/dolphinstatusbar.h @@ -30,6 +30,7 @@ class QProgressBar; class QToolButton; class QSlider; class QTimer; +class KSqueezedTextLabel; /** * @brief Represents the statusbar of a Dolphin view. @@ -102,7 +103,6 @@ signals: protected: void contextMenuEvent(QContextMenuEvent* event) override; - bool eventFilter(QObject* obj, QEvent* event) override; private slots: void showZoomSliderToolTip(int zoomLevel); @@ -140,7 +140,7 @@ private: private: QString m_text; QString m_defaultText; - QLabel* m_label; + KSqueezedTextLabel* m_label; StatusBarSpaceInfo* m_spaceInfo; QSlider* m_zoomSlider; -- cgit v1.3.1