~3v1n0/unity/lim-panel

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/LensBar.cpp

  • Committer: Daniel van Vugt
  • Date: 2012-02-04 05:28:23 UTC
  • mfrom: (1858.2.39 unity)
  • mto: (1858.2.49 unity)
  • mto: This revision was merged to the branch mainline in revision 1921.
  • Revision ID: vanvugt@gmail.com-20120204052823-6q9xwlzsps95610x
Rebased and resolved conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
 
149
149
void LensBar::SetActive(LensBarIcon* activated)
150
150
{
 
151
  bool state_changed = false;
 
152
 
151
153
  for (auto icon: icons_)
152
 
    icon->active = icon == activated;
153
 
 
154
 
  lens_activated.emit(activated->id);
 
154
  {
 
155
    bool state = icon == activated;
 
156
 
 
157
    if (icon->active != state)
 
158
      state_changed = true;
 
159
 
 
160
    icon->active = state;
 
161
  }
 
162
 
 
163
  if (state_changed)
 
164
    lens_activated.emit(activated->id);
155
165
}
156
166
 
157
167
void LensBar::ActivateNext()