D9070: KDE platform plugin: don't force default stylename on user-specified fonts

Fabian Vogt noreply at phabricator.kde.org
Thu Nov 30 18:16:58 UTC 2017


fvogt added a comment.


  Oh, now I understand: It fixes the issue that the styleName was prefilled with the stylename of the default font and fromString might not reset it.
  IMO that's a feature though and is the expected behaviour. For instance, if we change the default window title to be bold, users with "windowTitle=Comic Sans" will also have a bold title.
  
  qtbase's src/gui/text/qfont.cpp says:
  
    setFamily(l[0].toString());
        if (count > 1 && l[1].toDouble() > 0.0)
            setPointSizeF(l[1].toDouble());
        if (count == 9) {
            setStyleHint((StyleHint) l[2].toInt());
            setWeight(qMax(qMin(99, l[3].toInt()), 0));
            setItalic(l[4].toInt());
            setUnderline(l[5].toInt());
            setStrikeOut(l[6].toInt());
            setFixedPitch(l[7].toInt());
        } else if (count >= 10) {
            if (l[2].toInt() > 0)
                setPixelSize(l[2].toInt());
            setStyleHint((StyleHint) l[3].toInt());
            setWeight(qMax(qMin(99, l[4].toInt()), 0));
            setStyle((QFont::Style)l[5].toInt());
            setUnderline(l[6].toInt());
            setStrikeOut(l[7].toInt());
            setFixedPitch(l[8].toInt());
            if (count == 11)
                d->request.styleName = l[10].toString();
            else
                d->request.styleName.clear();
        }
  
  So just specifying exactly 10 parameters as part of the config key should have the exact same effect.

REPOSITORY
  R135 Integration for Qt applications in Plasma

REVISION DETAIL
  https://phabricator.kde.org/D9070

To: rjvbb
Cc: fvogt, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171130/6f7e391c/attachment-0001.html>


More information about the Plasma-devel mailing list