/* * Copyright (c) 2020, Andreas Kling * Copyright (c) 2021-2022, Sam Atkins * Copyright (c) 2021, Antonio Di Stefano * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include namespace ThemeEditor { class MiniWidgetGallery; class PreviewWidget final : public GUI::AbstractThemePreview , public GUI::ColorFilterer { C_OBJECT_ABSTRACT(PreviewWidget); public: static ErrorOr> try_create(); virtual ~PreviewWidget() override = default; virtual void set_color_filter(OwnPtr) override; private: PreviewWidget(); virtual void paint_preview(GUI::PaintEvent&) override; virtual void second_paint_event(GUI::PaintEvent&) override; virtual void resize_event(GUI::ResizeEvent&) override; virtual void palette_changed() override; void paint_hightlight_window(); void update_preview_window_locations(); Gfx::IntRect m_active_window_rect; Gfx::IntRect m_inactive_window_rect; Gfx::IntRect m_highlight_window_rect; OwnPtr m_color_filter = nullptr; RefPtr m_gallery; }; }