D7164: KSqueezedTextLabel: Respect indent, margin and frame width
Henrik Fehlauer
noreply at phabricator.kde.org
Sat Sep 9 22:03:25 UTC 2017
rkflx updated this revision to Diff 19345.
rkflx edited the summary of this revision.
rkflx added a comment.
Spent some time trying to solve this properly, but it's difficult.
We could get the Qt code as LGPLv2.1 from an older release, and `relicensecheck.pl` for ksqueezedtextlabel.{cpp,h} on kwidgetsaddons and kdelibs (including moves) doesn't look too bad for "lgplv23 lgplv2+". However, technically we would need to relicense to either "v3" or "v2.1", but the script only asks for "v2 or v3" and "v2+". Thus, no luck.
Therefore, I opened the Qt API docs to check whether a reimplementation without looking at the code is possible, which states already quite algorithmically:
If indent is negative, or if no indent has been set, the label computes the effective indent as follows: If frameWidth() is 0, the effective indent becomes 0. If frameWidth() is greater than 0, the effective indent becomes half the width of the "x" character of the widget's current font(). By default, the indent is -1, meaning that an effective indent is calculating in the manner described above.
The implementation I'm proposing (as of now :) should be doing exactly that, of course with adaptations to also account for margin and lineWidth. Let me know if this is enough.
REPOSITORY
R236 KWidgetsAddons
CHANGES SINCE LAST UPDATE
https://phabricator.kde.org/D7164?vs=19332&id=19345
BRANCH
arcpatch-D7164 (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D7164
AFFECTED FILES
autotests/ksqueezedtextlabelautotest.cpp
src/ksqueezedtextlabel.cpp
src/ksqueezedtextlabel.h
To: rkflx, #frameworks, cfeck
Cc: cfeck, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170909/166f4c3b/attachment.html>
More information about the Kde-frameworks-devel
mailing list