[plasma/libplasma] /: Use Wrap instead of WordWrap everywhere

Nate Graham <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 41b9c32dbf1825b14c3467131d3b307c431fa252 by Nate Graham.
Committed on 29/07/2026 at 18:39.
Pushed by ngraham into branch 'master'.

Use Wrap instead of WordWrap everywhere

WordWrap has a fatal flaw: if a word is ever longer than the maximum
width, that word will overflow. This is almost never what anyone wants,
so WordWrap must only be used in very specialized situations.

Change everything to use Wrap so this doesn't happen in any of the
general cases that this library handles; it's always a better default.

qqc2-desktop-style already does the same, so there's precedent, too.

BUG: 523614
FIXED-IN: 6.6.7

M  +2    -2    examples/applets/widgetgallery/contents/ui/Texts.qml
M  +1    -1    src/declarativeimports/core/private/DefaultToolTip.qml
M  +1    -1    src/declarativeimports/plasmacomponents3/ToolTip.qml
M  +1    -1    src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml
M  +1    -1    src/declarativeimports/plasmaextracomponents/qml/Heading.qml
M  +3    -3    tests/components/busyindicator3.qml
M  +8    -8    tests/components/progressbar3.qml
M  +1    -1    tests/dialog_fullscreen.qml
M  +1    -1    tests/dialog_minWidthHeightRepositioning.qml
M  +1    -1    tests/dialog_positioning.qml
M  +1    -1    tests/dialog_positioning2.qml
M  +1    -1    tests/dialog_positioning_parentrotated.qml
M  +1    -1    tests/dialog_sizeMoreThanMin.qml
M  +1    -1    tests/dialog_tooltip.qml
M  +1    -1    tests/dialog_visualParentChange.qml

https://invent.kde.org/plasma/libplasma/-/commit/41b9c32dbf1825b14c3467131d3b307c431fa252

diff --git a/examples/applets/widgetgallery/contents/ui/Texts.qml b/examples/applets/widgetgallery/contents/ui/Texts.qml
index fa0d11d8a..488bf8e28 100644
--- a/examples/applets/widgetgallery/contents/ui/Texts.qml
+++ b/examples/applets/widgetgallery/contents/ui/Texts.qml
@@ -109,7 +109,7 @@ PlasmaComponents.Page {
                     width: 200
                     height: 200
                     placeholderText: "Lorem ipsum et dolor"
-                    wrapMode: TextEdit.WordWrap
+                    wrapMode: TextEdit.Wrap
                     contentMaxWidth: 400
                     contentMaxHeight: 400
                 }
@@ -118,7 +118,7 @@ PlasmaComponents.Page {
                     width: 200
                     height: 100
                     enabled: false
-                    wrapMode: TextEdit.WordWrap
+                    wrapMode: TextEdit.Wrap
                     text: "Disabled Text Area"
                 }
             }
