fix bug that scrollbar steals input focus(#344)

This commit is contained in:
Jinhao 2018-12-06 07:41:02 +08:00
parent f4c71db98b
commit 48d3f4f044
2 changed files with 3 additions and 2 deletions

View File

@ -190,6 +190,9 @@ namespace nana
widget_ = static_cast< ::nana::scroll<Vertical>*>(&widget);
widget.caption("nana scroll");
//scroll doesn't want the keyboard focus.
API::take_active(widget, false, widget.parent());
timer_.stop();
timer_.elapse(std::bind(&trigger::_m_tick, this));
}

View File

@ -224,7 +224,6 @@ namespace nana {
{
cv_scroll->vert.create(window_handle);
cv_scroll->vert.events().value_changed.connect_unignorable(event_fn);
API::take_active(cv_scroll->vert, false, window_handle);
this->passive = false;
}
@ -255,7 +254,6 @@ namespace nana {
{
cv_scroll->horz.create(window_handle);
cv_scroll->horz.events().value_changed.connect_unignorable(event_fn);
API::take_active(cv_scroll->horz, false, window_handle);
this->passive = false;
}