1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

ThemeEditor: Make MainWidget responsible for holding the edited Palette

Previously, the PreviewWidget was responsible for this, but we will soon
have multiple preview widgets, so having it here will make more sense.
This commit is contained in:
Sam Atkins 2022-05-10 16:10:15 +01:00 committed by Andreas Kling
parent 48122e29c3
commit f617d72bee
3 changed files with 52 additions and 45 deletions

View file

@ -85,11 +85,11 @@ public:
ErrorOr<void> initialize_menubar(GUI::Window&);
GUI::Window::CloseRequestDecision request_close();
void update_title();
void load_from_file(Core::File&);
private:
explicit MainWidget(Optional<String> path, Gfx::Palette startup_preview_palette);
MainWidget();
void load_from_file(String const& path);
void save_to_file(Core::File&);
void set_path(String);
@ -100,6 +100,8 @@ private:
void set_metric(Gfx::MetricRole, int);
void set_path(Gfx::PathRole, String);
void set_palette(Gfx::Palette);
enum class PathPickerTarget {
File,
Folder,
@ -111,6 +113,7 @@ private:
RefPtr<GUI::Action> m_save_action;
Optional<String> m_path;
Gfx::Palette m_current_palette;
Time m_last_modified_time { Time::now_monotonic() };
RefPtr<AlignmentModel> m_alignment_model;