Merge dc2ad805c4
into 5968648aa1
This commit is contained in:
commit
f99cfb1030
|
@ -58,6 +58,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);
|
||||
|
@ -409,3 +419,24 @@ 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 @@ class PlaylistTabBar : public QTabBar {
|
|||
void PlaylistManagerInitialized();
|
||||
void TabMoved();
|
||||
void Save();
|
||||
void ExpandNames();
|
||||
|
||||
private:
|
||||
PlaylistManager* manager_;
|
||||
|
@ -96,6 +97,8 @@ class PlaylistTabBar : public QTabBar {
|
|||
QAction* rename_;
|
||||
QAction* close_;
|
||||
QAction* save_;
|
||||
QAction* expand_;
|
||||
QAction* elide_;
|
||||
|
||||
QBasicTimer drag_hover_timer_;
|
||||
int drag_hover_tab_;
|
||||
|
|
Loading…
Reference in New Issue