[Marble-commits] KDE/kdeedu/marble/src

Bastian Holst bastianholst at gmx.de
Mon Mar 22 23:02:17 CET 2010


SVN commit 1106456 by bholst:

* Corrected size setting of Marble's WidgetGraphicsItem
* Added 2 basic profiles to MarbleGlobal


 M  +9 -0      lib/global.cpp  
 M  +8 -0      lib/global.h  
 M  +4 -0      lib/global_p.h  
 M  +4 -1      lib/graphicsview/WidgetGraphicsItem.cpp  
 M  +2 -4      plugins/render/navigation/NavigationFloatItem.cpp  
 M  +1 -6      plugins/render/navigation/NavigationFloatItem.h  


--- trunk/KDE/kdeedu/marble/src/lib/global.cpp #1106455:1106456
@@ -16,6 +16,7 @@
 {
 
 MarbleGlobalPrivate::MarbleGlobalPrivate()
+    : m_profile( MarbleGlobal::Default ) 
 {
 }
 
@@ -44,4 +45,12 @@
     return &d->m_locale; 
 }
 
+MarbleGlobal::Profile MarbleGlobal::profile() const {
+    return d->m_profile;
 }
+
+void MarbleGlobal::setProfile( MarbleGlobal::Profile profile ) {
+    d->m_profile = profile;
+}
+
+}
--- trunk/KDE/kdeedu/marble/src/lib/global.h #1106455:1106456
@@ -250,7 +250,15 @@
     ~MarbleGlobal();
 
     MarbleLocale * locale() const;
+    
+    enum Profile {
+        Default,
+        MobileInternetDevice
+    };
 
+    Profile profile() const;
+    void setProfile( Profile profile );
+    
  private:
     MarbleGlobal();
 
--- trunk/KDE/kdeedu/marble/src/lib/global_p.h #1106455:1106456
@@ -18,6 +18,7 @@
 
 #include "MarbleLocale.h"
 
+#include "global.h"
 
 namespace Marble
 {
@@ -27,9 +28,12 @@
 {
  public:
     MarbleGlobalPrivate();
+    
     virtual ~MarbleGlobalPrivate();
 
     MarbleLocale m_locale;
+    
+    MarbleGlobal::Profile m_profile;
 };
 
 }
--- trunk/KDE/kdeedu/marble/src/lib/graphicsview/WidgetGraphicsItem.cpp #1106455:1106456
@@ -37,8 +37,11 @@
 void WidgetGraphicsItem::setWidget( QWidget *widget ) {
     d->m_widget = widget;
     
-    QSize size = widget->size();
+    QSize size = widget->sizeHint().expandedTo( widget->size() );
+    size = size.expandedTo( widget->minimumSize() );
+    size = size.boundedTo( widget->maximumSize() );
     setSize( size );
+    widget->resize( size );
 }
 
 QWidget *WidgetGraphicsItem::widget() const {
--- trunk/KDE/kdeedu/marble/src/plugins/render/navigation/NavigationFloatItem.cpp #1106455:1106456
@@ -28,8 +28,8 @@
 const int defaultMinZoom = 900;
 const int defaultMaxZoom = 2400;
 
-NavigationFloatItem::NavigationFloatItem( const QPointF &point, const QSizeF &size )
-    : AbstractFloatItem( point, size ),
+NavigationFloatItem::NavigationFloatItem( const QPointF &point )
+    : AbstractFloatItem( point ),
       m_marbleWidget( 0 ),
       m_widgetItem( 0 ),
       m_oldViewportRadius( 0 )
@@ -86,8 +86,6 @@
 void NavigationFloatItem::initialize()
 {
     QWidget *navigationParent = new QWidget( 0 );
-    navigationParent->setFixedSize(size().toSize() - QSize(2 * padding(), 2
-            * padding()));
     m_navigationWidget.setupUi( navigationParent );
     
     m_widgetItem = new WidgetGraphicsItem( this );
--- trunk/KDE/kdeedu/marble/src/plugins/render/navigation/NavigationFloatItem.h #1106455:1106456
@@ -41,12 +41,7 @@
 //Q_INTERFACES( MarbleLayerInterface )
 MARBLE_PLUGIN( NavigationFloatItem )
  public:
-    explicit NavigationFloatItem( const QPointF &point = QPointF( -10, -10 ),
-#ifdef MARBLE_SMALL_SCREEN
-                                  const QSizeF &size = QSizeF( 88.0, 141.0 ) );
-#else 
-                                  const QSizeF &size = QSizeF( 104.0, 254.0 ) );
-#endif
+    explicit NavigationFloatItem( const QPointF &point = QPointF( -10, -10 ) );
     ~NavigationFloatItem();
 
     QStringList backendTypes() const;


More information about the Marble-commits mailing list