Moodbar-Trackslider uses the full available height

When determining the next state (for rendering the change), the slider widgets vertical SizePolicy is changed from Fixed to MinimumExpanding (same thing works the other way around).
This commit is contained in:
Sebastian J. Mielke 2014-03-11 16:08:24 +01:00
parent e944abfe45
commit e73450cf43
1 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,12 @@ void MoodbarProxyStyle::SetMoodbarEnabled(bool enabled) {
void MoodbarProxyStyle::NextState() {
const bool visible = enabled_ && !data_.isEmpty();
// While the regular slider should stay at the standard size (Fixed),
// moodbars should use all available space (MinimumExpanding).
slider_->setSizePolicy(QSizePolicy::Expanding,
visible ? QSizePolicy::MinimumExpanding : QSizePolicy::Fixed);
slider_->updateGeometry();
if (show_moodbar_action_) {
show_moodbar_action_->setChecked(enabled_);
}