Skip to content

Commit

Permalink
Fixed: UI resizing in busy mode
Browse files Browse the repository at this point in the history
BusyWidget was not handled viewResized events.
  • Loading branch information
skyjake committed Mar 6, 2013
1 parent cdac8d8 commit 256e1f4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions doomsday/client/include/ui/busywidget.h
Expand Up @@ -30,6 +30,7 @@ class BusyWidget : public GuiWidget
BusyWidget(de::String const &name = "");
~BusyWidget();

void viewResized();
void update();
void draw();
bool handleEvent(de::Event const &event);
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/include/ui/ui_main.h
Expand Up @@ -23,6 +23,7 @@
#define LIBDENG_UI_MAIN_H

#include <de/rect.h>
#include "dd_input.h" // ddevent_t
#include "MaterialVariantSpec"

#ifdef __cplusplus
Expand Down
28 changes: 28 additions & 0 deletions doomsday/client/src/ui/busywidget.cpp
Expand Up @@ -19,6 +19,12 @@
#include "ui/busywidget.h"
#include "ui/busyvisual.h"
#include "busymode.h"
#include "sys_system.h"
#include "render/r_main.h"
#include "ui/ui_main.h"
#include "ui/window.h"

#include <de/RootWidget>

using namespace de;

Expand All @@ -38,6 +44,28 @@ BusyWidget::~BusyWidget()
delete d;
}

void BusyWidget::viewResized()
{
if(!BusyMode_Active() || isDisabled() || Sys_IsShuttingDown()) return;

Window_GLActivate(Window_Main()); // needed for legacy stuff

//DENG_ASSERT(BusyMode_Active());

LOG_AS("BusyWidget");
LOG_DEBUG("View resized to ") << root().viewSize().asText();

// Update viewports.
R_SetViewGrid(0, 0);
R_UseViewPort(0);
R_LoadSystemFonts();

if(UI_IsActive())
{
UI_UpdatePageLayout();
}
}

void BusyWidget::update()
{
DENG_ASSERT(BusyMode_Active());
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/ui/legacywidget.cpp
Expand Up @@ -63,14 +63,14 @@ LegacyWidget::~LegacyWidget()

void LegacyWidget::viewResized()
{
if(isDisabled() || Sys_IsShuttingDown()) return;
if(BusyMode_Active() || isDisabled() || Sys_IsShuttingDown()) return;

LOG_AS("LegacyWidget");
LOG_DEBUG("View resized to ") << root().viewSize().asText();

// Update viewports.
R_SetViewGrid(0, 0);
if(BusyMode_Active() || UI_IsActive() || !App_GameLoaded())
if(/*BusyMode_Active() ||*/ UI_IsActive() || !App_GameLoaded())
{
// Update for busy mode.
R_UseViewPort(0);
Expand Down

0 comments on commit 256e1f4

Please sign in to comment.