Tried to overlay/replace the install button with the progress bar,

but that doesn't work properly at this stage. Auria, any ideas?


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7414 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-14 06:13:20 +00:00
parent 70be2dc965
commit 0fb5f93453
3 changed files with 14 additions and 25 deletions

View File

@ -6,17 +6,17 @@
<div width="50%" height="100%" layout="vertical-row" >
<icon id="icon" align="center" proportion="8" width="100%" icon="gui/loading.png"/>
<spacer proportion="1" />
<button id="install" width="70%" I18N="Addons" text="Install" align="center"/>
</div>
<spacer proportion="1" />
<div width="50%" height="100%" layout="vertical-row" >
<label word_wrap="true" id="description" width="100%" text="Description:" proportion="1" />
<label id="version" width="100%" text="Version:" proportion="1" />
<spacer proportion="1" />
<button id="cancel" width="70%" I18N="Addons" text="Back" align="center"/>
</div>
</div>
<spacer proportion="1" />
<progressbar id="progress" width="100%" height="35"/>
<button id="install" x="5%" y="85%" width="70%" I18N="Addons" text="Install" align="center"/>
<progressbar id="progress" x="5%" y="85%" width="70%" height="5%" />
<spacer proportion="1" />
<button id="cancel" x="5%" width="70%" I18N="Addons" text="Back" align="center"/>
<label id="state" x="5%" text="Status" proportion="1" />
</div>
</stkgui>

View File

@ -45,8 +45,9 @@ AddonsLoading::AddonsLoading(const float w, const float h,
m_icon_shown = false;
/*Init the icon here to be able to load a single image*/
m_icon = getWidget<IconButtonWidget>("icon");
m_progress = getWidget<ProgressBarWidget>("progress");
m_icon = getWidget<IconButtonWidget> ("icon" );
m_progress = getWidget<ProgressBarWidget>("progress");
m_install_button = getWidget<ButtonWidget> ("install" );
if(m_progress)
m_progress->setVisible(false);
@ -90,21 +91,11 @@ GUIEngine::EventPropagation
{
m_progress->setValue(0);
m_progress->setVisible(true);
/*This widget will show some text as "downloading..." or "installing".*/
m_state = new LabelWidget();
m_state->m_properties[PROP_TEXT_ALIGN] = "center";
/* Center the widget*/
m_state->m_x = 10;
m_state->m_y = getHeight()-125;
m_state->m_w = getWidth() - 20;
m_state->m_h = 35;
m_state->setParent(m_irrlicht_window);
m_widgets.push_back(m_state);
m_state->add();
getWidget<ButtonWidget>("install")->setDeactivated();
//m_progress->m_h = m_install_button->m_h;
//m_progress->m_x = m_install_button->m_x;
//m_progress->m_y = m_install_button->m_y;
//m_progress->m_w = m_install_button->m_w;
m_install_button->setVisible(false);
startDownload();
}
else // uninstall

View File

@ -33,14 +33,12 @@ class AddonsLoading : public GUIEngine::ModalDialog
{
//virtual void escapePressed() {};
private:
GUIEngine::LabelWidget *m_author;
GUIEngine::LabelWidget *m_state;
GUIEngine::ProgressBarWidget *m_progress;
GUIEngine::ButtonWidget *m_back_button;
GUIEngine::ButtonWidget *m_install_button;
GUIEngine::IconButtonWidget *m_icon;
GUIEngine::IconButtonWidget *m_next;
GUIEngine::IconButtonWidget *m_previous;
/** The addon to load. */
Addon m_addon;