Review Request: Modify Notes widget to use CSS for global formatting. (currently it uses setFont(QFont) which affect children)

Darío Andrés andresbajotierra at gmail.com
Fri Jul 31 20:17:54 CEST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1191/
-----------------------------------------------------------

(Updated 2009-07-31 18:17:54.554062)


Review request for Plasma.


Changes
-------

Improve description. I'm talking about the global font formatting (general may be not really specific)


Summary (updated)
-------

This patch allows the Notes widget to set the global formatting using CSS Stylesheets.

Previously it calls nativeWidget()->setFont(QFont) which causes the children of the KRichTextEdit/NotesTextEdit to use that modified font: as a result the Find dialog (which is children of the editor) uses big fonts (and/or bold/italic) (this is described in the bug report)

I tried different approaches but:
- KRichTextEdit->setFont() / setFontSize() only applies to selected text, so it doesn't work on an empty Notes widget
- I couldn't found any way to call QWidget::setFont() and to not affect children widgets (avoid "propagation")

---

Also, the patch removes a second setFont() call (the new CSS code doesn't need to be duplicate there, because "configAccepted" already sets "changed=true", and this forces calling "updateTextGeometry()" which updates the CSS (the first part of the patch)


This addresses bug 201982.
    https://bugs.kde.org/show_bug.cgi?id=201982


Diffs
-----

  svn://anonsvn.kde.org/home/kde/trunk/KDE/kdeplasma-addons/applets/notes/notes.cpp 1001953 

Diff: http://reviewboard.kde.org/r/1191/diff


Testing
-------

The formatting works properly. It has the same "problems" as the old code. (example: if you set "bold" globally, and you select some text and click the "Bold" button, the font weight will be set to bold (that means, no visible changes); and the next time you click the button it will be set to weight=normal (that will force the selected text to be normal (not-bold)). -> the same for italic.


Thanks,

Darío



More information about the Plasma-devel mailing list