2021-08-19 15:00:44 +02:00
|
|
|
#ifndef BWIDGETS_FONT_HANDLER_IMPL_HPP
|
|
|
|
#define BWIDGETS_FONT_HANDLER_IMPL_HPP
|
|
|
|
|
|
|
|
#include <basic_widgets/w/feat/font_handler.hpp>
|
|
|
|
|
|
|
|
namespace bwidgets
|
|
|
|
{
|
|
|
|
class FontHandlerImpl : public virtual FontHandler
|
|
|
|
{
|
|
|
|
public:
|
2022-02-01 20:48:54 +01:00
|
|
|
[[nodiscard]] auto font() const -> const std::shared_ptr<Font>& override;
|
|
|
|
void font(std::shared_ptr<Font>) override;
|
|
|
|
[[nodiscard]] auto font_color_bg() const -> const Color& override;
|
|
|
|
void font_color_bg(const Color&) override;
|
|
|
|
[[nodiscard]] auto font_color_fg() const -> const Color& override;
|
|
|
|
void font_color_fg(const Color&) override;
|
2021-08-19 15:00:44 +02:00
|
|
|
|
|
|
|
protected:
|
2022-02-01 20:48:54 +01:00
|
|
|
// Called on font changes.
|
|
|
|
virtual void _handle_font_change(const std::shared_ptr<Font>&) = 0;
|
|
|
|
// Called on font color changes.
|
|
|
|
virtual void _handle_font_color_change(const Color&, const Color&) = 0;
|
|
|
|
|
|
|
|
private:
|
2021-08-19 15:00:44 +02:00
|
|
|
std::shared_ptr<Font> _font;
|
|
|
|
Color _font_color_bg = default_font_color_bg;
|
|
|
|
Color _font_color_fg = default_font_color_fg;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|