[Theme] Do a pango version check.

This commit is contained in:
Dave Davenport 2022-07-30 15:05:28 +02:00
parent 77af850200
commit 9d001aaaf7
4 changed files with 19 additions and 2 deletions

View File

@ -24,7 +24,7 @@ You can also use [Meson](https://mesonbuild.com/) as an alternative.
### External libraries
* libpango
* libpango >= 1.50
* libpangocairo
* libcairo
* libcairo-xcb

View File

@ -776,12 +776,20 @@ should be applied.
\fB\fCunderline\fR: put a line under the text.
.IP \(bu 2
\fB\fCstrikethrough\fR: put a line through the text.
.RE
.PP
The following options are available on pango 1.50.0 and up:
.RS
.IP \(bu 2
\fB\fCuppercase\fR: Uppercase the text.
.IP \(bu 2
\fB\fClowercase\fR: Lowercase the text.
.IP \(bu 2
\fB\fCcapitalize\fR: Capitalize the text.
This is currently disabled because of a Pango bug.
.RE

View File

@ -500,9 +500,13 @@ should be applied.
* `italic`: put the highlighted text in script type (slanted).
* `underline`: put a line under the text.
* `strikethrough`: put a line through the text.
The following options are available on pango 1.50.0 and up:
* `uppercase`: Uppercase the text.
* `lowercase`: Lowercase the text.
* `capitalize`: Capitalize the text.
This is currently disabled because of a Pango bug.
## Line style

View File

@ -424,6 +424,7 @@ void helper_token_match_set_pango_attr_on_style(PangoAttrList *retv, int start,
pa->end_index = end;
pango_attr_list_insert(retv, pa);
}
#if PANGO_VERSION_CHECK(1, 50, 0)
if (th.style & ROFI_HL_UPPERCASE) {
PangoAttribute *pa =
pango_attr_text_transform_new(PANGO_TEXT_TRANSFORM_UPPERCASE);
@ -439,12 +440,16 @@ void helper_token_match_set_pango_attr_on_style(PangoAttrList *retv, int start,
pango_attr_list_insert(retv, pa);
}
if (th.style & ROFI_HL_CAPITALIZE) {
#if 0
PangoAttribute *pa =
pango_attr_text_transform_new(PANGO_TEXT_TRANSFORM_CAPITALIZE);
pango_attr_text_transform_new(PANGO_TEXT_TRANSFORM_CAPITALIZE);
pa->start_index = start;
pa->end_index = end;
pango_attr_list_insert(retv, pa);
#endif
// Disabled because of bug in pango
}
#endif
if (th.style & ROFI_HL_UNDERLINE) {
PangoAttribute *pa = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
pa->start_index = start;