Skip to content

Commit

Permalink
Help Browser: Show topic title
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel authored and Vultraz committed Mar 18, 2018
1 parent f2434d6 commit 854ade5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
17 changes: 17 additions & 0 deletions data/gui/window/help_browser.cfg
Expand Up @@ -171,6 +171,23 @@

[page_definition]

[row]
grow_factor = 1

[column]
border = "left,right"
border_size = 5
horizontal_grow = true
vertical_grow = true

[label]
definition = "title"
id = "topic_title"
[/label]
[/column]

[/row]

[row]
grow_factor = 1

Expand Down
7 changes: 6 additions & 1 deletion src/gui/dialogs/help_browser.cpp
Expand Up @@ -140,10 +140,11 @@ static std::string format_help_text(const config& cfg)
}
ss << "<big>" << font::escape_text(item.cfg["text"]) << "</big>";
} else if(item.key == "jump") {
// Seems like this creates something invisible?
// This appears to be something akin to tab stops.
if(item.cfg["amount"].empty() && item.cfg["to"].empty()) {
throw help::parse_error("Jump markup must have either a to or an amount attribute.");
}
ss << '\t';
} else if(item.key == "format") {
if(item.cfg["text"].empty()) {
throw help::parse_error("Header markup must have text attribute.");
Expand Down Expand Up @@ -211,6 +212,10 @@ void help_browser::on_topic_select(window& window)
item["label"] = format_help_text(topic->text.parsed_text());
data.emplace("topic_text", item);

item.clear();
item["label"] = topic->title;
data.emplace("topic_title", item);

parsed_pages_.emplace(topic_id, topic_pages.get_page_count());
topic_pages.add_page(data);

Expand Down

0 comments on commit 854ade5

Please sign in to comment.