fixing #1856
This commit is contained in:
parent
49f7fb7b9f
commit
34bb96584f
2 changed files with 28 additions and 17 deletions
|
@ -93,10 +93,15 @@ NowPlaying :: NowPlaying(Ptr<GLiveSupport>::Ref gLiveSupport,
|
||||||
isActive = false;
|
isActive = false;
|
||||||
isPaused = false;
|
isPaused = false;
|
||||||
|
|
||||||
label = Gtk::manage(new Gtk::Label);
|
titleLabel = Gtk::manage(new Gtk::Label);
|
||||||
label->set_use_markup(true);
|
titleLabel->set_use_markup(true);
|
||||||
label->set_ellipsize(Pango::ELLIPSIZE_END);
|
titleLabel->set_ellipsize(Pango::ELLIPSIZE_END);
|
||||||
label->set_markup("");
|
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 * elapsedLabel = createFormattedLabel(8);
|
||||||
Gtk::Label * remainsLabel = createFormattedLabel(8);
|
Gtk::Label * remainsLabel = createFormattedLabel(8);
|
||||||
|
@ -134,8 +139,9 @@ NowPlaying :: NowPlaying(Ptr<GLiveSupport>::Ref gLiveSupport,
|
||||||
timeBox->pack_start(*remainsBox, Gtk::PACK_EXPAND_WIDGET, 2);
|
timeBox->pack_start(*remainsBox, Gtk::PACK_EXPAND_WIDGET, 2);
|
||||||
|
|
||||||
Gtk::Box * textBox = Gtk::manage(new Gtk::VBox);
|
Gtk::Box * textBox = Gtk::manage(new Gtk::VBox);
|
||||||
textBox->pack_start(*label, Gtk::PACK_EXPAND_PADDING, 2);
|
textBox->pack_start(*titleLabel, Gtk::PACK_EXPAND_PADDING, 2);
|
||||||
textBox->pack_start(*timeBox, 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(*textBox, Gtk::PACK_EXPAND_WIDGET, 5);
|
||||||
pack_end(*stopButton, Gtk::PACK_SHRINK, 0);
|
pack_end(*stopButton, Gtk::PACK_SHRINK, 0);
|
||||||
|
@ -160,22 +166,21 @@ NowPlaying :: setPlayable(Ptr<Playable>::Ref playable) throw ()
|
||||||
|
|
||||||
Ptr<Glib::ustring>::Ref infoString(new Glib::ustring);
|
Ptr<Glib::ustring>::Ref infoString(new Glib::ustring);
|
||||||
|
|
||||||
infoString->append("<span font_desc='Bitstream Vera Sans"
|
infoString->assign("<span font_desc='Bitstream Vera Sans"
|
||||||
" Bold 16'>");
|
" Bold 14'>");
|
||||||
infoString->append(Glib::Markup::escape_text(*playable->getTitle()));
|
infoString->append(Glib::Markup::escape_text(*playable->getTitle()));
|
||||||
infoString->append("</span> ");
|
infoString->append("</span>");
|
||||||
|
titleLabel->set_markup(*infoString);
|
||||||
// TODO: rewrite this using the Core::Metadata class
|
|
||||||
|
|
||||||
Ptr<Glib::ustring>::Ref
|
Ptr<Glib::ustring>::Ref
|
||||||
creator = playable->getMetadata("dc:creator");
|
creator = playable->getMetadata("dc:creator");
|
||||||
if (creator) {
|
if (creator) {
|
||||||
infoString->append("<span font_desc='Bitstream Vera Sans"
|
infoString->assign("<span font_desc='Bitstream Vera Sans"
|
||||||
" Bold 16'>");
|
" Bold 12'>");
|
||||||
infoString->append(Glib::Markup::escape_text(*creator));
|
infoString->append(Glib::Markup::escape_text(*creator));
|
||||||
infoString->append("</span>");
|
infoString->append("</span>");
|
||||||
|
creatorLabel->set_markup(*infoString);
|
||||||
}
|
}
|
||||||
label->set_markup(*infoString);
|
|
||||||
|
|
||||||
audioLength = playable->getPlaylength();
|
audioLength = playable->getPlaylength();
|
||||||
resetRemainsTimeState();
|
resetRemainsTimeState();
|
||||||
|
@ -187,7 +192,8 @@ NowPlaying :: setPlayable(Ptr<Playable>::Ref playable) throw ()
|
||||||
playButton->show();
|
playButton->show();
|
||||||
isActive = false;
|
isActive = false;
|
||||||
}
|
}
|
||||||
label->set_markup("");
|
titleLabel->set_markup("");
|
||||||
|
creatorLabel->set_markup("");
|
||||||
elapsedTime->set_text("");
|
elapsedTime->set_text("");
|
||||||
remainsTime->set_text("");
|
remainsTime->set_text("");
|
||||||
resetRemainsTimeState();
|
resetRemainsTimeState();
|
||||||
|
|
|
@ -89,9 +89,14 @@ class NowPlaying : public Gtk::HBox,
|
||||||
Ptr<time_duration>::Ref audioLength;
|
Ptr<time_duration>::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.
|
* The label holding the elapsed time.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue