~3v1n0/unity/scale-window-cast-protection

« back to all changes in this revision

Viewing changes to hud/HudButton.cpp

  • Committer: Marco Trevisan (Treviño)
  • Date: 2013-11-14 03:00:29 UTC
  • mto: This revision was merged to the branch mainline in revision 3596.
  • Revision ID: mail@3v1n0.net-20131114030029-jw6albd1rccg1uzm
Unity: always prefer passing [this] to lambdas than [&]

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
  InitTheme();
67
67
 
68
 
  key_nav_focus_change.connect([&](nux::Area*, bool, nux::KeyNavDirection)
69
 
  {
70
 
    QueueDraw();
71
 
  });
72
 
 
73
 
  fake_focused.changed.connect([&](bool)
74
 
  {
75
 
    QueueDraw();
76
 
  });
77
 
 
78
 
  mouse_move.connect([&](int x, int y, int dx, int dy, unsigned int button, unsigned int key)
 
68
  key_nav_focus_change.connect([this](nux::Area*, bool, nux::KeyNavDirection)
 
69
  {
 
70
    QueueDraw();
 
71
  });
 
72
 
 
73
  fake_focused.changed.connect([this](bool)
 
74
  {
 
75
    QueueDraw();
 
76
  });
 
77
 
 
78
  mouse_move.connect([this](int x, int y, int dx, int dy, unsigned int button, unsigned int key)
79
79
  {
80
80
    if (!fake_focused)
81
81
      fake_focused = true;
82
82
  });
83
83
 
84
 
  mouse_enter.connect([&](int x, int y, unsigned int button, unsigned int key)
 
84
  mouse_enter.connect([this](int x, int y, unsigned int button, unsigned int key)
85
85
  {
86
86
    fake_focused = true;
87
87
  });
88
88
 
89
 
  mouse_leave.connect([&](int x, int y, unsigned int button, unsigned int key)
 
89
  mouse_leave.connect([this](int x, int y, unsigned int button, unsigned int key)
90
90
  {
91
91
    fake_focused = false;
92
92
  });
94
94
 
95
95
void HudButton::InitTheme()
96
96
{
97
 
  is_rounded.changed.connect([&](bool)
 
97
  is_rounded.changed.connect([this](bool)
98
98
  {
99
99
    nux::Geometry const& geo = GetGeometry();
100
100
    prelight_->Invalidate(geo);