Version: (using KDE 4.4.2) OS: Linux Installed from: Ubuntu Packages KDE 4.4 sets wordwrap in systemsettings iconview. The text under icon will be wrapped with the width of icon. This is no problem for latin texts, but for CJK text where all characters can wrap, it results in very narrow iconview. KDE 4.3 has no such problem.
Created attachment 42795 [details] For english text the iconview is good.
Created attachment 42796 [details] For Chinese text the iconview is too narrow and text may wrap to 3 lines.
This is the patch to solve this bug. --- kdebase-workspace-4.4.2/systemsettings/icons/IconMode.cpp 2010-04-15 04:56:56.000000000 +0800 +++ kdebase-workspace-4.4.2/systemsettings/icons/IconMode.cpp 2010-04-15 05:18:11.000000000 +0800 @@ -177,7 +177,6 @@ void IconMode::initWidget() tv->setMouseTracking( true ); tv->viewport()->setAttribute( Qt::WA_Hover ); KFileItemDelegate *delegate = new KFileItemDelegate( tv ); - delegate->setWrapMode( QTextOption::WordWrap ); tv->setItemDelegate( delegate ); tv->setFrameShape( QFrame::NoFrame ); tv->setModel( proxyModel );
Created attachment 42797 [details] the patch file
This patch rollback to KDE 4.3. The better solution may be provide an option to set text width, or to set the default text width to something bigger than the icon width. Hope someone can do that instead.
Totally agree with pan shi zhu.
4.6.0 has the same problem. A modified patch based on pan shi zhu's. Only set NoWrap for CJK locale. --- kdebase-workspace-4.6.0_orig/systemsettings/icons/IconMode.cpp 2011-01-20 06:04:38.000000000 +0800 +++ kdebase-workspace-4.6.0/systemsettings/icons/IconMode.cpp 2011-02-11 01:33:03.000000000 +0800 @@ -165,7 +165,12 @@ d->categoryView->viewport()->setAttribute( Qt::WA_Hover ); KFileItemDelegate *delegate = new KFileItemDelegate( d->categoryView ); - delegate->setWrapMode( QTextOption::WordWrap ); + QString curLang = KGlobal::locale()->language (); + QString CJKLang ("zh_CN:zh_TW:ja:ko"); + if( CJKLang.contains(curLang) ) + delegate->setWrapMode( QTextOption::NoWrap ); + else + delegate->setWrapMode( QTextOption::WordWrap ); d->categoryView->setItemDelegate( delegate ); d->categoryView->setFrameShape( QFrame::NoFrame );
The attempt to apply bbloldd's patch is rejected. See https://git.reviewboard.kde.org/r/108285/. Another patch to set minimium width is still under evaluation but has its problems too. See https://git.reviewboard.kde.org/r/108328/. New ideas from Thomas Lübking: Reimplemented ::paint() function of QItemDelegate, match the width of the remaining words against the textrect width, if it's "not much more" (tm), paint it ignoring clips, otherwise break at the flooring word, move to the next line and go on with the rest of the string.
Created attachment 94569 [details] Screenshot on Plasma 5.4.0 I'd like to ping on this again, while it's already qt5/kf5 world. This problem isn't resolved yet and looks even worse (1 character wide if everything is translated). So far, dolphin's view looks much better than systemsettings. Can't there be a reasonable size as a hint for systemsettings?
Is this bug still relevant? At least for Korean locale, the text width in System Settings' icon view is adequate in Plasma 5.18.
Great, thanks for confirming!