View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0036298 | Lazarus | Widgetset | public | 2019-11-12 00:15 | 2019-11-13 07:12 |
Reporter | CudaText man | Assigned To | Juha Manninen | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Ubuntu 19 x64 | OS | OS Version | ||
Product Version | 2.1 (SVN) | Product Build | |||
Target Version | Fixed in Version | ||||
Summary | 0036298: gtk2: Listbox with OwnerDrawFixed doesn't render strikeout text on canvas | ||||
Description | Demo don't render crossed text in the listbox. But if i add more font styles (bold+italic+strikeout+underline - see commented line in demo) then crossed is rendered. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r62233 | ||||
LazTarget | - | ||||
Widgetset | GTK 2 | ||||
Attached Files |
|
|
tst-crossed-text.zip (3,331 bytes) |
|
found all occurences of "underline" in gtk2 folder, and fixed this.
s.diff (464 bytes)
Index: lcl/interfaces/gtk2/gtk2winapi.inc =================================================================== --- lcl/interfaces/gtk2/gtk2winapi.inc (revision 62230) +++ lcl/interfaces/gtk2/gtk2winapi.inc (working copy) @@ -1409,6 +1409,7 @@ (lfWeight = FW_NORMAL) and (lfItalic = 0) and (lfUnderline = 0) and + (lfStrikeOut = 0) and (lfOrientation = 0) and IsFontNameDefault(lfFacename) then begin |
|
s2.diff replaces s.diff, has additional tiny optimization (don't create 2 Pango attribs if font style is only Underline or only Crossed).
s2.diff (1,418 bytes)
Index: lcl/interfaces/gtk2/gtk2winapi.inc =================================================================== --- lcl/interfaces/gtk2/gtk2winapi.inc (revision 62230) +++ lcl/interfaces/gtk2/gtk2winapi.inc (working copy) @@ -1409,6 +1409,7 @@ (lfWeight = FW_NORMAL) and (lfItalic = 0) and (lfUnderline = 0) and + (lfStrikeOut = 0) and (lfOrientation = 0) and IsFontNameDefault(lfFacename) then begin @@ -1517,15 +1518,19 @@ AttrList := pango_attr_list_new(); AttrListTemporary := True; end; - if LogFont.lfUnderline <> 0 then - Attr := pango_attr_underline_new(PANGO_UNDERLINE_SINGLE) - else - Attr := pango_attr_underline_new(PANGO_UNDERLINE_NONE); - pango_attr_list_change(AttrList, Attr); - Attr := pango_attr_strikethrough_new(LogFont.lfStrikeOut<>0); - pango_attr_list_change(AttrList, Attr); + if LogFont.lfUnderline<>0 then + begin + Attr := pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); + pango_attr_list_change(AttrList, Attr); + end; + if LogFont.lfStrikeOut<>0 then + begin + Attr := pango_attr_strikethrough_new(True); + pango_attr_list_change(AttrList, Attr); + end; + pango_layout_set_attributes(CurFont, AttrList); if AttrListTemporary then |
|
Applied, thanks. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-11-12 00:15 | CudaText man | New Issue | |
2019-11-12 00:15 | CudaText man | File Added: tst-crossed-text.zip | |
2019-11-12 06:59 | CudaText man | File Added: s.diff | |
2019-11-12 06:59 | CudaText man | Note Added: 0119235 | |
2019-11-12 07:04 | CudaText man | File Added: s2.diff | |
2019-11-12 07:04 | CudaText man | Note Added: 0119236 | |
2019-11-12 23:37 | Juha Manninen | Assigned To | => Juha Manninen |
2019-11-12 23:37 | Juha Manninen | Status | new => assigned |
2019-11-12 23:42 | Juha Manninen | Status | assigned => resolved |
2019-11-12 23:42 | Juha Manninen | Resolution | open => fixed |
2019-11-12 23:42 | Juha Manninen | Fixed in Revision | => r62233 |
2019-11-12 23:42 | Juha Manninen | LazTarget | => - |
2019-11-12 23:42 | Juha Manninen | Widgetset | GTK 2 => GTK 2 |
2019-11-12 23:42 | Juha Manninen | Note Added: 0119246 |