Created attachment 151098 [details] Bug with kde NetworkManager Bug with kde NetworkManager SOFTWARE/OS VERSIONS Linux/KDE Plasma: OpenSUSE Tumbleweed KDE Plasma Version: 5.25.3 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5
Comment on attachment 151098 [details] Bug with kde NetworkManager Bug with kde NetworkManager SOFTWARE/OS VERSIONS Linux/KDE Plasma: OpenSUSE Tumbleweed KDE Plasma Version: 5.25.3 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5
Hmm, plasma-nm uses PlasmaExtras.SearchField for the search field. https://invent.kde.org/plasma/plasma-nm/-/blob/master/applet/contents/ui/Toolbar.qml#L150
How did you get it in this state? Is that the placeholder text, or did you type text into the text field?
I was able to confirm this bug in OpenSUSE TW as well: https://i.imgur.com/wpxzFhG.png 1. Comment out all the `visible: __` stuff in plasma-nm's Toolbar.qml to show all the extra fluff hidden on a non-wifi PC which shrinks the SearchField width. 2. Resizing the plasmoid popup with Meta+RightClick+Drag to make the SearchField even smaller. The SearchField seems to use PC3.TextField at it's base. It has `elide: Text.ElideRight` so I am not sure what's broken. * https://invent.kde.org/frameworks/plasma-framework/-/blob/master/src/declarativeimports/plasmaextracomponents/qml/SearchField.qml * https://invent.kde.org/frameworks/plasma-framework/-/blob/master/src/declarativeimports/plasmaextracomponents/qml/ActionTextField.qml * https://invent.kde.org/frameworks/plasma-framework/-/blame/master/src/declarativeimports/plasmacomponents3/TextField.qml#L122-138 Label { id: placeholder x: control.leftPadding width: control.availableWidth text: control.placeholderText horizontalAlignment: control.horizontalAlignment elide: Text.ElideRight ...
Can you reproduce it in other widgets, or just this one?
Searching 3175 files for "PlasmaExtras.SearchField": kdeplasma-addons/applets/dict/package/contents/ui/main.qml kwin/src/effects/windowview/qml/main.qml plasma-desktop/applets/kicker/package/contents/ui/MenuRepresentation.qml plasma-desktop/applets/kickoff/package/contents/ui/Header.qml plasma-desktop/desktoppackage/contents/activitymanager/Heading.qml plasma-desktop/desktoppackage/contents/explorer/WidgetExplorer.qml plasma-framework/src/declarativeimports/plasmaextracomponents/qml/SearchField.qml plasma-nm/applet/contents/ui/Toolbar.qml plasma-workspace/applets/clipboard/contents/ui/ClipboardPage.qml plasma-workspace/lookandfeel/contents/runcommand/RunCommand.qml Adding `Item { Layout.minimumWidth: 300 }` to kickoff's Header.qml can also duplicate this bug: https://i.imgur.com/NklXX2t.png
Text fields implementations are waiting for someone to redo their layout, tbh. Also, in my opinion, placeholders should be rewritten with padding and expanded API — an option to show it to the right of a user-edited text too.
After editing /usr/lib64/qt5/qml/org/kde/plasma/components.3/TextField.qml in OpenSuse TW, I've noticed that `control.availableWidth` is `undefined`, which means the width of the placeholder is undefined. T.TextField { id: control Rectangle { border.color: "yellow" border.width: 1 color: "transparent" x: control.leftPadding y: control.topPadding width: control.availableWidth height: control.availableHeight onWidthChanged: console.log('availableWidth', control.availableWidth) Component.onCompleted: console.log('availableWidth', control.availableWidth) } ... I assume this is suppose to be `QQC2.Control.availableWidth` right? * https://doc.qt.io/qt-6/qml-qtquick-controls2-control.html#availableWidth-prop Except that `QQC2.TextField` does not inherit `QQC2.Control`. * https://doc.qt.io/qt-6/qml-qtquick-controls2-textfield.html * https://doc.qt.io/qt-6/qml-qtquick-textinput.html * https://doc.qt.io/qt-6/qml-qtquick-item.html * https://github.com/qt/qtdeclarative/blob/dev/src/quicktemplates2/qquicktextfield_p.h * https://github.com/qt/qtdeclarative/blob/dev/src/quick/items/qquicktextinput_p.h Seems there was a bug introduced in the commit that added `control.availableWidth`. Git blame: https://invent.kde.org/frameworks/plasma-framework/-/commit/52b9c9e94aec30ff8f0a05b0cf9a84e187f6bf61 https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/213
> Except that `QQC2.TextField` does not inherit `QQC2.Control`. Yep, welcome to the consistency of QQC2 :-\ Thanks for the investigation! It should be trivial to fix by replacing availableWidth with control's `width - leftPadding - rightPadding`.
(In reply to Nate Graham from comment #3) > How did you get it in this state? Is that the placeholder text, or did you > type text into the text field? This is placeholder text.
(In reply to Nate Graham from comment #5) > Can you reproduce it in other widgets, or just this one? Just this one.
Created attachment 151137 [details] Steps to reproduce
Was fixed by https://invent.kde.org/plasma/libplasma/-/commit/9131ac91e73f8096d5c687985c5840c6e12e5ade