From 3ca0af8bb3dfd7c67320a842db8eabe198058bd6 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Mon, 21 Jan 2019 09:20:16 -0700 Subject: Add fade out effect to the loading screen --- src/yuzu/loading_screen.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/yuzu/loading_screen.h') diff --git a/src/yuzu/loading_screen.h b/src/yuzu/loading_screen.h index 9370ede69..091e58eb7 100644 --- a/src/yuzu/loading_screen.h +++ b/src/yuzu/loading_screen.h @@ -27,7 +27,9 @@ enum class LoadCallbackStage; class QBuffer; class QByteArray; +class QGraphicsOpacityEffect; class QMovie; +class QPropertyAnimation; class LoadingScreen : public QWidget { Q_OBJECT @@ -45,14 +47,21 @@ public: /// used resources such as the logo and banner. void Clear(); + /// Slot used to update the status of the progress bar void OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total); + /// Hides the LoadingScreen with a fade out effect + void OnLoadComplete(); + // In order to use a custom widget with a stylesheet, you need to override the paintEvent // See https://wiki.qt.io/How_to_Change_the_Background_Color_of_QWidget void paintEvent(QPaintEvent* event) override; signals: void LoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total); + /// Signals that this widget is completely hidden now and should be replaced with the other + /// widget + void Hidden(); private: #ifndef YUZU_QT_MOVIE_MISSING @@ -64,6 +73,9 @@ private: std::size_t previous_total = 0; VideoCore::LoadCallbackStage previous_stage; + QGraphicsOpacityEffect* opacity_effect = nullptr; + std::unique_ptr fadeout_animation = nullptr; + // Definitions for the differences in text and styling for each stage std::unordered_map progressbar_style; std::unordered_map stage_translations; -- cgit v1.2.3