groupbars: add text color opt

This commit is contained in:
vaxerski 2023-05-27 17:45:56 +02:00
parent 74b49de883
commit 078ba6daa8
2 changed files with 5 additions and 1 deletions

View file

@ -97,6 +97,7 @@ void CConfigManager::setDefaultVars() {
configValues["misc:render_titles_in_groupbar"].intValue = 1;
configValues["misc:groupbar_titles_font_size"].intValue = 8;
configValues["misc:groupbar_gradients"].intValue = 1;
configValues["misc:groupbar_text_color"].intValue = 0xffffffff;
configValues["debug:int"].intValue = 0;
configValues["debug:log_damage"].intValue = 0;

View file

@ -201,6 +201,9 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) {
const auto CAIRO = cairo_create(CAIROSURFACE);
static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("misc:groupbar_titles_font_size")->intValue;
static auto* const PTEXTCOLOR = &g_pConfigManager->getConfigValuePtr("misc:groupbar_text_color")->intValue;
const CColor COLOR = CColor(*PTEXTCOLOR);
// clear the pixmap
cairo_save(CAIRO);
@ -222,7 +225,7 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) {
pango_layout_set_width(layout, maxWidth * PANGO_SCALE);
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
cairo_set_source_rgba(CAIRO, 1.f, 1.f, 1.f, 1.f);
cairo_set_source_rgba(CAIRO, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
int layoutWidth, layoutHeight;
pango_layout_get_size(layout, &layoutWidth, &layoutHeight);