mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibGUI+ThemeEditor: Split preview-widget palette-change callback
There are two different things in ThemeEditor that want to know when a palette changes: 1. The PreviewWidget subclass, so it can update its preview. 2. The ThemeEditor itself, so we know that the palette is modified. Using a protected virtual function for 1 means that we can do 2 without them fighting over the same on_palette_change callback.
This commit is contained in:
parent
5fd0140772
commit
6c572006a3
4 changed files with 15 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021, Antonio Di Stefano <tonio9681@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
|
@ -45,6 +45,8 @@ protected:
|
|||
return *m_inactive_window_icon;
|
||||
}
|
||||
|
||||
virtual void palette_changed() {};
|
||||
|
||||
private:
|
||||
virtual void paint_preview(GUI::PaintEvent&) = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue