From 34bb96584f6f90ef56e307a8d8b8480b64c27894 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Wed, 18 Oct 2006 13:30:41 +0000 Subject: [PATCH] fixing #1856 --- .../products/gLiveSupport/src/NowPlaying.cxx | 36 +++++++++++-------- .../products/gLiveSupport/src/NowPlaying.h | 9 +++-- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx b/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx index d87034ff5..11435e47d 100644 --- a/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx +++ b/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx @@ -93,10 +93,15 @@ NowPlaying :: NowPlaying(Ptr::Ref gLiveSupport, isActive = false; isPaused = false; - label = Gtk::manage(new Gtk::Label); - label->set_use_markup(true); - label->set_ellipsize(Pango::ELLIPSIZE_END); - label->set_markup(""); + titleLabel = Gtk::manage(new Gtk::Label); + titleLabel->set_use_markup(true); + titleLabel->set_ellipsize(Pango::ELLIPSIZE_END); + titleLabel->set_markup(""); + + creatorLabel = Gtk::manage(new Gtk::Label); + creatorLabel->set_use_markup(true); + creatorLabel->set_ellipsize(Pango::ELLIPSIZE_END); + creatorLabel->set_markup(""); Gtk::Label * elapsedLabel = createFormattedLabel(8); Gtk::Label * remainsLabel = createFormattedLabel(8); @@ -134,8 +139,9 @@ NowPlaying :: NowPlaying(Ptr::Ref gLiveSupport, timeBox->pack_start(*remainsBox, Gtk::PACK_EXPAND_WIDGET, 2); Gtk::Box * textBox = Gtk::manage(new Gtk::VBox); - textBox->pack_start(*label, Gtk::PACK_EXPAND_PADDING, 2); - textBox->pack_start(*timeBox, Gtk::PACK_EXPAND_PADDING, 2); + textBox->pack_start(*titleLabel, Gtk::PACK_EXPAND_PADDING, 2); + textBox->pack_start(*creatorLabel, Gtk::PACK_EXPAND_PADDING, 2); + textBox->pack_start(*timeBox, Gtk::PACK_EXPAND_PADDING, 2); pack_end(*textBox, Gtk::PACK_EXPAND_WIDGET, 5); pack_end(*stopButton, Gtk::PACK_SHRINK, 0); @@ -160,22 +166,21 @@ NowPlaying :: setPlayable(Ptr::Ref playable) throw () Ptr::Ref infoString(new Glib::ustring); - infoString->append(""); + infoString->assign(""); infoString->append(Glib::Markup::escape_text(*playable->getTitle())); - infoString->append(" "); - - // TODO: rewrite this using the Core::Metadata class + infoString->append(""); + titleLabel->set_markup(*infoString); Ptr::Ref creator = playable->getMetadata("dc:creator"); if (creator) { - infoString->append(""); + infoString->assign(""); infoString->append(Glib::Markup::escape_text(*creator)); infoString->append(""); + creatorLabel->set_markup(*infoString); } - label->set_markup(*infoString); audioLength = playable->getPlaylength(); resetRemainsTimeState(); @@ -187,7 +192,8 @@ NowPlaying :: setPlayable(Ptr::Ref playable) throw () playButton->show(); isActive = false; } - label->set_markup(""); + titleLabel->set_markup(""); + creatorLabel->set_markup(""); elapsedTime->set_text(""); remainsTime->set_text(""); resetRemainsTimeState(); diff --git a/livesupport/src/products/gLiveSupport/src/NowPlaying.h b/livesupport/src/products/gLiveSupport/src/NowPlaying.h index cc4c0f865..7474d47af 100644 --- a/livesupport/src/products/gLiveSupport/src/NowPlaying.h +++ b/livesupport/src/products/gLiveSupport/src/NowPlaying.h @@ -89,9 +89,14 @@ class NowPlaying : public Gtk::HBox, Ptr::Ref audioLength; /** - * The label holding the title etc. of the now playing item. + * The label holding the title of the now playing item. */ - Gtk::Label * label; + Gtk::Label * titleLabel; + + /** + * The label holding the creator of the now playing item. + */ + Gtk::Label * creatorLabel; /** * The label holding the elapsed time.