Skip to content

Commit

Permalink
Repair the sorting of the hotkey list.
Browse files Browse the repository at this point in the history
  • Loading branch information
fendrin authored and irydacea committed Jul 14, 2014
1 parent 50ee046 commit 5c4694c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/hotkey/hotkey_preferences_display.cpp
Expand Up @@ -254,7 +254,7 @@ hotkey_preferences_dialog::hotkey_preferences_dialog(display& disp) :
game_commands_(),
editor_commands_(),
title_screen_commands_(),
heading_( (formatter() << HEADING_PREFIX << _("Action")
heading_( (formatter() << HEADING_PREFIX << COLUMN_SEPARATOR << _("Action")
<< COLUMN_SEPARATOR << _("Binding")).str() ),
selected_command_(0),
general_sorter_(),
Expand Down Expand Up @@ -314,17 +314,21 @@ hotkey_preferences_dialog::hotkey_preferences_dialog(display& disp) :
disp_.video().clear_all_help_strings();

// Initialize sorters.
general_sorter_.set_alpha_sort(0).set_alpha_sort(1);
game_sorter_.set_alpha_sort(0).set_alpha_sort(1);
editor_sorter_.set_alpha_sort(0).set_alpha_sort(1);
title_screen_sorter_.set_alpha_sort(0).set_alpha_sort(1);
general_sorter_.set_alpha_sort(1).set_alpha_sort(2);
game_sorter_.set_alpha_sort(1).set_alpha_sort(2);
editor_sorter_.set_alpha_sort(1).set_alpha_sort(2);
title_screen_sorter_.set_alpha_sort(1).set_alpha_sort(2);

// Populate every menu_
for (int scope = 0; scope != hotkey::SCOPE_COUNT; scope++) {
tab_ = hotkey::scope(scope);
set_hotkey_menu(false);
}

general_hotkeys_.sort_by(1);
game_hotkeys_.sort_by(1);
editor_hotkeys_.sort_by(1);
title_screen_hotkeys_.sort_by(1);
}

void hotkey_preferences_dialog::set_hotkey_menu(bool keep_viewport) {
Expand Down Expand Up @@ -381,7 +385,7 @@ void hotkey_preferences_dialog::set_hotkey_menu(bool keep_viewport) {
image_path = "icons/action/" + command + "_25.png~CROP(3,3,18,18)";

menu_items.push_back(
(formatter() << IMAGE_PREFIX << image_path << IMG_TEXT_SEPARATOR
(formatter() << IMAGE_PREFIX << image_path << COLUMN_SEPARATOR
<< truncated_description
<< HELP_STRING_SEPARATOR << description << (tooltip.empty() ? "" : " - ") << tooltip
<< COLUMN_SEPARATOR << font::NULL_MARKUP
Expand Down

0 comments on commit 5c4694c

Please sign in to comment.