Bug 247097

Summary: Context View Video applet: Wrong applet size
Product: [Applications] amarok Reporter: Christian (Fuchs) <kde>
Component: Context View/VideoAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: deveaux.ludovic31, eqisow, hormiere.guillaume, jclavel, leonardo.la.malfa, lfranchi, paulo.miguel.dias, saniokh, simon.esneault, virgolus
Priority: NOR    
Version: 2.3.1-GIT   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 2.3.2
Sentry Crash Report:
Attachments: Labels applet

Description Christian (Fuchs) 2010-08-08 22:49:42 UTC
Version:           2.3.1-GIT (using KDE 4.5.0) 
OS:                Linux

Follow up to: https://bugs.kde.org/show_bug.cgi?id=245342

The Video Applet has the wrong size (width) in amarok git, when used with KDE 4.5. 

In contrary to the other bug, the size seems to stay wrong even when resizing the applet container size. 

Reproducible: Always

Steps to Reproduce:
1) start up amarok
2) have or add the video applet

Actual Results:  
It has the wrong width 

Expected Results:  
It has the correct width

In the other bug report, screenshots are provided. 

Ask if you need further information.
Comment 1 Leonardo La Malfa 2010-08-20 17:17:23 UTC
Created attachment 50784 [details]
Labels applet

I landed here after searching the archive, and reading Bug 245342. Basically, I experience the same issue regarding the Videoclip applet. But at my end, it seems to affect also the Labels applet, which appears way bigger than the others (please, see snapshot attached), and doesn't resize when I change the width of the Context View, or maximise/unmaximise the main window.

I'm running Amarok 2.3.1.90 on Kubuntu 10.04 and KDE 4.5. I can't confirm it is present on the latest git build, though.
Comment 2 Myriam Schweingruber 2010-08-20 19:18:19 UTC
Leonardo, please report your findings about the Labels applet against that component, else this is impossible to trace.
Comment 3 Leonardo La Malfa 2010-08-21 11:26:47 UTC
Oops, I didn't notice that, sorry!

Anyway, after a couple of crashes from yesterday, it seems today all applets (but video) are behaving properly. If anything changes, I'll report it against the proper component. Thank you!
Comment 4 Mark Kretschmann 2010-09-12 14:40:30 UTC
*** Bug 244165 has been marked as a duplicate of this bug. ***
Comment 5 Mark Kretschmann 2010-09-12 14:41:31 UTC
*** Bug 214156 has been marked as a duplicate of this bug. ***
Comment 6 Mark Kretschmann 2010-09-12 14:42:25 UTC
*** Bug 247157 has been marked as a duplicate of this bug. ***
Comment 7 Mark Kretschmann 2010-09-12 15:10:02 UTC
commit 7155b36a89d6f8e232b371732f6144f65859a71a
Author: Mark Kretschmann <kretschmann@kde.org>
Date:   Sun Sep 12 15:11:59 2010 +0200

    Fix incorrect size of VideoClip applet.
    
    BUG: 247097

diff --git a/ChangeLog b/ChangeLog
index 2acb016..73b3334 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@ VERSION 2.3.2
     * Use system date/time format for default name when saving user playlists.
 
   BUGFIXES:
+    * Fixed incorrect size of the VideoClip applet. (BR 247097)
     * Comments embedded in files that contained newlines or tabs could be
       skipped entirely. (BR 223502)
     * The equalizer dialog did not discard changes when clicking "Cancel".
diff --git a/src/context/applets/videoclip/VideoclipApplet.cpp b/src/context/applets/videoclip/VideoclipApplet.cpp
index 6e28436..9ae305d 100644
--- a/src/context/applets/videoclip/VideoclipApplet.cpp
+++ b/src/context/applets/videoclip/VideoclipApplet.cpp
@@ -147,9 +147,6 @@ VideoclipApplet::init()
     //Update the applet (render properly the header)
     update();
 
-    // we connect the geometry changed wit(h a setGeom function which will update the video widget geometry
-    connect ( this, SIGNAL(geometryChanged()), SLOT( setGeom() ) );
-
     connectSource( "videoclip" );
     
     connect( dataEngine( "amarok-videoclip" ), SIGNAL( sourceAdded( const QString & ) ),
@@ -296,32 +293,23 @@ VideoclipApplet::paintInterface( QPainter *p, const QStyleOptionGraphicsItem *op
     // draw rounded rect around title
     drawRoundedRectAroundText( p, m_headerText );
 
-    if( m_widget->isVisible() )
-    {
-        p->save();
-
-        const int frameWidth        = m_scroll->frameWidth();
-        const QScrollBar *scrollBar = m_scroll->horizontalScrollBar();
-        const qreal scrollBarHeight = scrollBar->isVisible() ? scrollBar->height() + 2 : 0;
-        const QSizeF proxySize = m_widget->size();
-        const QSizeF widgetSize( proxySize.width()  - frameWidth * 2,
-                                 proxySize.height() - frameWidth * 2 - scrollBarHeight );
-        const QPointF widgetPos( m_widget->pos().x() + frameWidth,
-                                 m_widget->pos().y() + frameWidth );
-        const QRectF widgetRect( widgetPos, widgetSize );
-
-        QPainterPath path;
-        path.addRoundedRect( widgetRect, 2, 2 );
-        p->fillPath( path, The::paletteHandler()->backgroundColor() );
-
-        p->restore();
-    }
-}
+    p->save();
 
-void
-VideoclipApplet::setGeom( )
-{
-    updateConstraints();
+    const int frameWidth        = m_scroll->frameWidth();
+    const QScrollBar *scrollBar = m_scroll->horizontalScrollBar();
+    const qreal scrollBarHeight = scrollBar->isVisible() ? scrollBar->height() + 2 : 0;
+    const QSizeF proxySize = m_widget->size();
+    const QSizeF widgetSize( proxySize.width()  - frameWidth * 2,
+                             proxySize.height() - frameWidth * 2 - scrollBarHeight );
+    const QPointF widgetPos( m_widget->pos().x() + frameWidth,
+                             m_widget->pos().y() + frameWidth );
+    const QRectF widgetRect( widgetPos, widgetSize );
+
+    QPainterPath path;
+    path.addRoundedRect( widgetRect, 2, 2 );
+    p->fillPath( path, The::paletteHandler()->backgroundColor() );
+
+    p->restore();
 }
 
 void 
@@ -374,8 +362,6 @@ VideoclipApplet::dataUpdated( const QString& name, const Plasma::DataEngine::Dat
 		}
         else if ( data.contains( "item:0" ) )
         {
-            // make the animation didn't stop because it was the mees
-            resize( size().width(), m_height );
             m_headerText->setText( i18n( "Video Clip" ) );
             update();
             // set collapsed
diff --git a/src/context/applets/videoclip/VideoclipApplet.h b/src/context/applets/videoclip/VideoclipApplet.h
index 05c33a7..f863044 100644
--- a/src/context/applets/videoclip/VideoclipApplet.h
+++ b/src/context/applets/videoclip/VideoclipApplet.h
@@ -82,9 +82,8 @@ class VideoclipApplet : public Context::Applet, public Engine::EngineObserver
         virtual void engineNewTrackPlaying();
         virtual void engineStateChanged(Phonon::State, Phonon::State );
         virtual void enginePlaybackEnded( qint64 finalPosition, qint64 trackLength, PlaybackEndedReason reason );
-        
+
     public slots:
-        void    setGeom();
         void    dataUpdated( const QString& name, const Plasma::DataEngine::Data& data );
         void    connectSource( const QString &source );