[Marble-commits] KDE/kdeedu/marble/src
Dennis Nienhüser
earthwings at gentoo.org
Mon Oct 4 20:22:12 CEST 2010
SVN commit 1182490 by nienhueser:
Fix some visual glitches.
M +5 -0 lib/routing/RoutingModel.cpp
M +12 -37 plugins/render/routing/RoutingInformationWidgetSmall.ui
M +9 -2 plugins/render/routing/RoutingPlugin.cpp
M +2 -0 plugins/render/routing/RoutingPlugin.h
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingModel.cpp #1182489:1182490
@@ -231,8 +231,13 @@
break;
case Qt::DecorationRole:
if ( element.type == Instruction ) {
+ bool smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
+ if ( smallScreen ) {
return d->m_turnTypePixmaps[element.turnType];
+ } else {
+ return d->m_turnTypePixmaps[element.turnType].scaled( 32, 32 );
}
+ }
return QVariant();
break;
--- trunk/KDE/kdeedu/marble/src/plugins/render/routing/RoutingInformationWidgetSmall.ui #1182489:1182490
@@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>458</width>
+ <width>455</width>
<height>78</height>
</rect>
</property>
@@ -20,9 +20,6 @@
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
<property name="margin">
<number>0</number>
</property>
@@ -77,8 +74,6 @@
</widget>
</item>
<item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
<widget class="QLabel" name="followingInstructionIconLabel">
<property name="enabled">
<bool>false</bool>
@@ -101,36 +96,6 @@
</widget>
</item>
<item>
- <widget class="QLabel" name="followingInstructionDistanceLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="cursor">
- <cursorShape>ArrowCursor</cursorShape>
- </property>
- <property name="toolTip">
- <string>total time remaining</string>
- </property>
- <property name="text">
- <string><font size="-1" color="black">Next</font></string>
- </property>
- <property name="textFormat">
- <enum>Qt::AutoText</enum>
- </property>
- <property name="alignment">
- <set>Qt::AlignBottom|Qt::AlignHCenter</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="timeLabel">
@@ -168,6 +133,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
@@ -175,7 +146,11 @@
<string>total time remaining</string>
</property>
<property name="text">
- <string><font size="-1" color="black">0 m</font></string>
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:small; color:#000000;">0 m</span></p></body></html></string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
--- trunk/KDE/kdeedu/marble/src/plugins/render/routing/RoutingPlugin.cpp #1182489:1182490
@@ -237,6 +237,11 @@
zoomOutButton->setEnabled( true );
}
+ updateWidget();
+}
+
+void RoutingPlugin::updateWidget()
+{
if ( m_marbleWidget )
{
// Trigger a repaint of the float item. Otherwise button state updates
@@ -295,6 +300,7 @@
}
m_marbleWidget->model()->routingManager()->setGuidanceModeEnabled( show );
+ updateWidget();
}
void RoutingPlugin::setDestinationInformation( qint32 remainingTime, qreal remainingDistance )
@@ -340,7 +346,7 @@
m_routingInformationWidgetSmall->destinationDistanceLabel->setText( tr( "<font size=\"-1\" color=\"black\">%n min</font>", "", remainingTimeMinutes ) );
}
else {
- m_routingInformationWidgetSmall->destinationDistanceLabel->setText( "<font size=\"-1\" color=\"black\">Very soon.</font>" );
+ m_routingInformationWidgetSmall->destinationDistanceLabel->setText( "<font size=\"-1\" color=\"black\">Soon</font>" );
}
// if( remainingTimeMinutes < thresholdTime ) {
@@ -421,7 +427,7 @@
}
}
else {
- nextInstructionDistanceLabel->setText( "Arrived at Destination" );
+ nextInstructionDistanceLabel->setText( "<font size=\"-1\" color=\"black\">Arrived at Destination</font>" );
}
}
}
@@ -429,6 +435,7 @@
void RoutingPlugin::updateButtonStates( PositionProviderPlugin *activePlugin )
{
m_routingWidgetSmall->gpsButton->setChecked( activePlugin != 0 );
+ updateWidget();
}
void RoutingPlugin::togglePositionTracking( bool enabled )
--- trunk/KDE/kdeedu/marble/src/plugins/render/routing/RoutingPlugin.h #1182489:1182490
@@ -125,6 +125,8 @@
*/
void updateInstructionLabel( QLabel *label );
+ void updateWidget();
+
MarbleWidget *m_marbleWidget;
WidgetGraphicsItem *m_widgetItem;
WidgetGraphicsItem *m_widgetItemRouting;
More information about the Marble-commits
mailing list