~sao/unity/show_launcher_in_navmode

« back to all changes in this revision

Viewing changes to src/LauncherController.cpp

  • Committer: Neil Jagdish Patel
  • Date: 2011-02-17 09:56:22 UTC
  • mfrom: (865 unity)
  • mto: This revision was merged to the branch mainline in revision 867.
  • Revision ID: neil.patel@canonical.com-20110217095622-js8ix8df5x8fgc1c
[merge] trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
  _device_section = new DeviceLauncherSection (_launcher);
48
48
  _device_section->IconAdded.connect (sigc::mem_fun (this, &LauncherController::OnIconAdded));
49
49
 
50
 
  InsertExpoAction ();
 
50
  _num_workspaces = _screen->vpSize ().width ();
 
51
  if(_num_workspaces > 1)
 
52
  {
 
53
    InsertExpoAction ();
 
54
  }
51
55
  InsertTrash ();
52
56
 
53
57
  g_timeout_add (500, (GSourceFunc) &LauncherController::BamfTimerCallback, this);
160
164
}
161
165
 
162
166
void
 
167
LauncherController::UpdateNumWorkspaces (int workspaces)
 
168
{
 
169
  if ((_num_workspaces == 0) && (workspaces > 0))
 
170
  {
 
171
    InsertExpoAction ();
 
172
  }
 
173
  else if((_num_workspaces > 0) && (workspaces == 0))
 
174
  {
 
175
    RemoveExpoAction ();
 
176
  }
 
177
  
 
178
  _num_workspaces = workspaces;
 
179
}
 
180
 
 
181
void
163
182
LauncherController::InsertExpoAction ()
164
183
{
165
 
  SimpleLauncherIcon *expoIcon;
166
 
  expoIcon = new SimpleLauncherIcon (_launcher);
167
 
  
168
 
  expoIcon->SetTooltipText (_("Workspace Switcher"));
169
 
  expoIcon->SetIconName ("workspace-switcher");
170
 
  expoIcon->SetQuirk (LauncherIcon::QUIRK_VISIBLE, true);
171
 
  expoIcon->SetQuirk (LauncherIcon::QUIRK_RUNNING, false);
172
 
  expoIcon->SetIconType (LauncherIcon::TYPE_EXPO);
173
 
  
174
 
  expoIcon->MouseClick.connect (sigc::mem_fun (this, &LauncherController::OnExpoClicked));
175
 
  
176
 
  RegisterIcon (expoIcon);
 
184
  _expoIcon = new SimpleLauncherIcon (_launcher);
 
185
  
 
186
  _expoIcon->SetTooltipText (_("Workspace Switcher"));
 
187
  _expoIcon->SetIconName ("workspace-switcher");
 
188
  _expoIcon->SetQuirk (LauncherIcon::QUIRK_VISIBLE, true);
 
189
  _expoIcon->SetQuirk (LauncherIcon::QUIRK_RUNNING, false);
 
190
  _expoIcon->SetIconType (LauncherIcon::TYPE_EXPO);
 
191
  
 
192
  _expoIcon->MouseClick.connect (sigc::mem_fun (this, &LauncherController::OnExpoClicked));
 
193
  
 
194
  RegisterIcon (_expoIcon);
 
195
}
 
196
 
 
197
void
 
198
LauncherController::RemoveExpoAction ()
 
199
{
 
200
  _model->RemoveIcon (_expoIcon);
177
201
}
178
202
 
179
203
void