mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 14:44:57 +00:00

This allows most of the theme preview code to be reused by similar theme preview widgets.
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
|
* Copyright (c) 2021, Antonio Di Stefano <tonio9681@gmail.com>
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGUI/AbstractThemePreview.h>
|
|
#include <LibGUI/Frame.h>
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <LibGfx/Filters/ColorBlindnessFilter.h>
|
|
#include <LibGfx/Palette.h>
|
|
|
|
namespace ThemeEditor {
|
|
|
|
class MiniWidgetGallery;
|
|
|
|
class PreviewWidget final : public GUI::AbstractThemePreview {
|
|
C_OBJECT(PreviewWidget);
|
|
|
|
public:
|
|
virtual ~PreviewWidget() override = default;
|
|
|
|
void set_color_filter(OwnPtr<Gfx::ColorBlindnessFilter>);
|
|
|
|
private:
|
|
explicit PreviewWidget(Gfx::Palette const&);
|
|
|
|
virtual void paint_preview(GUI::PaintEvent&) override;
|
|
virtual void second_paint_event(GUI::PaintEvent&) override;
|
|
virtual void resize_event(GUI::ResizeEvent&) override;
|
|
virtual void drop_event(GUI::DropEvent&) override;
|
|
|
|
OwnPtr<Gfx::ColorBlindnessFilter> m_color_filter = nullptr;
|
|
RefPtr<MiniWidgetGallery> m_gallery;
|
|
};
|
|
|
|
}
|