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

Sebastian Kügler sebas at kde.org
Fri Jul 31 20:27:50 CEST 2009


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

Ship it!


Look good, please commit.

- Sebastian


On 2009-07-31 18:17:54, Darío Andrés wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1191/
> -----------------------------------------------------------
> 
> (Updated 2009-07-31 18:17:54)
> 
> 
> Review request for Plasma.
> 
> 
> Summary
> -------
> 
> 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