Skip to content

Commit

Permalink
Mark credits label as link-unaware
Browse files Browse the repository at this point in the history
This significantly speeds up opening the credits screen.
  • Loading branch information
jyrkive committed Jun 2, 2017
1 parent d90b1d1 commit 495c744
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/dialogs/end_credits.cpp
Expand Up @@ -125,6 +125,7 @@ void end_credits::pre_show(window& window)
text_widget_ = find_widget<scroll_label>(&window, "text", false, true);

text_widget_->set_use_markup(true);
text_widget_->set_link_aware(false);
text_widget_->set_label((focus_ss.str().empty() ? ss : focus_ss).str());

// HACK: always hide the scrollbar, even if it's needed.
Expand Down
7 changes: 7 additions & 0 deletions src/gui/widgets/scroll_label.cpp
Expand Up @@ -103,6 +103,13 @@ void scroll_label::set_text_alpha(unsigned short alpha)
}
}

void scroll_label::set_link_aware(bool l)
{
if(label* widget = get_internal_label()) {
widget->set_link_aware(l);
}
}

void scroll_label::set_self_active(const bool active)
{
state_ = active ? ENABLED : DISABLED;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/widgets/scroll_label.hpp
Expand Up @@ -71,6 +71,8 @@ class scroll_label : public scrollbar_container

void set_text_alpha(unsigned short alpha);

void set_link_aware(bool l);

private:
/**
* Possible states of the widget.
Expand Down

0 comments on commit 495c744

Please sign in to comment.