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

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/widgets
From:       Nikolaj Hald Nielsen <nhnFreespirit () gmail ! com>
Date:       2009-06-10 12:12:10
Message-ID: 1244635930.418083.16835.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 979661 by nhnielsen:

Make it possible to change the size (only downwards) of playlist layout elements if \
the combined width of all elements exceed 100%. This can happen if dragging tokens \
between rows or manually editing a layout xml file, and previously made it impossible \
to fix the layout as there was no way to change the sizes of any od the elements. \
Later a warning should be added for rows where the set width of items exceeds 100%, \
but this requires a string change so it will have to wait for a later version. Also \
                fix the size of the width slider so it does not overlap width the \
                width display.
BUG: 195846 


 M  +10 -2     TokenWithLayout.cpp  


--- trunk/extragear/multimedia/amarok/src/widgets/TokenWithLayout.cpp #979660:979661
@@ -20,6 +20,7 @@
 
 #include "TokenWithLayout.h"
 
+#include "Debug.h"
 #include "TokenDropTarget.h"
 
 #include <KAction>
@@ -62,6 +63,7 @@
 
 void TokenWithLayout::fillMenu( QMenu * menu )
 {
+    DEBUG_BLOCK
     KAction *boldAction = new KAction( KIcon( "format-text-bold"), i18n( "Bold" ), \
menu );  boldAction->setObjectName( ActionBoldName );
     boldAction->setCheckable( true );
@@ -133,7 +135,14 @@
                         spareWidth -= twl->width() * 100.0;
                 }
             }
-            slider->setMaximum( qMax( spareWidth, 0.0 ) );
+
+            int max = qMax( spareWidth, 0.0 );
+            debug() << "slider max value: " << max;
+
+            if ( max >= m_width * 100.0 )
+                slider->setMaximum( qMax( spareWidth, 0.0 ) );
+            else
+                slider->setMaximum( m_width * 100.0 );
         }
     }
     slider->setValue( m_width * 100.0 );
@@ -146,7 +155,6 @@
 
     menu->setFixedHeight( orgHeight + slider->height() );
 
-    slider->setFixedWidth( menu->width() - 4 );
 }
 
 void TokenWithLayout::menuExecuted( const QAction* action )


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

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