[Marble-commits] KDE/kdeedu/marble/src/plugins/render/routing
Dennis Nienhüser
earthwings at gentoo.org
Mon Oct 4 00:02:21 CEST 2010
SVN commit 1182231 by nienhueser:
Vertical mode, less visual glitches.
M +80 -44 RoutingInformationWidgetSmall.ui
M +23 -22 RoutingPlugin.cpp
M +3 -3 RoutingWidgetSmall.ui
--- trunk/KDE/kdeedu/marble/src/plugins/render/routing/RoutingInformationWidgetSmall.ui #1182230:1182231
@@ -2,16 +2,19 @@
<ui version="4.0">
<class>RoutingInformationWidgetSmall</class>
<widget class="QWidget" name="RoutingInformationWidgetSmall">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>318</width>
- <height>59</height>
+ <width>458</width>
+ <height>78</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -19,46 +22,72 @@
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetFixedSize</enum>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
<widget class="QLabel" name="instructionIconLabel">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>64</width>
+ <height>64</height>
+ </size>
+ </property>
<property name="text">
<string/>
</property>
<property name="pixmap">
- <pixmap resource="../../../marble.qrc">:/icons/instruction-next.png</pixmap>
+ <pixmap resource="../../../lib/libmarble.qrc">:/data/bitmaps/turn-right.png</pixmap>
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item>
<widget class="QLabel" name="distanceAndInstructionLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>280</width>
+ <height>78</height>
+ </size>
+ </property>
<property name="text">
- <string>Next Instruction On The Route</string>
+ <string><font size="-1" color="black">Next Instruction On The Route</font></string>
</property>
<property name="alignment">
- <set>Qt::AlignCenter</set>
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="instructionDistanceLabel">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="followingInstructionIconLabel">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -67,42 +96,46 @@
<string/>
</property>
<property name="pixmap">
- <pixmap resource="../../../marble.qrc">:/icons/flag.png</pixmap>
+ <pixmap resource="../../../lib/libmarble.qrc">:/data/bitmaps/turn-right.png</pixmap>
</property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
</widget>
</item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QProgressBar" name="distanceCoveredProgressBar">
+ <widget class="QLabel" name="followingInstructionDistanceLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="font">
- <font>
- <pointsize>11</pointsize>
- <weight>75</weight>
- <bold>true</bold>
- </font>
+ <property name="cursor">
+ <cursorShape>ArrowCursor</cursorShape>
</property>
<property name="toolTip">
- <string>distance covered on the current instruction</string>
+ <string>total time remaining</string>
</property>
- <property name="value">
- <number>0</number>
+ <property name="text">
+ <string><font size="-1" color="black">Next</font></string>
</property>
- <property name="textVisible">
+ <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>
- <property name="textDirection">
- <enum>QProgressBar::TopToBottom</enum>
- </property>
</widget>
</item>
+ </layout>
+ </item>
<item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
<widget class="QLabel" name="timeLabel">
<property name="enabled">
<bool>true</bool>
@@ -113,11 +146,17 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
<property name="text">
<string/>
</property>
<property name="pixmap">
- <pixmap resource="../../../marble.qrc">:/icons/clock-large.png</pixmap>
+ <pixmap resource="../../../marble.qrc">:/icons/flag.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -125,9 +164,9 @@
</widget>
</item>
<item>
- <widget class="QLabel" name="remainingTimeLabel">
+ <widget class="QLabel" name="destinationDistanceLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -139,20 +178,16 @@
<string>total time remaining</string>
</property>
<property name="text">
- <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;">
-<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
-<tr>
-<td style="border: none;">
-<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">00:00</span></p></td></tr></table></body></html></string>
+ <string><font size="-1" color="black">0 m</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>false</bool>
+ <bool>true</bool>
</property>
</widget>
</item>
@@ -162,6 +197,7 @@
</widget>
<resources>
<include location="../../../marble.qrc"/>
+ <include location="../../../lib/libmarble.qrc"/>
</resources>
<connections/>
</ui>
--- trunk/KDE/kdeedu/marble/src/plugins/render/routing/RoutingPlugin.cpp #1182230:1182231
@@ -271,9 +271,9 @@
PositionTracking *tracking = m_marbleWidget->model()->positionTracking();
if( show ) {
- MarbleGraphicsGridLayout *gridLayout = new MarbleGraphicsGridLayout( 2, 1 );
+ MarbleGraphicsGridLayout *gridLayout = new MarbleGraphicsGridLayout( 1, 2 );
gridLayout->addItem( m_widgetItemRouting, 0, 0 );
- gridLayout->addItem( m_widgetItem, 1, 0 );
+ gridLayout->addItem( m_widgetItem, 0, 1 );
setLayout( gridLayout );
m_widgetItemRouting->setVisible( show );
m_marbleWidget->repaint();
@@ -331,35 +331,36 @@
}
if( m_profiles & MarbleGlobal::SmallScreen ) {
- m_routingInformationWidgetSmall->remainingTimeLabel->setAlignment( Qt::AlignCenter );
+ m_routingInformationWidgetSmall->destinationDistanceLabel->setAlignment( Qt::AlignCenter );
if( remainingTimeHours ) {
- m_routingInformationWidgetSmall->remainingTimeLabel->setText( QString::number( remainingTimeHours ) % " hr " %
- QString::number( remainingTimeMinutes ) % " min " );
+ m_routingInformationWidgetSmall->destinationDistanceLabel->setText( QString( "<font size=\"-1\" color=\"black\">%1:%2</font>" ).arg( remainingTimeHours ).arg( remainingTimeMinutes ) );
}
else if( remainingTimeMinutes ) {
- m_routingInformationWidgetSmall->remainingTimeLabel->setText( tr( "%n minutes", "", remainingTimeMinutes ) );
+ m_routingInformationWidgetSmall->destinationDistanceLabel->setText( tr( "<font size=\"-1\" color=\"black\">%n min</font>", "", remainingTimeMinutes ) );
}
else {
- m_routingInformationWidgetSmall->remainingTimeLabel->setText( "Less than a minute." );
+ m_routingInformationWidgetSmall->destinationDistanceLabel->setText( "<font size=\"-1\" color=\"black\">Very soon.</font>" );
}
- if( remainingTimeMinutes < thresholdTime ) {
- m_routingInformationWidgetSmall->instructionIconLabel->setPixmap( instructionIconNear );
- }
- else {
- m_routingInformationWidgetSmall->instructionIconLabel->setPixmap( instructionIconNext );
- }
+// if( remainingTimeMinutes < thresholdTime ) {
+// m_routingInformationWidgetSmall->instructionIconLabel->setPixmap( instructionIconNear );
+// }
+// else {
+// m_routingInformationWidgetSmall->instructionIconLabel->setPixmap( instructionIconNext );
+// }
+ m_routingInformationWidgetSmall->instructionIconLabel->setPixmap( m_routingModel->nextInstructionPixmap().scaled( 64, 64, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
+ m_routingInformationWidgetSmall->followingInstructionIconLabel->setPixmap( m_routingModel->followingInstructionPixmap() );
updateInstructionLabel( m_routingInformationWidgetSmall->distanceAndInstructionLabel );
if( !m_routingModel->deviatedFromRoute() && remainingInstructionDistance != 0 ) {
- m_routingInformationWidgetSmall->distanceCoveredProgressBar->setRange( 0, qRound( instructionLength ) );
- m_routingInformationWidgetSmall->distanceCoveredProgressBar->setValue( qRound ( instructionLength - remainingInstructionDistance ) );
+ //m_routingInformationWidgetSmall->distanceCoveredProgressBar->setRange( 0, qRound( instructionLength ) );
+ //m_routingInformationWidgetSmall->distanceCoveredProgressBar->setValue( qRound ( instructionLength - remainingInstructionDistance ) );
}
if ( remainingInstructionDistance == 0 && remainingInstructionTime == 0 ) {
- m_routingInformationWidgetSmall->distanceCoveredProgressBar->setValue( qRound( instructionLength ) );
+ //m_routingInformationWidgetSmall->distanceCoveredProgressBar->setValue( qRound( instructionLength ) );
}
}
@@ -367,10 +368,10 @@
m_routingInformationWidget->remainingTimeLabel->setAlignment( Qt::AlignCenter );
if( remainingTimeHours ) {
- m_routingInformationWidget->remainingTimeLabel->setText( tr( "%n hours", "", remainingTimeHours) % tr( " %n minutes", "", remainingTimeMinutes ) );
+ m_routingInformationWidget->remainingTimeLabel->setText( tr( "%n hours", "", remainingTimeHours) % tr( " %n min", "", remainingTimeMinutes ) );
}
else if ( remainingTimeMinutes ) {
- m_routingInformationWidget->remainingTimeLabel->setText( tr( "%n minutes", "", remainingTimeMinutes ) );
+ m_routingInformationWidget->remainingTimeLabel->setText( tr( "%n min", "", remainingTimeMinutes ) );
}
else {
m_routingInformationWidget->remainingTimeLabel->setText( "Less than a minute." );
@@ -401,7 +402,7 @@
if( m_routingModel->remainingTime() < thresholdTime && !m_routingModel->instructionText().isEmpty() ) {
QLabel *instructionLabel = label;
instructionLabel->setAlignment( Qt::AlignCenter );
- instructionLabel->setText( m_routingModel->instructionText() );
+ instructionLabel->setText( QString( "<font size=\"-1\" color=\"black\">%1</font>" ).arg( m_routingModel->instructionText() ) );
}
else {
QLabel *nextInstructionDistanceLabel = label;
@@ -409,14 +410,14 @@
qreal instructionDistance = m_routingModel->nextInstructionDistance();
- QString indicatorText = m_routingModel->instructionText().isEmpty() ? "<b>Destination: </b>" : "<b>Next Turn at: </b>";
+ QString indicatorText = m_routingModel->instructionText().isEmpty() ? "<font size=\"-1\" color=\"black\">Destination reached in %1 %2</font>" : "<font size=\"-1\" color=\"black\">Next turn in %1 %2</font>";
if( m_remainingDistance ) {
if( instructionDistance < 1000 ) {
- nextInstructionDistanceLabel->setText( indicatorText % QString::number( int( instructionDistance ) ) % " Meters " );
+ nextInstructionDistanceLabel->setText( indicatorText.arg( int( instructionDistance ) ).arg( "meters") );
}
else {
- nextInstructionDistanceLabel->setText( indicatorText % QString::number( instructionDistance * METER2KM , 'f', 1 ) % " KM " );
+ nextInstructionDistanceLabel->setText( indicatorText.arg( instructionDistance * METER2KM, 0, 'f', 1 ).arg( " km " ) );
}
}
else {
--- trunk/KDE/kdeedu/marble/src/plugins/render/routing/RoutingWidgetSmall.ui #1182230:1182231
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>318</width>
- <height>77</height>
+ <height>78</height>
</rect>
</property>
<property name="sizePolicy">
@@ -22,7 +22,7 @@
<widget class="QToolButton" name="routingButton">
<property name="geometry">
<rect>
- <x>80</x>
+ <x>0</x>
<y>0</y>
<width>78</width>
<height>78</height>
@@ -133,7 +133,7 @@
<widget class="QToolButton" name="gpsButton">
<property name="geometry">
<rect>
- <x>0</x>
+ <x>80</x>
<y>0</y>
<width>78</width>
<height>78</height>
More information about the Marble-commits
mailing list