mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 12:37:41 +03:00
chore: structured src/gui, run clang-format
This commit is contained in:
38
src/gui/controllers/palette_controller.hpp
Normal file
38
src/gui/controllers/palette_controller.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef CLRSYNC_GUI_PALETTE_CONTROLLER_HPP
|
||||
#define CLRSYNC_GUI_PALETTE_CONTROLLER_HPP
|
||||
|
||||
#include "core/io/toml_file.hpp"
|
||||
#include "core/palette/palette_manager.hpp"
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
class palette_controller
|
||||
{
|
||||
public:
|
||||
palette_controller();
|
||||
|
||||
const clrsync::core::palette ¤t_palette() const
|
||||
{
|
||||
return m_current_palette;
|
||||
}
|
||||
const std::unordered_map<std::string, clrsync::core::palette> &palettes() const
|
||||
{
|
||||
return m_palettes;
|
||||
}
|
||||
|
||||
void select_palette(const std::string &name);
|
||||
void create_palette(const std::string &name);
|
||||
void save_current_palette();
|
||||
void delete_current_palette();
|
||||
void apply_current_theme() const;
|
||||
void set_color(const std::string &key, const clrsync::core::color &color);
|
||||
|
||||
private:
|
||||
void reload_palettes();
|
||||
|
||||
clrsync::core::palette_manager<clrsync::core::io::toml_file> m_palette_manager;
|
||||
std::unordered_map<std::string, clrsync::core::palette> m_palettes;
|
||||
clrsync::core::palette m_current_palette;
|
||||
};
|
||||
|
||||
#endif // CLRSYNC_GUI_PALETTE_CONTROLLER_HPP
|
||||
Reference in New Issue
Block a user