miscellaneous fixes

This commit is contained in:
Subhraman Sarkar 2024-09-20 11:49:25 +05:30 committed by Celtic Minstrel
parent 6ec5af83df
commit aa3006c883
5 changed files with 7 additions and 14 deletions

View file

@ -77,7 +77,7 @@ void help_browser::pre_show(window& window)
connect_signal_mouse_left_click(back_button, std::bind(&help_browser::on_history_navigate, this, true));
connect_signal_mouse_left_click(next_button, std::bind(&help_browser::on_history_navigate, this, false));
topic_text.register_link_callback(std::bind(&help_browser::on_link_click, this, std::placeholders::_1));
topic_text.register_link_callback(std::bind(&help_browser::show_topic, this, std::placeholders::_1, true));
connect_signal_notify_modified(topic_tree, std::bind(&help_browser::on_topic_select, this));
@ -170,11 +170,6 @@ void help_browser::show_topic(std::string topic_id, bool add_to_history)
}
}
void help_browser::on_link_click(std::string link)
{
show_topic(link);
}
void help_browser::on_topic_select()
{
tree_view& topic_tree = find_widget<tree_view>(this, "topic_tree", false);

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2017 - 2022
Copyright (C) 2017 - 2024
by Charles Dang <exodia339@gmail.com>
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
@ -62,8 +62,6 @@ private:
tree_view_node& add_topic(const std::string& topic_id, const std::string& topic_title,
bool expands, tree_view_node& parent);
void show_topic(std::string topic_id, bool add_to_history = true);
void on_link_click(std::string link);
};
} // namespace dialogs

View file

@ -73,10 +73,10 @@ tree_view_node::tree_view_node(const std::string& id,
toggle_widget->set_visible(widget::visibility::hidden);
toggle_widget->connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&tree_view_node::signal_handler_icon_left_click, this, std::placeholders::_2));
std::bind(&tree_view_node::signal_handler_toggle_left_click, this, std::placeholders::_2));
toggle_widget->connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&tree_view_node::signal_handler_icon_left_click, this, std::placeholders::_2),
std::bind(&tree_view_node::signal_handler_toggle_left_click, this, std::placeholders::_2),
event::dispatcher::back_post_child);
if(unfolded_) {
@ -645,7 +645,7 @@ void tree_view_node::impl_draw_children()
}
}
void tree_view_node::signal_handler_icon_left_click(const event::ui_event event)
void tree_view_node::signal_handler_toggle_left_click(const event::ui_event event)
{
DBG_GUI_E << LOG_HEADER << ' ' << event << ".";

View file

@ -314,7 +314,7 @@ private:
/** See @ref widget::impl_draw_children. */
virtual void impl_draw_children() override;
void signal_handler_icon_left_click(const event::ui_event event);
void signal_handler_toggle_left_click(const event::ui_event event);
void signal_handler_label_left_button_click(const event::ui_event event,
bool& handled,

View file

@ -105,7 +105,7 @@ public:
topic_text& operator=(const topic_text& t) = default;
topic_text& operator=(std::shared_ptr<topic_generator> g);
const config& parsed_text() const;
const config& parsed_text() const;
};
/** A topic contains a title, an id and some text. */