diff --git a/images/help/indentation.png b/images/help/indentation.png deleted file mode 100644 index 507ab0a3a927..000000000000 Binary files a/images/help/indentation.png and /dev/null differ diff --git a/src/help/help_impl.cpp b/src/help/help_impl.cpp index e2ab5e5fce35..3450ac43bbf0 100644 --- a/src/help/help_impl.cpp +++ b/src/help/help_impl.cpp @@ -83,7 +83,6 @@ const unsigned max_history = 100; const std::string topic_img = "help/topic.png"; const std::string closed_section_img = "help/closed_section.png"; const std::string open_section_img = "help/open_section.png"; -const std::string indentation_img = "help/indentation.png"; // The topic to open by default when opening the help dialog. const std::string default_show_topic = "..introduction"; const std::string unknown_unit_topic = ".unknown_unit"; diff --git a/src/help/help_impl.hpp b/src/help/help_impl.hpp index a274829a071a..c7453bfa6c31 100644 --- a/src/help/help_impl.hpp +++ b/src/help/help_impl.hpp @@ -333,7 +333,6 @@ extern const unsigned max_history; extern const std::string topic_img; extern const std::string closed_section_img; extern const std::string open_section_img; -extern const std::string indentation_img; // The topic to open by default when opening the help dialog. extern const std::string default_show_topic; extern const std::string unknown_unit_topic; diff --git a/src/help/help_menu.cpp b/src/help/help_menu.cpp index 69479e4b2857..c6e43ad471d3 100644 --- a/src/help/help_menu.cpp +++ b/src/help/help_menu.cpp @@ -89,20 +89,20 @@ void help_menu::update_visible_items(const section &sec, unsigned level) } } -std::string help_menu::indented_icon(const std::string& icon, const unsigned level) { +std::string help_menu::indent_list(const std::string& icon, const unsigned level) { std::stringstream to_show; - for (unsigned i = 1; i < level; ++i) { - to_show << IMAGE_PREFIX << indentation_img << IMG_TEXT_SEPARATOR; + for (unsigned i = 1; i < level; ++i) { + to_show << " "; // Indent 4 spaces } - to_show << IMAGE_PREFIX << icon; + to_show << IMG_TEXT_SEPARATOR << IMAGE_PREFIX << icon; return to_show.str(); } std::string help_menu::get_string_to_show(const section &sec, const unsigned level) { std::stringstream to_show; - to_show << indented_icon(expanded(sec) ? open_section_img : closed_section_img, level) + to_show << indent_list(expanded(sec) ? open_section_img : closed_section_img, level) << IMG_TEXT_SEPARATOR << sec.title; return to_show.str(); } @@ -110,7 +110,7 @@ std::string help_menu::get_string_to_show(const section &sec, const unsigned lev std::string help_menu::get_string_to_show(const topic &topic, const unsigned level) { std::stringstream to_show; - to_show << indented_icon(topic_img, level) + to_show << indent_list(topic_img, level) << IMG_TEXT_SEPARATOR << topic.title; return to_show.str(); } @@ -172,7 +172,7 @@ int help_menu::process() const std::string icon_img = expanded(*sec) ? open_section_img : closed_section_img; // we remove the right thickness (ne present between icon and text) - int text_start = style_->item_size(indented_icon(icon_img, sec->level)).w - style_->get_thickness(); + int text_start = style_->item_size(indent_list(icon_img, sec->level)).w - style_->get_thickness(); // NOTE: if you want to forbid click to the left of the icon // also check x >= text_start-image_width(icon_img) diff --git a/src/help/help_menu.hpp b/src/help/help_menu.hpp index 7a124d7fec5e..314abbe821a5 100644 --- a/src/help/help_menu.hpp +++ b/src/help/help_menu.hpp @@ -75,7 +75,7 @@ class help_menu : public gui::menu /// Return the string to use as the prefix for the icon part of the /// menu-string at the specified level. - std::string indented_icon(const std::string &icon, const unsigned level); + std::string indent_list(const std::string &icon, const unsigned level); /// Return the string to use as the menu-string for sections at the /// specified level. std::string get_string_to_show(const section &sec, const unsigned level);