From 495c744cf15764943fc50cd8e575798d2b6245d6 Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Fri, 5 May 2017 23:57:03 +0300 Subject: [PATCH] Mark credits label as link-unaware This significantly speeds up opening the credits screen. --- src/gui/dialogs/end_credits.cpp | 1 + src/gui/widgets/scroll_label.cpp | 7 +++++++ src/gui/widgets/scroll_label.hpp | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/gui/dialogs/end_credits.cpp b/src/gui/dialogs/end_credits.cpp index ab7aa9268efd..00dfaad50980 100644 --- a/src/gui/dialogs/end_credits.cpp +++ b/src/gui/dialogs/end_credits.cpp @@ -125,6 +125,7 @@ void end_credits::pre_show(window& window) text_widget_ = find_widget(&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. diff --git a/src/gui/widgets/scroll_label.cpp b/src/gui/widgets/scroll_label.cpp index 1c0e84ee22a7..ea3d6202d769 100644 --- a/src/gui/widgets/scroll_label.cpp +++ b/src/gui/widgets/scroll_label.cpp @@ -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; diff --git a/src/gui/widgets/scroll_label.hpp b/src/gui/widgets/scroll_label.hpp index 820b26cf071a..e5253b5d18ca 100644 --- a/src/gui/widgets/scroll_label.hpp +++ b/src/gui/widgets/scroll_label.hpp @@ -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.