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

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/context
From:       William Viana Soares <vianasw () gmail ! com>
Date:       2008-06-27 1:04:58
Message-ID: 1214528698.841156.26681.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 824977 by wviana:

Added missing containment setup when it's created. Also a hack in ColumnContainment \
so the first applet added has a sane geometry.



 M  +3 -3      ContextView.cpp  
 M  +12 -5     containments/ColumnContainment.cpp  


--- trunk/extragear/multimedia/amarok/src/context/ContextView.cpp #824976:824977
@@ -359,9 +359,9 @@
     if (corona)
     {
         int size = contextScene()->containments().size();
-        Plasma::Containment *c = corona->addContainment( "context" );        
-        //FIXME: find a better way to resize the containment to a proper size based \
                on the
-        //the CV current area size
+        Plasma::Containment *c = corona->addContainment( "context" );
+        c->setScreen( 0 );
+        c->setFormFactor( Plasma::Planar );
         
         int x = ( rect().width() + 20 ) * ( size % 2 );
         int y = rect().height() * ( size / 2 );
--- trunk/extragear/multimedia/amarok/src/context/containments/ColumnContainment.cpp \
#824976:824977 @@ -58,7 +58,7 @@
 ColumnContainment::ColumnContainment( QObject *parent, const QVariantList &args )
     : Context::Containment( parent, args )
     , m_actions( 0 )    
-    , m_minColumnWidth( 400 )
+    , m_minColumnWidth( 300 )
     , m_maxColumnWidth( 500 )
     , m_defaultRowHeight( 150 )
 {
@@ -146,7 +146,7 @@
         if( plugin != QString() )
             Plasma::Containment::addApplet( plugin );
     }
-    recalculate();
+//     recalculate();
 }
 
 QSizeF ColumnContainment::sizeHint( Qt::SizeHint which, const QSizeF &constraint ) \
const @@ -172,7 +172,6 @@
     
     m_grid->setGeometry( rect );
     setGeometry( rect );
-    flushPendingConstraintsEvents();
     m_currentRows = rect.height() / m_defaultRowHeight;
     m_currentColumns = qMax( (int)(rect.width() / m_minColumnWidth), 1 );
     
@@ -274,14 +273,22 @@
         m_appletsPositions[applet] = pos;
         m_appletsIndexes[applet] = m_grid->count();
         m_grid->setColumnMaximumWidth( col, m_maxColumnWidth );
-//         m_grid->setColumnMinimumWidth( col, m_minColumnWidth );
+        m_grid->setColumnMinimumWidth( col, m_minColumnWidth );
+        // HACK: the first applet added isn't created with a appropriate geometry
+        // but after that it is behaving ok 
+        if( m_grid->count() == 0 )
+        {
+           QRect newgeom( 0, 0, m_maxColumnWidth, height );
+           applet->setGeometry( newgeom );
+        }
+        
         for( int i = 0; i < rowSpan; i++ )
         {
             m_gridFreePositions[row + i][col] = false;
             m_grid->setRowMaximumHeight( row + i, m_defaultRowHeight );
             m_grid->setRowPreferredHeight( row + i, height );
         }
-
+        
         m_grid->addItem( applet, row, col, rowSpan, colSpan );
         updateConstraints( Plasma::SizeConstraint );
     }


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

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