Skip to content

Commit

Permalink
Display the tooltip for hovered hotkey actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
fendrin committed Jun 7, 2014
1 parent 8750dec commit acf3dfd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hotkey/hotkey_preferences_display.cpp
Expand Up @@ -368,15 +368,17 @@ void hotkey_preferences_dialog::set_hotkey_menu(bool keep_viewport) {
BOOST_FOREACH(const std::string& command, *commands) {

const std::string& description = hotkey::get_description(command);
const std::string& tooltip = hotkey::get_tooltip(command);
std::string truncated_description = description;
if (truncated_description.size() >= (truncate_at + 2) ) {
utils::ellipsis_truncate(truncated_description, truncate_at);
}
const std::string& name = hotkey::get_names(command);

menu_items.push_back(
(formatter() << truncated_description << HELP_STRING_SEPARATOR
<< description << COLUMN_SEPARATOR << font::NULL_MARKUP
(formatter() << truncated_description
<< HELP_STRING_SEPARATOR << description << (tooltip.empty() ? "" : " - ") << tooltip
<< COLUMN_SEPARATOR << font::NULL_MARKUP
<< name << HELP_STRING_SEPARATOR << name).str() );
}

Expand Down

0 comments on commit acf3dfd

Please sign in to comment.