From 1ba9c8f6e735c1aa72200d37ded313a7adbc5591 Mon Sep 17 00:00:00 2001 From: auria Date: Wed, 30 Mar 2011 13:35:10 +0000 Subject: [PATCH] Fix label scrolling git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8117 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/guiengine/widgets/label_widget.cpp | 3 ++- src/states_screens/main_menu_screen.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/guiengine/widgets/label_widget.cpp b/src/guiengine/widgets/label_widget.cpp index 653fdac4f..f60ee7c77 100644 --- a/src/guiengine/widgets/label_widget.cpp +++ b/src/guiengine/widgets/label_widget.cpp @@ -38,6 +38,7 @@ LabelWidget::LabelWidget(bool title, bool bright) : Widget(WTYPE_LABEL) m_title_font = title; m_has_color = false; m_scroll_speed = 0; + m_scroll_offset = 0; if (bright) { @@ -61,7 +62,7 @@ void LabelWidget::add() EGUI_ALIGNMENT valign = EGUIA_CENTER ; //TODO: make label v-align configurable through XML file? IGUIStaticText* irrwidget; - if (m_scroll_offset) + if (m_scroll_speed != 0) { IGUIElement* container = GUIEngine::getGUIEnv()->addButton(widget_size, m_parent, -1); irrwidget = GUIEngine::getGUIEnv()->addStaticText(message.c_str(), core::rect( core::position2di(0,0), widget_size.getSize()), diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index c48aef4e1..09e549408 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -70,6 +70,9 @@ void MainMenuScreen::loadedFromFile() RibbonWidget* r = this->getWidget("menu_toprow"); if (r != NULL) r->deleteChild("addons"); #endif + + LabelWidget* w = this->getWidget("info_addons"); + w->setScrollSpeed(15); } // ------------------------------------------------------------------------------------------------------ @@ -104,9 +107,6 @@ void MainMenuScreen::init() w->setDeactivated(); } #endif - LabelWidget* w = this->getWidget("info_addons"); - w->setScrollSpeed(15); - } // ------------------------------------------------------------------------------------------------------