Added direct theme support and will slowly move more things into this struct for configuring the look.

This commit is contained in:
Zed A. Shaw 2025-05-09 11:20:22 -04:00
parent b9deb3a0de
commit a18d60dcb0
9 changed files with 48 additions and 67 deletions

View file

@ -5,7 +5,7 @@ namespace guecs {
using std::make_shared;
UI::UI() {
$font = make_shared<sf::Font>(FONT_FILE_NAME);
$font = make_shared<sf::Font>(THEME.FONT_FILE_NAME);
}
void UI::position(int x, int y, int width, int height) {
@ -180,7 +180,7 @@ namespace guecs {
tc->text->setString(content);
} else {
auto &cell = cell_for(ent);
Textual to_set{content, TEXT_SIZE};
Textual to_set{content, THEME.TEXT_SIZE};
to_set.init(cell, $font);
set<Textual>(ent, to_set);
}
@ -214,9 +214,9 @@ namespace guecs {
tc->text->setString(content);
} else {
auto &cell = cell_for(ent);
Label to_set{content, LABEL_SIZE};
Label to_set{content, THEME.LABEL_SIZE};
to_set.init(cell, $font);
to_set.text->setFillColor(TEXT_COLOR);
to_set.text->setFillColor(THEME.TEXT_COLOR);
set<Label>(ent, to_set);
}
}