https://bugs.kde.org/show_bug.cgi?id=528106
Bug ID: 528106
Summary: Colors KCM scheme previews: wrapped demo text
overflows the thumbnail and overlaps the scheme name
(translated strings, default fonts)
Classification: Applications
Product: systemsettings
Version First 6.8.2
Reported In:
Platform: CachyOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: kcm_colors
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Target Milestone: ---
Created attachment 197888
--> https://bugs.kde.org/attachment.cgi?id=197888&action=edit
Screenshot: Colors page (de_DE, Breeze Union) with demo text overlapping the
scheme names
SUMMARY
In System Settings > Colors, the demo rows in each scheme preview wrap onto two
lines when the strings are translated (German). The last row spills out of the
thumbnail and overlaps the scheme name label below it.
STEPS TO REPRODUCE
1. Plasma 6.8.2, locale de_DE.UTF-8, default font (DejaVu Sans 10), widget
style Breeze (Union).
2. Open System Settings > Farben (Colors).
OBSERVED RESULT
"Normaler Text / Hervorgehobener Text / Deaktivierter Text" plus the
"Verknüpfung besucht" links wrap onto two lines. The last row ("Deaktivierter
Text ...") is drawn outside the thumbnail and on top of the scheme name (e.g.
"Breeze Dunkel").
EXPECTED RESULT
All text stays inside the thumbnail and the scheme name is not overlapped.
SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.8.2 (plasma-desktop/systemsettings 6.8.2-1.1)
Distribution: CachyOS
ADDITIONAL INFORMATION
- Identical result with classic Breeze (kcmshell6 --style Breeze kcm_colors)
and with Breeze (Union), so this is not caused by the style.
- Related: Bug 516413 (fixed in 6.6.5 by sizing the cell from fontMetrics)
handled large fonts, but not wrapping caused by long translations at the
default font size.
- Cause: the ItemDelegates in kcms/colors/ui/main.qml wrap, while
view.implicitCellHeight assumes one line per row.
- Tested fix: measure the wrapped height of the longest row and add it to
implicitCellHeight (3 rows). With English strings the extra height is 0.
Verified under both styles: all rows visible, nothing overlaps. Eliding or
clipping was rejected because it hides the link / visited colors the preview is
meant to show.
--- a/kcms/colors/ui/main.qml
+++ b/kcms/colors/ui/main.qml
@@ -55,7 +55,24 @@ KCM.GridViewKCM {
// The thumbnails are a bit more elaborate and need more room, especially
when translated
view.implicitCellWidth: Math.max(Kirigami.Units.gridUnit,
fontMetrics.averageCharacterWidth) * 15
- view.implicitCellHeight: Math.max(Kirigami.Units.gridUnit,
fontMetrics.height) * 13
+ view.implicitCellHeight: Math.max(Kirigami.Units.gridUnit,
fontMetrics.height) * 13 + previewExtraHeight
+
+ // The demo rows in the thumbnails can wrap when translated, so reserve
the height of the extra lines.
+ readonly property real previewExtraHeight: 3 * Math.max(0,
previewRowMeasure.contentHeight - fontMetrics.height)
+
+ QtControls.ItemDelegate {
+ id: previewRowPadding
+ visible: false
+ }
+
+ QtControls.Label {
+ id: previewRowMeasure
+ visible: false
+ width: view.implicitCellWidth - 2 * Kirigami.Units.smallSpacing - 2 -
previewRowPadding.leftPadding - previewRowPadding.rightPadding
+ wrapMode: Text.Wrap
+ textFormat: Text.StyledText
+ text: i18n("Highlighted text") + " <a href='#'>" + i18nc("Hyperlink",
"link") + "</a> <a href='#'>" + i18nc("Visited hyperlink", "visited") + "</a>"
+ }
--
You are receiving this mail because:
You are watching all bug changes.