diff --git a/Userland/Demos/CatDog/SpeechBubble.h b/Userland/Demos/CatDog/SpeechBubble.h index 9ee902f9cb..087c6c1dd7 100644 --- a/Userland/Demos/CatDog/SpeechBubble.h +++ b/Userland/Demos/CatDog/SpeechBubble.h @@ -1,11 +1,14 @@ /* * Copyright (c) 2021, Gunnar Beutner + * Copyright (c) 2022, kleines Filmröllchen * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once +#include "CatDog.h" +#include #include class SpeechBubble final : public GUI::Widget { @@ -16,7 +19,11 @@ public: virtual void mousedown_event(GUI::MouseEvent&) override; Function on_dismiss; + NonnullRefPtr m_cat_dog; private: - SpeechBubble() = default; + SpeechBubble(NonnullRefPtr cat_dog) + : m_cat_dog(move(cat_dog)) + { + } }; diff --git a/Userland/Demos/CatDog/main.cpp b/Userland/Demos/CatDog/main.cpp index 9b780e62ee..af602ea882 100644 --- a/Userland/Demos/CatDog/main.cpp +++ b/Userland/Demos/CatDog/main.cpp @@ -58,7 +58,7 @@ ErrorOr serenity_main(Main::Arguments arguments) advice_window->set_has_alpha_channel(true); advice_window->set_alpha_hit_threshold(1.0f); - auto advice_widget = TRY(advice_window->try_set_main_widget()); + auto advice_widget = TRY(advice_window->try_set_main_widget(catdog_widget)); (void)TRY(advice_widget->try_set_layout()); advice_widget->layout()->set_spacing(0);