Skip to content

Commit

Permalink
Language Selection: use a proper toggle panel list instead of toggle …
Browse files Browse the repository at this point in the history
…buttons
  • Loading branch information
Vultraz committed Aug 10, 2016
1 parent bf734e3 commit ce5cb51
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
29 changes: 25 additions & 4 deletions data/gui/window/language_selection.cfg
Expand Up @@ -86,11 +86,32 @@
grow_factor = 1
horizontal_grow = "true"

[toggle_button]
definition = "listbox_text"

[toggle_panel]
definition = "default"
return_value_id = "ok"
[/toggle_button]

[grid]

[row]

[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5

[label]
id = "language"
definition = "default"
[/label]

[/column]

[/row]

[/grid]

[/toggle_panel]

[/column]

Expand Down
7 changes: 4 additions & 3 deletions src/gui/dialogs/language_selection.cpp
Expand Up @@ -67,10 +67,11 @@ void tlanguage_selection::pre_show(twindow& window)
const language_def& current_language = get_language();
for(const auto & lang : languages)
{
string_map item;
item.emplace("label", lang.language);
std::map<std::string, string_map> data;

list.add_row(item);
data["language"]["label"] = lang.language;

list.add_row(data);
if(lang == current_language) {
list.select_row(list.get_item_count() - 1);
}
Expand Down

0 comments on commit ce5cb51

Please sign in to comment.