diff --git a/src/declarativeimports/core/private/DefaultToolTip.qml b/src/declarativeimports/core/private/DefaultToolTip.qml
index baf0ef9af..b4d34e8e4 100644
--- a/src/declarativeimports/core/private/DefaultToolTip.qml
+++ b/src/declarativeimports/core/private/DefaultToolTip.qml
@@ -64,7 +64,7 @@ Item {
 
             PlasmaComponents.Label {
                 Layout.fillWidth: true
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 text: root.toolTip ? root.toolTip.subText : ""
                 textFormat: root.toolTip ? root.toolTip.textFormat : Text.AutoText
                 opacity: 0.75
diff --git a/src/declarativeimports/plasmacomponents3/ToolTip.qml b/src/declarativeimports/plasmacomponents3/ToolTip.qml
index 473315167..5706956dc 100644
--- a/src/declarativeimports/plasmacomponents3/ToolTip.qml
+++ b/src/declarativeimports/plasmacomponents3/ToolTip.qml
@@ -75,7 +75,7 @@ T.ToolTip {
             // Strip out ampersands right before non-whitespace characters, i.e.
             // those used to determine the alt key shortcut
             text: control.text.replace(/&(?=\S)/g, "")
-            wrapMode: Text.WordWrap
+            wrapMode: Text.Wrap
             font: control.font
 
             Kirigami.Theme.colorSet: Kirigami.Theme.Tooltip
diff --git a/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml b/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml
index 893654e0f..168c4f6f5 100644
--- a/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml
+++ b/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml
@@ -547,7 +547,7 @@ Item {
                         textFormat: listItem.allowStyledText ? Text.StyledText : Text.PlainText
                         elide: Text.ElideRight
                         maximumLineCount: listItem.subtitleCanWrap ? (listItem.subtitleMaximumLineCount === -1 ? undefined : listItem.subtitleMaximumLineCount) : 1
-                        wrapMode: listItem.subtitleCanWrap ? Text.WordWrap : Text.NoWrap
+                        wrapMode: listItem.subtitleCanWrap ? Text.Wrap : Text.NoWrap
                     }
                 }
 
diff --git a/src/declarativeimports/plasmaextracomponents/qml/Heading.qml b/src/declarativeimports/plasmaextracomponents/qml/Heading.qml
index 4ac662743..54a9c1697 100644
--- a/src/declarativeimports/plasmaextracomponents/qml/Heading.qml
+++ b/src/declarativeimports/plasmaextracomponents/qml/Heading.qml
@@ -68,7 +68,7 @@ Label {
 
     font.pointSize: __headerPointSize(level)
     font.weight: type === Heading.Type.Primary ? Font.DemiBold : Font.Normal
-    wrapMode: Text.WordWrap
+    wrapMode: Text.Wrap
 
     opacity: type === Heading.Type.Secondary ? 0.75 : 1
 
diff --git a/tests/components/busyindicator3.qml b/tests/components/busyindicator3.qml
index 1d93481ef..e12880cce 100644
--- a/tests/components/busyindicator3.qml
+++ b/tests/components/busyindicator3.qml
@@ -15,7 +15,7 @@ ComponentBase {
         spacing: Kirigami.Units.gridUnit
 
         PlasmaComponents.Label {
-            wrapMode: Text.WordWrap
+            wrapMode: Text.Wrap
             text: "The BusyIndicator should have a height of 16px and should have a 1:1 aspect ratio"
             Layout.preferredWidth: Math.max(busyIndicatorLayout.width, root.implicitHeaderWidth)
         }
@@ -24,14 +24,14 @@ ComponentBase {
         }
 
         PlasmaComponents.Label {
-            wrapMode: Text.WordWrap
+            wrapMode: Text.Wrap
             text: "The BusyIndicator should use its implicit size."
             Layout.preferredWidth: Math.max(busyIndicatorLayout.width, root.implicitHeaderWidth)
         }
         PlasmaComponents.BusyIndicator {}
 
         PlasmaComponents.Label {
-            wrapMode: Text.WordWrap
+            wrapMode: Text.Wrap
             text: "The BusyIndicator should maintain a 1:1 aspect ratio, disappear when unchecked and restart when checked."
             Layout.preferredWidth: Math.max(busyIndicatorLayout.width, root.implicitHeaderWidth)
         }
diff --git a/tests/components/progressbar3.qml b/tests/components/progressbar3.qml
index 6421da071..4d6838606 100644
--- a/tests/components/progressbar3.qml
+++ b/tests/components/progressbar3.qml
@@ -60,7 +60,7 @@ ComponentBase {
             PlasmaComponents.Label {
                 id: progressBarAndSliderLabel
                 text: "The progress bar and slider grooves should have the same visual width."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             GridLayout {
@@ -86,7 +86,7 @@ ComponentBase {
         ColumnLayout {
             PlasmaComponents.Label {
                 text: "Min: 0; Max: 200; Value: 1\nMake sure the bar does not leak outside."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             PlasmaComponents.ProgressBar {
@@ -99,7 +99,7 @@ ComponentBase {
         ColumnLayout {
             PlasmaComponents.Label {
                 text: "Min: 0; Max: 100; Value: 110\nThe progress bar should look like it is at 100%."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             PlasmaComponents.ProgressBar {
@@ -112,7 +112,7 @@ ComponentBase {
         ColumnLayout {
             PlasmaComponents.Label {
                 text: "Min: -100; Max: 100; Value: 0\nThe progress bar should look like it is at 50%."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             PlasmaComponents.ProgressBar {
@@ -125,7 +125,7 @@ ComponentBase {
         ColumnLayout {
             PlasmaComponents.Label {
                 text: "Min: 0; Max: 100; Value: -10\nThe progress bar should look like it is at 0%."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             PlasmaComponents.ProgressBar {
@@ -138,7 +138,7 @@ ComponentBase {
         ColumnLayout {
             PlasmaComponents.Label {
                 text: "This should have a continuous movement from one end to the other and back."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             PlasmaComponents.ProgressBar {
@@ -150,7 +150,7 @@ ComponentBase {
         ColumnLayout {
             PlasmaComponents.Label {
                 text: "Checking and unchecking should not break the layout. The progress bar should look like it is at 50% if unchecked."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             PlasmaComponents.CheckBox {
@@ -163,7 +163,7 @@ ComponentBase {
         ColumnLayout {
             PlasmaComponents.Label {
                 text: "This should do one 'indefinite' animation cycle and then continuously animate to 100% in chunks of 10%."
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
                 Layout.preferredWidth: progressBarWidth
             }
             PlasmaComponents.ProgressBar {
diff --git a/tests/dialog_fullscreen.qml b/tests/dialog_fullscreen.qml
index f329acb5a..9eac1636a 100644
--- a/tests/dialog_fullscreen.qml
+++ b/tests/dialog_fullscreen.qml
@@ -19,7 +19,7 @@ PlasmaCore.Dialog {
     ColumnLayout {
         Controls.Label {
             Layout.maximumWidth: rect.width
-            wrapMode: Text.WordWrap
+            wrapMode: Text.Wrap
             text: "Clicking on the rectangle should toggle the full screen mode. Make sure it retains its original geometry when jumping in between full screen and normal"
         }
 
diff --git a/tests/dialog_minWidthHeightRepositioning.qml b/tests/dialog_minWidthHeightRepositioning.qml
index 9d0c3d4a9..cfafdeed5 100644
--- a/tests/dialog_minWidthHeightRepositioning.qml
+++ b/tests/dialog_minWidthHeightRepositioning.qml
@@ -31,7 +31,7 @@ PlasmaCore.Dialog {
             Controls.Label {
                 Layout.maximumWidth: rect.Layout.minimumWidth
                 text: "Use Alt + Left Click to move the window to a side and then increase the minWidth/Height. The window should reposition itself"
-                wrapMode: Text.WordWrap
+                wrapMode: Text.Wrap
             }
             Controls.Button {
                 text: "Increase MinWidth"
diff --git a/tests/dialog_positioning.qml b/tests/dialog_positioning.qml
index 712d99758..c851cc63e 100644
--- a/tests/dialog_positioning.qml
+++ b/tests/dialog_positioning.qml
@@ -45,7 +45,7 @@ PlasmaCore.Dialog {
                 Controls.Label {
                     Layout.fillWidth: true
                     text: "alt + left click and move the window to various edges to test popup position"
-                    wrapMode: Text.WordWrap
+                    wrapMode: Text.Wrap
                 }
 
                 Controls.ComboBox {
diff --git a/tests/dialog_positioning2.qml b/tests/dialog_positioning2.qml
index b908d2374..ccfd1e48b 100644
--- a/tests/dialog_positioning2.qml
+++ b/tests/dialog_positioning2.qml
@@ -17,7 +17,7 @@ ColumnLayout
 {
     Controls.Label {
         text: "Press the button and make sure the popup is on the correct place"
-        wrapMode: Text.WordWrap
+        wrapMode: Text.Wrap
     }
     PC3.Button {
         id: settingsButton
diff --git a/tests/dialog_positioning_parentrotated.qml b/tests/dialog_positioning_parentrotated.qml
index 65925f431..8c45c1b0a 100644
--- a/tests/dialog_positioning_parentrotated.qml
+++ b/tests/dialog_positioning_parentrotated.qml
@@ -20,7 +20,7 @@ ColumnLayout
     Controls.Label {
         id: label
         text: "Press the button and make sure the popup is on the correct place"
-        wrapMode: Text.WordWrap
+        wrapMode: Text.Wrap
     }
     PlasmaComponents.Button {
         id: settingsButton
diff --git a/tests/dialog_sizeMoreThanMin.qml b/tests/dialog_sizeMoreThanMin.qml
index 5adedb09d..e13b32a4e 100644
--- a/tests/dialog_sizeMoreThanMin.qml
+++ b/tests/dialog_sizeMoreThanMin.qml
@@ -49,7 +49,7 @@ Item {
                 height: rect.Layout.minimumHeight
                 Text {
                     anchors.fill: parent
-                    wrapMode: Text.WordWrap
+                    wrapMode: Text.Wrap
                     text: "you should see a red border around this white area"
                 }
             }
diff --git a/tests/dialog_tooltip.qml b/tests/dialog_tooltip.qml
index 3b144fa6b..b8f88d2ca 100644
--- a/tests/dialog_tooltip.qml
+++ b/tests/dialog_tooltip.qml
@@ -14,7 +14,7 @@ import org.kde.plasma.core as PlasmaCore
 ColumnLayout {
     Controls.Label {
         Layout.maximumWidth: mainLayout.width
-        wrapMode: Text.WordWrap
+        wrapMode: Text.Wrap
         text: "Hover over every rectangle so that the tooltip pops up. It should popup in the correct position"
     }
 
diff --git a/tests/dialog_visualParentChange.qml b/tests/dialog_visualParentChange.qml
index d93a93297..10083f9d5 100644
--- a/tests/dialog_visualParentChange.qml
+++ b/tests/dialog_visualParentChange.qml
@@ -14,7 +14,7 @@ import org.kde.plasma.core as PlasmaCore
 ColumnLayout {
     Controls.Label {
         Layout.maximumWidth: mainLayout.width
-        wrapMode: Text.WordWrap
+        wrapMode: Text.Wrap
         text: "Click on each coloured box to make a dialog popup. It should popup in the correct position. The popup should also move from one rectangle to the other on hovering"
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.