summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjiban Bairagya <[email protected]>2015-04-28 23:05:53 +0530
committerSanjiban Bairagya <[email protected]>2015-04-28 23:05:53 +0530
commit27c659ff0575ceb3e86d9ecbd8c6ad21102e01de (patch)
tree9b96368c9ad69b048df09716f187cf340b984775
parent24004ab90437ffc5454d4b5a7ee9daf70646ac43 (diff)
Show correct icons for the respective items
in the TourWidget's playlist
-rw-r--r--src/lib/marble/RemoveItemEditWidget.cpp2
-rw-r--r--src/lib/marble/TourItemDelegate.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/marble/RemoveItemEditWidget.cpp b/src/lib/marble/RemoveItemEditWidget.cpp
index 9b6239a..3efebfc 100644
--- a/src/lib/marble/RemoveItemEditWidget.cpp
+++ b/src/lib/marble/RemoveItemEditWidget.cpp
@@ -33,7 +33,7 @@ RemoveItemEditWidget::RemoveItemEditWidget( const QModelIndex &index, QWidget *p
layout->setSpacing( 5 );
QLabel* iconLabel = new QLabel;
- iconLabel->setPixmap( QPixmap( ":/marble/player-time.png" ) );
+ iconLabel->setPixmap( QPixmap( ":/icons/remove.png" ) );
layout->addWidget( iconLabel );
QLabel* comboBoxLabel = new QLabel;
diff --git a/src/lib/marble/TourItemDelegate.cpp b/src/lib/marble/TourItemDelegate.cpp
index d21c141..ab9f3db 100644
--- a/src/lib/marble/TourItemDelegate.cpp
+++ b/src/lib/marble/TourItemDelegate.cpp
@@ -164,6 +164,7 @@ void TourItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opt
GeoDataUpdate *update = animUpdate->update();
QString text;
bool ok = false;
+ QString iconString;
if( update && update->create() && update->create()->size() != 0
&& ( update->create()->first().nodeType() == GeoDataTypes::GeoDataFolderType ||
update->create()->first().nodeType() == GeoDataTypes::GeoDataDocumentType ) ) {
@@ -171,13 +172,16 @@ void TourItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opt
if( container->size() > 0 ) {
label.setHtml( tr( "Create item %1" ).arg( container->first().id() ) );
ok = true;
+ iconString = "/icons/add-placemark.png";
}
} else if( update && update->getDelete() && update->getDelete()->size() != 0 ){
label.setHtml( tr( "Remove item %1" ).arg( update->getDelete()->first().targetId() ) );
ok = true;
+ iconString = ":/icons/remove.png";
} else if( update && update->change() && update->change()->size() != 0 ){
label.setHtml( tr( "Change item %1" ).arg( update->change()->first().targetId() ) );
ok = true;
+ iconString = ":/marble/document-edit.png";
}
if( update && !ok ) {
label.setHtml( tr( "Update items" ) );
@@ -194,7 +198,7 @@ void TourItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opt
QRect const buttonRect = position( EditButton, option );
button.rect = buttonRect;
- QIcon const icon = QIcon( ":/marble/player-time.png" );
+ QIcon const icon = QIcon( iconString );
painter->drawPixmap( iconRect, icon.pixmap( iconRect.size() ) );
}
QApplication::style()->drawControl( QStyle::CE_PushButton, &button, painter );