groupbar: Add options for setting group bar title font weight (and indicator gap) (#9617)
This commit is contained in:
parent
a9549dbca0
commit
be6268a7ec
7 changed files with 134 additions and 43 deletions
|
|
@ -2714,7 +2714,7 @@ SP<CTexture> CHyprOpenGLImpl::loadAsset(const std::string& filename) {
|
|||
return tex;
|
||||
}
|
||||
|
||||
SP<CTexture> CHyprOpenGLImpl::renderText(const std::string& text, CHyprColor col, int pt, bool italic, const std::string& fontFamily, int maxWidth) {
|
||||
SP<CTexture> CHyprOpenGLImpl::renderText(const std::string& text, CHyprColor col, int pt, bool italic, const std::string& fontFamily, int maxWidth, int weight) {
|
||||
SP<CTexture> tex = makeShared<CTexture>();
|
||||
|
||||
static auto FONT = CConfigValue<std::string>("misc:font_family");
|
||||
|
|
@ -2732,7 +2732,7 @@ SP<CTexture> CHyprOpenGLImpl::renderText(const std::string& text, CHyprColor col
|
|||
pango_font_description_set_family_static(pangoFD, FONTFAMILY.c_str());
|
||||
pango_font_description_set_absolute_size(pangoFD, FONTSIZE * PANGO_SCALE);
|
||||
pango_font_description_set_style(pangoFD, italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
|
||||
pango_font_description_set_weight(pangoFD, PANGO_WEIGHT_NORMAL);
|
||||
pango_font_description_set_weight(pangoFD, static_cast<PangoWeight>(weight));
|
||||
pango_layout_set_font_description(layoutText, pangoFD);
|
||||
|
||||
cairo_set_source_rgba(CAIRO, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
|
||||
|
|
@ -2763,7 +2763,7 @@ SP<CTexture> CHyprOpenGLImpl::renderText(const std::string& text, CHyprColor col
|
|||
pango_font_description_set_family_static(pangoFD, FONTFAMILY.c_str());
|
||||
pango_font_description_set_absolute_size(pangoFD, FONTSIZE * PANGO_SCALE);
|
||||
pango_font_description_set_style(pangoFD, italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
|
||||
pango_font_description_set_weight(pangoFD, PANGO_WEIGHT_NORMAL);
|
||||
pango_font_description_set_weight(pangoFD, static_cast<PangoWeight>(weight));
|
||||
pango_layout_set_font_description(layoutText, pangoFD);
|
||||
pango_layout_set_text(layoutText, text.c_str(), -1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue