Remember the playlist column stretch setting when changing it, and update the menu action's checked state properly when opening clementine.

This commit is contained in:
David Sansome 2011-07-25 13:39:47 +01:00
parent 30f68d6981
commit f599c0fca7
3 changed files with 4 additions and 3 deletions

View File

@ -32,8 +32,7 @@ PlaylistHeader::PlaylistHeader(Qt::Orientation orientation, QWidget* parent)
stretch_action_ = menu_->addAction(tr("&Stretch columns to fit window"), this, SLOT(ToggleStretchEnabled()));
menu_->addSeparator();
QMenu* align_menu = new QMenu(tr("&Align text"), this);
align_left_action_ = align_menu->addAction(tr("&Left"), this, SLOT(AlignCurrentLeft()));
QMenu* align_menu = new QMenu(tr("&Align text"), this); align_left_action_ = align_menu->addAction(tr("&Left"), this, SLOT(AlignCurrentLeft()));
align_center_action_ = align_menu->addAction(tr("&Center"), this, SLOT(AlignCurrentCenter()));
align_right_action_ = align_menu->addAction(tr("&Right"), this, SLOT(AlignCurrentRight()));

View File

@ -902,11 +902,11 @@ void PlaylistView::SaveSettings() {
s.setValue("glow_effect", glow_enabled_);
s.setValue("column_alignments", QVariant::fromValue(playlist_->column_alignments()));
s.setValue("bg_enabled", background_enabled_);
}
void PlaylistView::StretchChanged(bool stretch) {
setHorizontalScrollBarPolicy(stretch ? Qt::ScrollBarAlwaysOff : Qt::ScrollBarAsNeeded);
SaveGeometry();
}
void PlaylistView::DynamicModeChanged(bool dynamic) {

View File

@ -271,6 +271,8 @@ bool StretchHeaderView::RestoreState(const QByteArray& data) {
UpdateWidths();
}
emit StretchEnabledChanged(stretch_enabled_);
return true;
}