Add ability to show full playlist name in PlaylistTab.
This commit is contained in:
parent
d96a04431a
commit
43c2c636d2
|
@ -57,6 +57,16 @@ PlaylistTabBar::PlaylistTabBar(QWidget* parent)
|
|||
tr("Rename playlist..."), this, SLOT(Rename()));
|
||||
save_ = menu_->addAction(IconLoader::Load("document-save", IconLoader::Base),
|
||||
tr("Save playlist..."), this, SLOT(Save()));
|
||||
|
||||
menu_->addSeparator();
|
||||
|
||||
expand_ = menu_->addAction(IconLoader::Load("zoom-in", IconLoader::Base),
|
||||
tr("Show full playlists names"), this, SLOT(ExpandNames()));
|
||||
elide_ = menu_->addAction(IconLoader::Load("zoom-in", IconLoader::Base),
|
||||
tr("Hide full playlists names"), this, SLOT(ExpandNames()));
|
||||
|
||||
elide_->setVisible(false);
|
||||
|
||||
menu_->addSeparator();
|
||||
|
||||
rename_editor_->setVisible(false);
|
||||
|
@ -408,3 +418,25 @@ void PlaylistTabBar::PlaylistFavoritedSlot(int id, bool favorite) {
|
|||
favorite_widget->SetFavorite(favorite);
|
||||
}
|
||||
}
|
||||
|
||||
void PlaylistTabBar::ExpandNames()
|
||||
{
|
||||
switch(elideMode()) {
|
||||
case Qt::ElideNone: {
|
||||
setElideMode(Qt::ElideRight);
|
||||
elide_->setVisible(false);
|
||||
expand_->setVisible(true);
|
||||
break;
|
||||
}
|
||||
|
||||
case Qt::ElideRight: {
|
||||
setElideMode(Qt::ElideNone);
|
||||
elide_->setVisible(true);
|
||||
expand_->setVisible(false);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ signals:
|
|||
void PlaylistManagerInitialized();
|
||||
void TabMoved();
|
||||
void Save();
|
||||
void ExpandNames();
|
||||
|
||||
private:
|
||||
PlaylistManager* manager_;
|
||||
|
@ -96,6 +97,8 @@ signals:
|
|||
QAction* rename_;
|
||||
QAction* close_;
|
||||
QAction* save_;
|
||||
QAction* expand_;
|
||||
QAction* elide_;
|
||||
|
||||
QBasicTimer drag_hover_timer_;
|
||||
int drag_hover_tab_;
|
||||
|
|
Loading…
Reference in New Issue