~brandontschaefer/unity/lp.1099815-fix

« back to all changes in this revision

Viewing changes to shutdown/SessionView.cpp

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2013-03-19 22:32:11 UTC
  • mfrom: (3227.1.12 shutdown-fixes)
  • Revision ID: tarmac-20130319223211-msjn1dme4rse2nr9
SessionController: set the view's default action button as key-focus area on init. Fixes: https://bugs.launchpad.net/bugs/1155562.

Approved by PS Jenkins bot, Andrea Azzarone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
View::View(Manager::Ptr const& manager)
49
49
  : mode(Mode::FULL)
 
50
  , key_focus_area([this] { return key_focus_area_; })
50
51
  , manager_(manager)
 
52
  , key_focus_area_(this)
51
53
{
52
54
  closable = true;
53
55
  auto main_layout = new nux::VLayout();
170
172
{
171
173
  debug::Introspectable::RemoveAllChildren();
172
174
  buttons_layout_->Clear();
 
175
  key_focus_area_ = this;
173
176
 
174
177
  if (mode() == Mode::LOGOUT)
175
178
  {
179
182
 
180
183
    button = new Button(Button::Action::LOGOUT, NUX_TRACKER_LOCATION);
181
184
    button->activated.connect(sigc::mem_fun(manager_.get(), &Manager::Logout));
 
185
    key_focus_area_ = button;
182
186
    AddButton(button);
183
187
  }
184
188
  else
212
216
 
213
217
      button = new Button(Button::Action::SHUTDOWN, NUX_TRACKER_LOCATION);
214
218
      button->activated.connect(sigc::mem_fun(manager_.get(), &Manager::Shutdown));
 
219
      key_focus_area_ = (mode() == Mode::SHUTDOWN) ? button : key_focus_area_;
215
220
      AddButton(button);
216
221
    }
217
222
    else if (mode() == Mode::FULL)