1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 07:17:34 +00:00

Demos/CatDog: Let the speech bubble know about the CatDog widget

This will allow us to have better interaction between CatDog's state and
what it's saying.
This commit is contained in:
kleines Filmröllchen 2022-02-26 19:34:10 +01:00 committed by Andreas Kling
parent 835e99c86c
commit 83d9a89275
2 changed files with 9 additions and 2 deletions

View file

@ -1,11 +1,14 @@
/*
* Copyright (c) 2021, Gunnar Beutner <gunnar@beutner.name>
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "CatDog.h"
#include <AK/NonnullRefPtr.h>
#include <LibGUI/Widget.h>
class SpeechBubble final : public GUI::Widget {
@ -16,7 +19,11 @@ public:
virtual void mousedown_event(GUI::MouseEvent&) override;
Function<void()> on_dismiss;
NonnullRefPtr<CatDog> m_cat_dog;
private:
SpeechBubble() = default;
SpeechBubble(NonnullRefPtr<CatDog> cat_dog)
: m_cat_dog(move(cat_dog))
{
}
};