[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [amarok] src/context/applets/analyzer: Ensure that applet height is always within bounds.
From:       Mark Kretschmann <kretschmann () kde ! org>
Date:       2013-06-30 18:02:08
Message-ID: E1UtLwu-0004OY-SS () scm ! kde ! org
[Download RAW message or body]

Git commit 9ae9c64b392365d6913faf63e28c489ec648424f by Mark Kretschmann.
Committed on 30/06/2013 at 17:54.
Pushed by markey into branch 'master'.

Ensure that applet height is always within bounds.

M  +4    -1    src/context/applets/analyzer/AnalyzerApplet.cpp
M  +1    -1    src/context/applets/analyzer/AnalyzerApplet.h

http://commits.kde.org/amarok/9ae9c64b392365d6913faf63e28c489ec648424f

diff --git a/src/context/applets/analyzer/AnalyzerApplet.cpp \
b/src/context/applets/analyzer/AnalyzerApplet.cpp index b2d5927..c5660f3 100644
--- a/src/context/applets/analyzer/AnalyzerApplet.cpp
+++ b/src/context/applets/analyzer/AnalyzerApplet.cpp
@@ -57,7 +57,7 @@ AnalyzerApplet::init()
     m_analyzerNames["Disco"] = i18nc( "Analyzer name", "Disco" );
 
     KConfigGroup config = Amarok::config( "Analyzer Applet" );
-    setNewHeight( (WidgetHeight)config.readEntry( "Height", (int)Small ) ); // Small \
is the default height +    setNewHeight( (WidgetHeight)config.readEntry( "Height", 0 \
) );  
     setCurrentAnalyzer( config.readEntry( "Current Analyzer", "Blocky" ) );
 }
@@ -154,6 +154,9 @@ AnalyzerApplet::contextualActions ()
 void
 AnalyzerApplet::setNewHeight( WidgetHeight height )
 {
+    if( !( height == Tiny || height == Small || height == Medium || height == Tall ) \
) +        height = Default;
+
     setMinimumHeight( (int)height );
     m_currentHeight = height;
 }
diff --git a/src/context/applets/analyzer/AnalyzerApplet.h \
b/src/context/applets/analyzer/AnalyzerApplet.h index 1e832bc..886c014 100644
--- a/src/context/applets/analyzer/AnalyzerApplet.h
+++ b/src/context/applets/analyzer/AnalyzerApplet.h
@@ -26,7 +26,7 @@ class AnalyzerApplet : public Context::Applet
     Q_OBJECT
 
 public:
-    enum WidgetHeight { Tiny = 80, Small = 120, Medium = 170, Tall = 220 };
+    enum WidgetHeight { Tiny = 80, Small = 120, Medium = 170, Tall = 220, Default = \
Small };  
     AnalyzerApplet( QObject* parent, const QVariantList& args );
     virtual ~AnalyzerApplet();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic