~3v1n0/unity/session-keyselect-default-button

« back to all changes in this revision

Viewing changes to shutdown/SessionView.cpp

  • Committer: Marco Trevisan (Treviño)
  • Date: 2013-03-19 16:03:05 UTC
  • Revision ID: mail@3v1n0.net-20130319160305-z80ol2wecq799d65
SessionView: save the button to key-focus into a RO property

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)