From e5921ffd64d45ee89371c0f14f0ce14b1cfa16f3 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 15 Jun 2014 19:28:57 +0200 Subject: [PATCH] Activate the driver when getting a show event, and clear the GUI Editor display widget when there's no GUI loaded. --HG-- branch : gsoc2014-dfighter --- code/studio/src/plugins/gui_editor/nel3d_widget.cpp | 7 +++++++ code/studio/src/plugins/gui_editor/nel3d_widget.h | 2 ++ code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/code/studio/src/plugins/gui_editor/nel3d_widget.cpp b/code/studio/src/plugins/gui_editor/nel3d_widget.cpp index 5be8bacb8..1e030db25 100644 --- a/code/studio/src/plugins/gui_editor/nel3d_widget.cpp +++ b/code/studio/src/plugins/gui_editor/nel3d_widget.cpp @@ -102,6 +102,13 @@ namespace GUIEditor driver->swapBuffers(); } + void Nel3DWidget::showEvent( QShowEvent *evnt ) + { + QWidget::showEvent( evnt ); + + if( driver != NULL ) + driver->activate(); + } #if defined ( NL_OS_WINDOWS ) diff --git a/code/studio/src/plugins/gui_editor/nel3d_widget.h b/code/studio/src/plugins/gui_editor/nel3d_widget.h index 07a74b8c3..e2d5f00b6 100644 --- a/code/studio/src/plugins/gui_editor/nel3d_widget.h +++ b/code/studio/src/plugins/gui_editor/nel3d_widget.h @@ -55,6 +55,8 @@ namespace GUIEditor protected: + void showEvent( QShowEvent *evnt ); + #if defined(NL_OS_WINDOWS) virtual bool winEvent( MSG *message, long *result ); #elif defined(NL_OS_MAC) diff --git a/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp index 4e72ba614..72bb9524f 100644 --- a/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp +++ b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp @@ -153,6 +153,10 @@ namespace GUIEditor w->getDriver()->EventServer.pump(); draw(); } + else + { + w->clear(); + } } }