[Marble-commits] KDE/kdeedu/marble/src/plugins/render/routing

Dennis Nienhüser earthwings at gentoo.org
Wed Nov 10 22:03:56 CET 2010


SVN commit 1195330 by nienhueser:

Center the float item in guidance mode on maemo, right alignment otherwise

 M  +9 -2      RoutingPlugin.cpp  


--- trunk/KDE/kdeedu/marble/src/plugins/render/routing/RoutingPlugin.cpp #1195329:1195330
@@ -142,10 +142,17 @@
     m_widgetItem->widget()->resize( size );
     m_widgetItem->setContentSize( size );
 
-    if ( m_marbleWidget ) {
-        m_marbleWidget->repaint();
+    bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
+    if ( smallScreen ) {
+        qreal const pluginWidth = size.width();
+        int x = -10;
+        if ( m_guidanceModeEnabled ) {
+            int const parentWidth = m_marbleWidget->width();
+            x = qRound( ( parentWidth - pluginWidth ) / 2.0 );
     }
+        m_parent->setPosition( QPointF( x, m_parent->position().y() ) );
 }
+}
 
 void RoutingPluginPrivate::updateZoomButtons()
 {


More information about the Marble-commits mailing list