[Marble-commits] KDE/kdeedu/marble/src
Dennis Nienhüser
earthwings at gentoo.org
Mon Nov 29 23:32:02 CET 2010
SVN commit 1202170 by nienhueser:
Use a scroll area to achieve vertical scrolling when the content gets too large (many via points, several search results). Fixes squeezed dialog look on Maemo.
M +6 -2 QtMainWindow.cpp
M +0 -9 lib/routing/RoutingWidget.cpp
M +9 -0 lib/routing/RoutingWidget.ui
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1202169:1202170
@@ -35,7 +35,7 @@
#include <QtGui/QPrinter>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QHBoxLayout>
-
+#include <QtGui/QScrollArea>
#include <QtGui/QClipboard>
#include <QtNetwork/QNetworkProxy>
@@ -1245,8 +1245,12 @@
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok, Qt::Vertical, m_routingDialog );
connect(buttonBox, SIGNAL( accepted() ), m_routingDialog, SLOT( accept() ) );
+ QScrollArea* scrollArea = new QScrollArea;
+ m_routingWidget->setMinimumWidth( 560 );
+ scrollArea->setWidget( m_routingWidget );
+
QHBoxLayout* layout = new QHBoxLayout;
- layout->addWidget( m_routingWidget );
+ layout->addWidget( scrollArea );
layout->addWidget( buttonBox );
m_routingDialog->setLayout( layout );
m_routingDialog->resize( 640, 420 );
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.cpp #1202169:1202170
@@ -192,10 +192,6 @@
d->m_ui.routingProfileComboBox->setModel( d->m_routingManager->profilesModel() );
- if ( MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ) {
- d->m_ui.directionsListView->setVisible( false );
- }
-
connect( d->m_routingManager->profilesModel(), SIGNAL( rowsInserted( QModelIndex, int, int ) ),
this, SLOT( selectFirstProfile() ) );
connect( d->m_routingManager->profilesModel(), SIGNAL( modelReset() ),
@@ -336,12 +332,7 @@
d->m_widget->centerOn( GeoDataLatLonBox::fromLineString( placemarks ) );
//d->m_ui.descriptionLabel->setVisible( false );
}
-
- if ( MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ) {
- d->m_ui.directionsListView->setVisible( placemarks.size() > 1 );
- d->m_ui.directionsListView->setMinimumHeight( 200 );
}
-}
void RoutingWidget::centerOnInputWidget( RoutingInputWidget *widget )
{
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.ui #1202169:1202170
@@ -11,6 +11,9 @@
</rect>
</property>
<layout class="QVBoxLayout" name="routingLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinAndMaxSize</enum>
+ </property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@@ -108,6 +111,12 @@
</item>
<item>
<widget class="QListView" name="directionsListView">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>200</height>
+ </size>
+ </property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
More information about the Marble-commits
mailing list