From 7ae94915f72857ed4825ef6b78e4753896be28f9 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 3 Apr 2010 08:48:35 +0000 Subject: Cleanup of statusbar widgets: - Provide proper size hints instead of hiding extensions on small widths - Provide context menu, which allows to enable/disable the zoom level extension and the space info extension. Also copying the status bar text is possible (useful e. g. for error messages). BUG: 188980 svn path=/trunk/KDE/kdebase/apps/; revision=1110498 --- src/statusbar/dolphinstatusbar.h | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'src/statusbar/dolphinstatusbar.h') diff --git a/src/statusbar/dolphinstatusbar.h b/src/statusbar/dolphinstatusbar.h index 2fed4788d..6f5844270 100644 --- a/src/statusbar/dolphinstatusbar.h +++ b/src/statusbar/dolphinstatusbar.h @@ -21,8 +21,8 @@ #ifndef DOLPHINSTATUSBAR_H #define DOLPHINSTATUSBAR_H -#include #include +#include class DolphinView; class KUrl; @@ -39,7 +39,7 @@ class QSlider; * The statusbar allows to show messages and progress * information. */ -class DolphinStatusBar : public KHBox +class DolphinStatusBar : public QWidget { Q_OBJECT @@ -56,7 +56,7 @@ public: Error }; - DolphinStatusBar(QWidget* parent, DolphinView* view); + explicit DolphinStatusBar(QWidget* parent, DolphinView* view); virtual ~DolphinStatusBar(); @@ -97,10 +97,7 @@ public: * operations. */ void setProgress(int percent); - int progress() const - { - return m_progress; - } + int progress() const; /** * Clears the message text of the status bar by replacing @@ -115,7 +112,7 @@ public: * is cleared by DolphinStatusBar::clear(). */ void setDefaultText(const QString& text); - const QString& defaultText() const; + QString defaultText() const; /** * Refreshes the status bar to get synchronized with the (updated) Dolphin settings. @@ -123,8 +120,8 @@ public: void refresh(); protected: - /** @see QWidget::resizeEvent() */ - virtual void resizeEvent(QResizeEvent* event); + /** @see QWidget::contextMenuEvent() */ + virtual void contextMenuEvent(QContextMenuEvent* event); private slots: /** @@ -139,13 +136,6 @@ private slots: */ void setZoomLevel(int zoomLevel); - /** - * Assures that the text of the statusbar stays visible by hiding - * the space information widget or the zoom slider widget if not - * enough width is available. - */ - void assureVisibleText(); - void zoomOut(); void zoomIn(); void showZoomSliderToolTip(int zoomLevel); -- cgit v1.3.1