2022-03-18 02:49:16 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Forward.hpp"
|
|
|
|
#include "pango/pango-font.h"
|
2022-03-18 03:04:34 +02:00
|
|
|
#include "PropMacros.hpp"
|
2022-03-18 02:58:34 +02:00
|
|
|
#include "RGB.hpp"
|
2022-03-18 02:49:16 +02:00
|
|
|
|
|
|
|
namespace Raven {
|
|
|
|
|
|
|
|
class TopLevelStyles {
|
2022-03-19 19:01:51 +02:00
|
|
|
DEF_WIDGET_STYLE_PROP(controls_font_description, PangoFontDescription*, nullptr)
|
2022-03-18 02:49:16 +02:00
|
|
|
|
2022-03-20 02:47:15 +02:00
|
|
|
/* FIXME: */
|
|
|
|
/* right now, these colors are gruvbox */
|
|
|
|
/* however the `accent_color_darkest` is a darkened version of `accent_color_darker` */
|
2022-03-19 19:01:51 +02:00
|
|
|
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)
|
2022-03-20 02:47:15 +02:00
|
|
|
DEF_WIDGET_STYLE_PROP(accent_color_darkest, RGB, 0.48069, 0.1669, 0.3631)
|
2022-03-19 19:01:51 +02:00
|
|
|
DEF_WIDGET_STYLE_PROP(background_color, RGB, 0.9764, 0.9607, 0.8431)
|
2022-03-18 02:58:34 +02:00
|
|
|
|
2022-03-20 02:47:15 +02:00
|
|
|
DEF_WIDGET_STYLE_PROP(button_text_color, RGB, m_text_color)
|
2022-03-19 19:01:51 +02:00
|
|
|
DEF_WIDGET_STYLE_PROP(button_normal_color, RGB, m_accent_color)
|
|
|
|
DEF_WIDGET_STYLE_PROP(button_focused_color, RGB, m_accent_color_darker)
|
2022-03-20 02:47:15 +02:00
|
|
|
DEF_WIDGET_STYLE_PROP(button_active_color, RGB, m_accent_color_darkest)
|
|
|
|
DEF_WIDGET_STYLE_PROP(button_border_radius, double, 8.0)
|
2022-03-18 02:58:34 +02:00
|
|
|
|
2022-03-26 02:57:41 +02:00
|
|
|
DEF_WIDGET_STYLE_PROP(label_text_color, RGB, m_text_color)
|
|
|
|
|
2022-03-18 02:49:16 +02:00
|
|
|
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);
|
|
|
|
|
2022-03-18 03:04:34 +02:00
|
|
|
m_controls_font_description = font_description;
|
2022-03-18 02:49:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
~TopLevelStyles() {
|
2022-03-18 03:04:34 +02:00
|
|
|
if (m_controls_font_description) {
|
|
|
|
pango_font_description_free(m_controls_font_description);
|
2022-03-18 02:49:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Window *get_window() { return m_window; }
|
|
|
|
void set_window(Window *window) { m_window = window; }
|
|
|
|
|
|
|
|
void wants_repaint();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|