Horizon
Loading...
Searching...
No Matches
preferences_window_canvas.hpp
1#pragma once
2#include <gtkmm.h>
3#include "preferences/preferences.hpp"
4#include "nlohmann/json.hpp"
5
6namespace horizon {
7using json = nlohmann::json;
8class CanvasPreferencesEditor : public Gtk::Box {
9public:
10 CanvasPreferencesEditor(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class Preferences &prefs,
11 bool layered);
12 static CanvasPreferencesEditor *create(Preferences &prefs, bool layered);
13
14private:
15 Preferences &preferences;
16 CanvasPreferences &canvas_preferences;
17 const bool is_layered;
18 json color_presets;
19 Gtk::FlowBox *canvas_colors_fb = nullptr;
20 Glib::RefPtr<Gtk::ColorChooser> color_chooser;
21 sigc::connection color_chooser_conn;
22 void handle_export();
23 void handle_import();
24 void handle_default();
25 void handle_load_preset(unsigned int idx);
26 void load_colors(const json &j);
27 void update_color_chooser();
28};
29
30
31} // namespace horizon
Definition preferences_window_canvas.hpp:8
Definition preferences.hpp:16
Definition preferences.hpp:167
a class to store JSON values
Definition json.hpp:177
basic_json<> json
default JSON class
Definition json_fwd.hpp:62