diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-07-07 20:12:42 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-07-07 20:12:42 +0200 |
| commit | 3c16a93cf18570bd8753fc95ec3729f03700bef7 (patch) | |
| tree | 9072bbda57996ce975b00f1affb0961a6240399b /dash | |
| parent | 3432fd8b8cc332f5e1b45e1517285eec89081199 (diff) | |
Tracks: don't limit the track width, make sure we relayout and cleanup code
(bzr r3830.3.22)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/previews/Tracks.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/dash/previews/Tracks.cpp b/dash/previews/Tracks.cpp index fdc24d502..d78b7c6c7 100644 --- a/dash/previews/Tracks.cpp +++ b/dash/previews/Tracks.cpp @@ -37,10 +37,9 @@ namespace previews namespace { - const RawPixel CHILDREN_SPACE = 1_em; -} - DECLARE_LOGGER(logger, "unity.dash.preview.music.tracks"); +const RawPixel CHILDREN_SPACE = 1_em; +} NUX_IMPLEMENT_OBJECT_TYPE(Tracks); @@ -134,22 +133,23 @@ void Tracks::OnTrackRemoved(dash::Track const& track_row) void Tracks::UpdateScale(double scale) { - previews::Style& style = dash::previews::Style::Instance(); + int track_height = Style::Instance().GetTrackHeight().CP(scale); - for (std::map<std::string, previews::Track::Ptr>::iterator it = m_tracks.begin(); it != m_tracks.end(); ++it) + for (auto const& track : m_tracks) { - it->second->scale = scale; - it->second->SetMinimumHeight(style.GetTrackHeight().CP(scale)); - it->second->SetMaximumHeight(style.GetTrackHeight().CP(scale)); - it->second->SetMinimumWidth(style.GetTrackHeight().CP(scale)); - it->second->SetMaximumWidth(style.GetTrackHeight().CP(scale)); + track.second->SetMinimumHeight(track_height); + track.second->SetMaximumHeight(track_height); + track.second->scale = scale; } if (layout_) { - layout_->SetPadding(0, previews::Style::Instance().GetDetailsRightMargin().CP(scale), 0, 0); + layout_->SetPadding(0, Style::Instance().GetDetailsRightMargin().CP(scale), 0, 0); layout_->SetSpaceBetweenChildren(CHILDREN_SPACE.CP(scale)); } + + QueueRelayout(); + QueueDraw(); } } // namespace previews |
