diff --git a/src/translations/ar.po b/src/translations/ar.po index b5e43973d..f28c20b62 100644 --- a/src/translations/ar.po +++ b/src/translations/ar.po @@ -803,6 +803,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "" diff --git a/src/translations/cs.po b/src/translations/cs.po index b34717379..c42404407 100644 --- a/src/translations/cs.po +++ b/src/translations/cs.po @@ -805,6 +805,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disk %1" diff --git a/src/translations/da.po b/src/translations/da.po index ef9d19af4..36f8dc179 100644 --- a/src/translations/da.po +++ b/src/translations/da.po @@ -808,6 +808,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disk %1" diff --git a/src/translations/de.po b/src/translations/de.po index 55224f986..570a6b524 100644 --- a/src/translations/de.po +++ b/src/translations/de.po @@ -807,6 +807,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "CD %1" diff --git a/src/translations/el.po b/src/translations/el.po index 64c18355d..8ce141dd6 100644 --- a/src/translations/el.po +++ b/src/translations/el.po @@ -810,6 +810,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "δίσκος %1" diff --git a/src/translations/en_CA.po b/src/translations/en_CA.po index d02456a99..2116d3eab 100644 --- a/src/translations/en_CA.po +++ b/src/translations/en_CA.po @@ -807,6 +807,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disc %1" diff --git a/src/translations/en_GB.po b/src/translations/en_GB.po index 2bc95ad2f..98b869927 100644 --- a/src/translations/en_GB.po +++ b/src/translations/en_GB.po @@ -804,6 +804,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disc %1" diff --git a/src/translations/es.po b/src/translations/es.po index 699db8492..37bba0bbb 100644 --- a/src/translations/es.po +++ b/src/translations/es.po @@ -810,6 +810,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "Disco %1" diff --git a/src/translations/fi.po b/src/translations/fi.po index 26fb76a2e..71bc93585 100644 --- a/src/translations/fi.po +++ b/src/translations/fi.po @@ -803,6 +803,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "" diff --git a/src/translations/fr.po b/src/translations/fr.po index 3b949524b..27f1b9662 100644 --- a/src/translations/fr.po +++ b/src/translations/fr.po @@ -807,6 +807,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "CD %1" diff --git a/src/translations/gl.po b/src/translations/gl.po index e2b02c746..3b8ea05d8 100644 --- a/src/translations/gl.po +++ b/src/translations/gl.po @@ -805,6 +805,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disco %1" diff --git a/src/translations/it.po b/src/translations/it.po index a212b2a65..d71902b31 100644 --- a/src/translations/it.po +++ b/src/translations/it.po @@ -810,6 +810,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disco %1" diff --git a/src/translations/kk.po b/src/translations/kk.po index 48ed83d5a..c144248ab 100644 --- a/src/translations/kk.po +++ b/src/translations/kk.po @@ -805,6 +805,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "" diff --git a/src/translations/nb.po b/src/translations/nb.po index 559e65eda..5efbdc8ed 100644 --- a/src/translations/nb.po +++ b/src/translations/nb.po @@ -805,6 +805,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disk %1" diff --git a/src/translations/oc.po b/src/translations/oc.po index 650bdf041..3110e8965 100644 --- a/src/translations/oc.po +++ b/src/translations/oc.po @@ -803,6 +803,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "CD %1" diff --git a/src/translations/pl.po b/src/translations/pl.po index 929428198..16963f7f9 100644 --- a/src/translations/pl.po +++ b/src/translations/pl.po @@ -805,6 +805,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "dysk %1" diff --git a/src/translations/pt.po b/src/translations/pt.po index 4d7798e2e..0adc7f951 100644 --- a/src/translations/pt.po +++ b/src/translations/pt.po @@ -808,6 +808,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disco %1" diff --git a/src/translations/pt_BR.po b/src/translations/pt_BR.po index 35343b27c..6045e9d32 100644 --- a/src/translations/pt_BR.po +++ b/src/translations/pt_BR.po @@ -810,6 +810,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disco %1" diff --git a/src/translations/ro.po b/src/translations/ro.po index 996583ace..d0bf208b7 100644 --- a/src/translations/ro.po +++ b/src/translations/ro.po @@ -804,6 +804,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disc %1" diff --git a/src/translations/ru.po b/src/translations/ru.po index c027c2b4d..0b442c927 100644 --- a/src/translations/ru.po +++ b/src/translations/ru.po @@ -808,6 +808,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "диск %1" diff --git a/src/translations/sk.po b/src/translations/sk.po index fc0fc8799..03520a8a3 100644 --- a/src/translations/sk.po +++ b/src/translations/sk.po @@ -808,6 +808,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "disk %1" diff --git a/src/translations/sv.po b/src/translations/sv.po index 9856424e0..1ff446421 100644 --- a/src/translations/sv.po +++ b/src/translations/sv.po @@ -806,6 +806,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "skiva %1" diff --git a/src/translations/tr.po b/src/translations/tr.po index da2236dce..8585e8c23 100644 --- a/src/translations/tr.po +++ b/src/translations/tr.po @@ -803,6 +803,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "" diff --git a/src/translations/zh_CN.po b/src/translations/zh_CN.po index 7393c3d68..f70296843 100644 --- a/src/translations/zh_CN.po +++ b/src/translations/zh_CN.po @@ -803,6 +803,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "" diff --git a/src/translations/zh_TW.po b/src/translations/zh_TW.po index a977bdd08..7617d7e3e 100644 --- a/src/translations/zh_TW.po +++ b/src/translations/zh_TW.po @@ -803,6 +803,9 @@ msgstr "" msgid "Large album cover" msgstr "" +msgid "Show above status bar" +msgstr "" + #, qt-format msgid "disc %1" msgstr "" diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index c171251f9..fc254f063 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -468,6 +468,9 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg 1); // Don't question the 1 connect(playlists_, SIGNAL(CurrentSongChanged(Song)), ui_->now_playing, SLOT(NowPlaying(Song))); connect(player_, SIGNAL(Stopped()), ui_->now_playing, SLOT(Stopped())); + connect(ui_->now_playing, SIGNAL(ShowAboveStatusBarChanged(bool)), + SLOT(NowPlayingWidgetPositionChanged(bool))); + NowPlayingWidgetPositionChanged(ui_->now_playing->show_above_status_bar()); // Load theme StyleSheetLoader* css_loader = new StyleSheetLoader(this); @@ -1219,3 +1222,14 @@ void MainWindow::TaskCountChanged(int count) { ui_->status_bar_stack->setCurrentWidget(ui_->multi_loading_indicator); } } + +void MainWindow::NowPlayingWidgetPositionChanged(bool above_status_bar) { + if (above_status_bar) { + ui_->status_bar->setParent(ui_->centralWidget); + } else { + ui_->status_bar->setParent(ui_->player_controls_container); + } + + ui_->status_bar->parentWidget()->layout()->addWidget(ui_->status_bar); + ui_->status_bar->show(); +} diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index 511f65311..bf58749d0 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -153,6 +153,8 @@ class MainWindow : public QMainWindow, public PlatformInterface { void CheckForUpdates(); + void NowPlayingWidgetPositionChanged(bool above_status_bar); + private: void SaveGeometry(); void AddFilesToPlaylist(bool clear_first, const QList& urls); diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index bfd55dedf..847b01082 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -163,258 +163,288 @@ - - - 0 - - - - - QFrame::NoFrame - - - - 1 + + + + 0 + + + 0 + + + + + QFrame::NoFrame - - 0 - - - - - - 22 - 22 - - - - true - - - - - - - - 22 - 22 - - - - true - - - - - - - false - - - - 22 - 22 - - - - QToolButton::MenuButtonPopup - - - true - - - - - - - - 22 - 22 - - - - true - - - - - - - - 1 + + + 1 + + + 0 + + + + + + 22 + 22 + - - 0 + + true - - - - Qt::Vertical - - - - - - - - 22 - 22 - - - - true - - - - - - - - 22 - 22 - - - - true - - - - - - - - - - Qt::Vertical - - - - - - - - 100 - 0 - - - - - 0 - 36 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 0 - 0 - - - - - - - - Qt::Vertical - - - - - - - - 0 - 0 - - - - 100 - - - Qt::Horizontal - - - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 3 - - - 0 - - - - - - + + + + + + + 22 + 22 + + + + true + + + + + + + false + + + + 22 + 22 + + + + QToolButton::MenuButtonPopup + + + true + + + + + + + + 22 + 22 + + + + true + + + + + + - 0 + 1 0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::Vertical + + + + + + + + 22 + 22 + + + + true + + + + + + + + 22 + 22 + + + + true - - - - - - Qt::Vertical - - - - - - - - - - Qt::Vertical - - - - - - - - - - + + + + + Qt::Vertical + + + + + + + + 100 + 0 + + + + + 0 + 36 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 0 + 0 + + + + + + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + 100 + + + Qt::Horizontal + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 3 + + + 0 + + + + + + + + 0 + + + 0 + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + Qt::Vertical + + + + + + + + + + Qt::Vertical + + + + + + + + 10 + 0 + + + + + + + + + + + + @@ -430,7 +460,7 @@ 0 0 1131 - 23 + 25 diff --git a/src/widgets/nowplayingwidget.cpp b/src/widgets/nowplayingwidget.cpp index ad05e8c99..c92344dbe 100644 --- a/src/widgets/nowplayingwidget.cpp +++ b/src/widgets/nowplayingwidget.cpp @@ -49,6 +49,7 @@ NowPlayingWidget::NowPlayingWidget(QWidget *parent) network_(NULL), mode_(SmallSongDetails), menu_(new QMenu(this)), + above_statusbar_action_(NULL), visible_(false), small_ideal_height_(0), cover_height_(0), @@ -66,10 +67,16 @@ NowPlayingWidget::NowPlayingWidget(QWidget *parent) // Context menu QActionGroup* mode_group = new QActionGroup(this); QSignalMapper* mode_mapper = new QSignalMapper(this); + connect(mode_mapper, SIGNAL(mapped(int)), SLOT(SetMode(int))); CreateModeAction(SmallSongDetails, tr("Small album cover"), mode_group, mode_mapper); CreateModeAction(LargeSongDetails, tr("Large album cover"), mode_group, mode_mapper); + menu_->addActions(mode_group->actions()); - connect(mode_mapper, SIGNAL(mapped(int)), SLOT(SetMode(int))); + menu_->addSeparator(); + above_statusbar_action_ = menu_->addAction(tr("Show above status bar")); + above_statusbar_action_->setCheckable(true); + connect(above_statusbar_action_, SIGNAL(toggled(bool)), SLOT(ShowAboveStatusBar(bool))); + above_statusbar_action_->setChecked(s.value("above_status_bar", false).toBool()); // Animations connect(show_hide_animation_, SIGNAL(frameChanged(int)), SLOT(SetHeight(int))); @@ -305,3 +312,15 @@ void NowPlayingWidget::resizeEvent(QResizeEvent* e) { void NowPlayingWidget::contextMenuEvent(QContextMenuEvent* e) { menu_->popup(mapToGlobal(e->pos())); } + +void NowPlayingWidget::ShowAboveStatusBar(bool above) { + QSettings s; + s.beginGroup(kSettingsGroup); + s.setValue("above_status_bar", above); + + emit ShowAboveStatusBarChanged(above); +} + +bool NowPlayingWidget::show_above_status_bar() const { + return above_statusbar_action_->isChecked(); +} diff --git a/src/widgets/nowplayingwidget.h b/src/widgets/nowplayingwidget.h index b2314b2fe..f1750ed49 100644 --- a/src/widgets/nowplayingwidget.h +++ b/src/widgets/nowplayingwidget.h @@ -53,8 +53,13 @@ public: void set_network(NetworkAccessManager* network) { network_ = network; } void set_ideal_height(int height); + bool show_above_status_bar() const; + QSize sizeHint() const; +signals: + void ShowAboveStatusBarChanged(bool above); + public slots: void NowPlaying(const Song& metadata); void Stopped(); @@ -66,6 +71,7 @@ protected: private slots: void SetMode(int mode); + void ShowAboveStatusBar(bool above); void CoverLoaderInitialised(); void AlbumArtLoaded(quint64 id, const QImage& image); @@ -89,6 +95,7 @@ private: Mode mode_; QMenu* menu_; + QAction* above_statusbar_action_; bool visible_; int small_ideal_height_;