~3v1n0/unity/new-launcher-assets

« back to all changes in this revision

Viewing changes to launcher/SwitcherView.cpp

  • Committer: Marco Trevisan (Treviño)
  • Date: 2012-11-21 20:35:31 UTC
  • Revision ID: mail@3v1n0.net-20121121203531-oj8pxhm823cu8hsz
SwitcherView: update the icons spacing and the vertical size to match design

Also fix a drawing issue, making the text to be drawn in another layer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
namespace switcher
33
33
{
34
34
 
 
35
namespace
 
36
{
 
37
  const unsigned int VERTICAL_PADDING = 45;
 
38
}
 
39
 
35
40
NUX_IMPLEMENT_OBJECT_TYPE(SwitcherView);
36
41
 
37
42
SwitcherView::SwitcherView()
38
43
  : render_boxes(false)
39
44
  , border_size(50)
40
 
  , flat_spacing(10)
 
45
  , flat_spacing(20)
41
46
  , icon_size(128)
42
47
  , minimum_spacing(10)
43
48
  , tile_size(150)
44
 
  , vertical_size(tile_size + 80)
 
49
  , vertical_size(tile_size + VERTICAL_PADDING * 2)
45
50
  , text_size(15)
46
51
  , animation_length(250)
47
52
  , monitor(-1)
117
122
void SwitcherView::OnTileSizeChanged (int size)
118
123
{
119
124
  icon_renderer_->SetTargetSize(tile_size, icon_size, 10);
120
 
  vertical_size = tile_size + 80;
 
125
  vertical_size = tile_size + VERTICAL_PADDING * 2;
121
126
}
122
127
 
123
128
void SwitcherView::SaveLast ()
581
586
 
582
587
  if (text_view_->IsVisible())
583
588
  {
 
589
    nux::GetPainter().PushPaintLayerStack();
584
590
    text_view_->SetBaseY(last_background_.y + last_background_.height - 45);
585
591
    text_view_->Draw(GfxContext, force_draw);
 
592
    nux::GetPainter().PopPaintLayerStack();
586
593
  }
587
594
 
588
595
  int ms_since_change = TimeUtil::TimeDelta(&current_, &save_time_);