raven/src/TopLevelStyles.hpp

57 lines
1.8 KiB
C++

#pragma once
#include "Forward.hpp"
#include "pango/pango-font.h"
#include "PropMacros.hpp"
#include "RGB.hpp"
namespace Raven {
class TopLevelStyles {
DEF_WIDGET_STYLE_PROP(controls_font_description, PangoFontDescription*, nullptr)
/* FIXME: */
/* right now, these colors are gruvbox */
/* however the `accent_color_darkest` is a darkened version of `accent_color_darker` */
DEF_WIDGET_STYLE_PROP(text_color, RGB, 0.0, 0.0, 0.0)
DEF_WIDGET_STYLE_PROP(accent_color, RGB, 0.6941, 0.3843, 0.5254)
DEF_WIDGET_STYLE_PROP(accent_color_darker, RGB, 0.5607, 0.2470, 0.4431)
DEF_WIDGET_STYLE_PROP(accent_color_darkest, RGB, 0.48069, 0.1669, 0.3631)
DEF_WIDGET_STYLE_PROP(background_color, RGB, 0.9764, 0.9607, 0.8431)
DEF_WIDGET_STYLE_PROP(button_text_color, RGB, m_text_color)
DEF_WIDGET_STYLE_PROP(button_normal_color, RGB, m_accent_color)
DEF_WIDGET_STYLE_PROP(button_focused_color, RGB, m_accent_color_darker)
DEF_WIDGET_STYLE_PROP(button_active_color, RGB, m_accent_color_darkest)
DEF_WIDGET_STYLE_PROP(button_border_radius, double, 8.0)
DEF_WIDGET_STYLE_PROP(label_text_color, RGB, m_text_color)
private:
Window *m_window;
public:
TopLevelStyles(Window *window)
: m_window(window)
{
PangoFontDescription *font_description = pango_font_description_new();
pango_font_description_set_family(font_description, "sans-serif");
pango_font_description_set_weight(font_description, PANGO_WEIGHT_NORMAL);
pango_font_description_set_absolute_size(font_description, 16 * PANGO_SCALE);
m_controls_font_description = font_description;
}
~TopLevelStyles() {
if (m_controls_font_description) {
pango_font_description_free(m_controls_font_description);
}
}
Window *get_window() { return m_window; }
void set_window(Window *window) { m_window = window; }
void wants_repaint();
};
}