Add "Show above status bar" as an option
This commit is contained in:
@@ -73,6 +73,7 @@ PlayingWidget::PlayingWidget(QWidget *parent)
|
||||
album_cover_choice_controller_(nullptr),
|
||||
mode_(LargeSongDetails),
|
||||
menu_(new QMenu(this)),
|
||||
above_statusbar_action_(nullptr),
|
||||
fit_cover_width_action_(nullptr),
|
||||
enabled_(false),
|
||||
visible_(false),
|
||||
@@ -142,6 +143,10 @@ void PlayingWidget::SetApplication(Application *app, AlbumCoverChoiceController
|
||||
menu_->addActions(cover_actions);
|
||||
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)));
|
||||
|
||||
connect(album_cover_choice_controller_, SIGNAL(AutomaticCoverSearchDone()), this, SLOT(AutomaticCoverSearchDone()));
|
||||
connect(album_cover_choice_controller_->search_cover_auto_action(), SIGNAL(triggered()), this, SLOT(SearchCoverAutomatically()));
|
||||
|
||||
@@ -218,6 +223,7 @@ void PlayingWidget::SetMode(int mode) {
|
||||
QSettings s;
|
||||
s.beginGroup(kSettingsGroup);
|
||||
s.setValue("mode", mode_);
|
||||
s.endGroup();
|
||||
|
||||
}
|
||||
|
||||
@@ -232,6 +238,14 @@ void PlayingWidget::FitCoverWidth(bool fit) {
|
||||
s.setValue("fit_cover_width", fit_width_);
|
||||
}
|
||||
|
||||
void PlayingWidget::ShowAboveStatusBar(bool above) {
|
||||
QSettings s;
|
||||
s.beginGroup(kSettingsGroup);
|
||||
s.setValue("above_status_bar", above);
|
||||
emit ShowAboveStatusBarChanged(above);
|
||||
s.endGroup();
|
||||
}
|
||||
|
||||
void PlayingWidget::Playing() {
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ class PlayingWidget : public QWidget {
|
||||
void SetDisabled();
|
||||
void set_ideal_height(int height);
|
||||
QSize sizeHint() const;
|
||||
bool show_above_status_bar() const { return above_statusbar_action_->isChecked(); }
|
||||
|
||||
signals:
|
||||
void ShowAboveStatusBarChanged(bool above);
|
||||
@@ -91,6 +92,7 @@ class PlayingWidget : public QWidget {
|
||||
|
||||
private slots:
|
||||
void SetMode(int mode);
|
||||
void ShowAboveStatusBar(bool above);
|
||||
void FitCoverWidth(bool fit);
|
||||
|
||||
void SearchCoverAutomatically();
|
||||
@@ -119,6 +121,7 @@ class PlayingWidget : public QWidget {
|
||||
AlbumCoverChoiceController *album_cover_choice_controller_;
|
||||
Mode mode_;
|
||||
QMenu *menu_;
|
||||
QAction* above_statusbar_action_;
|
||||
QAction *fit_cover_width_action_;
|
||||
bool enabled_;
|
||||
bool visible_;
|
||||
|
||||
Reference in New Issue
Block a user