Skip to content

Commit

Permalink
tunit_create, tunit_recall: give simultaneous keyboard focus to filte…
Browse files Browse the repository at this point in the history
…r textbox and list
  • Loading branch information
Vultraz committed Aug 2, 2016
1 parent 7cdffec commit 7c45df4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/gui/dialogs/unit_create.cpp
Expand Up @@ -113,7 +113,8 @@ void tunit_create::pre_show(twindow& window)
filter->set_text_changed_callback(
std::bind(&tunit_create::filter_text_changed, this, _1, _2));

window.keyboard_capture(filter);
window.add_to_keyboard_chain(filter);
window.add_to_keyboard_chain(&list);

#ifdef GUI2_EXPERIMENTAL_LISTBOX
connect_signal_notify_modified(*list,
Expand Down
5 changes: 3 additions & 2 deletions src/gui/dialogs/unit_recall.cpp
Expand Up @@ -170,8 +170,6 @@ void tunit_recall::pre_show(twindow& window)
filter->set_text_changed_callback(
std::bind(&tunit_recall::filter_text_changed, this, _1, _2));

window.keyboard_capture(filter);

tlistbox& list = find_widget<tlistbox>(&window, "recall_list", false);

#ifdef GUI2_EXPERIMENTAL_LISTBOX
Expand All @@ -185,6 +183,9 @@ void tunit_recall::pre_show(twindow& window)

list.clear();

window.add_to_keyboard_chain(filter);
window.add_to_keyboard_chain(&list);

connect_signal_mouse_left_click(
find_widget<tbutton>(&window, "dismiss", false),
std::bind(&tunit_recall::dismiss_unit, this, std::ref(window)));
Expand Down

0 comments on commit 7c45df4

Please sign in to comment.