~unity-team/unity/trusty-1332509

« back to all changes in this revision

Viewing changes to dash/FilterBar.cpp

  • Committer: CI bot
  • Author(s): Stephen M. Webb, Marco Trevisan (Treviño), Andrea Azzarone, Pawel Szubert, Chris Townsend, Andrea Azzarone, Eleni Maria Stea
  • Date: 2014-08-26 13:48:28 UTC
  • mfrom: (3800.1.24 prepare-7.2.3-SRU)
  • Revision ID: ps-jenkins@lists.canonical.com-20140826134828-fkev1oisyfl9kbt3
Prepare fixes for upstream micro-release 7.2.3. Fixes: 1283415, 1292391, 1306211, 1312107, 1320051, 1320071, 1324114, 1339629, 1340171, 1340394, 1340477, 1340992, 1340996, 1342208, 1342731, 1347735

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
  : View(NUX_FILE_LINE_PARAM)
48
48
  , scale(DEFAULT_SCALE)
49
49
{
50
 
  Init();
51
 
}
52
 
 
53
 
FilterBar::~FilterBar()
54
 
{
55
 
}
56
 
 
57
 
void FilterBar::Init()
58
 
{
59
 
  dash::Style& style = dash::Style::Instance();
60
 
 
61
 
  nux::LinearLayout* layout = new nux::VLayout(NUX_TRACKER_LOCATION);
62
 
  layout->SetTopAndBottomPadding(style.GetFilterBarTopPadding() - style.GetFilterHighlightPadding());
63
 
  layout->SetSpaceBetweenChildren(style.GetSpaceBetweenFilterWidgets() - style.GetFilterHighlightPadding());
 
50
  SetLayout(new nux::VLayout(NUX_TRACKER_LOCATION));
64
51
  scale.changed.connect(sigc::mem_fun(this, &FilterBar::UpdateScale));
65
 
  SetLayout(layout);
 
52
  UpdateScale(scale);
66
53
}
67
54
 
68
55
void FilterBar::UpdateScale(double scale)
69
56
{
70
57
  for (auto& filters : filter_map_)
71
58
    filters.second->scale = scale;
 
59
 
 
60
  auto& style = dash::Style::Instance();
 
61
  auto* layout = static_cast<nux::VLayout*>(GetLayout());
 
62
  layout->SetTopAndBottomPadding(style.GetFilterBarTopPadding().CP(scale) - style.GetFilterHighlightPadding().CP(scale));
 
63
  layout->SetSpaceBetweenChildren(style.GetSpaceBetweenFilterWidgets().CP(scale) - style.GetFilterHighlightPadding().CP(scale));
72
64
}
73
65
 
74
66
void FilterBar::SetFilters(Filters::Ptr const& filters)
118
110
}
119
111
 
120
112
void FilterBar::Draw(nux::GraphicsEngine& graphics_engine, bool force_draw)
121
 
{
122
 
 
123
 
}
 
113
{}
124
114
 
125
115
void FilterBar::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw)
126
116
{