D16839: Force black pen when painting unstyled TextLabel

Alexander Semke noreply at phabricator.kde.org
Sat Nov 17 15:49:43 GMT 2018


asemke added a comment.


  In D16839#360121 <https://phabricator.kde.org/D16839#360121>, @mikhailru wrote:
  
  > @asemke , could you please describe the steps to reproduce wrong behavior with default dark worksheet theme? i tried setting a dark theme ("Dark") and axis label color seemed OK to me, screenshots attached (before and after patch).
  
  
  @mikhailru sorry, I was not very precise in my last comment. The problem that I referred to can be seen on these screenshots:
  F6428869: textlabel_white_desktop_white_worksheet.png <https://phabricator.kde.org/F6428869> F6428871: textlabel_white_desktop_black_worksheet.png <https://phabricator.kde.org/F6428871> F6428873: textlabel_black_desktop_white_worksheet.png <https://phabricator.kde.org/F6428873>F6428875: textlabel_black_desktop_white_worksheet_theme_loaded.png <https://phabricator.kde.org/F6428875>
  
  Observe the colors shown in the textedit in the properties dock widget. Do you also have this? This doesn't look nice and this is what I meant with "We need to re-think how we treat QTextEdit::toHtml() in LabelWidget.cpp and how we plot this rich-text formatted string in TextLabel.cpp via QPainter::drawStaticText()".
  
  On the last screenshot I started with a "white desktop/white (default) worksheet" and applied the theme "BlackOnWhite" on the worksheet - only after this the foreground color of the label is set correctly.
  
  You patch doesn't fix the problem for me, for white worksheet and plot the axis title is still hardly visible and I don't really understand why this should help. All properties of the text like forground and background colors are read from the html text in QTextEdit and set to QStaticText which is then painted in TextLabelPrivate::paint() via QPainter::drawStaticText(). A global color for the pen doesn't make much sense since the different parts of the label string can have different colors - this is what is encoded in the html code that is painted via the QStaticText.

REPOSITORY
  R262 LabPlot

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

To: mikhailru, #labplot
Cc: asemke, cfeck, kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20181117/578f8f7c/attachment-0001.html>


More information about the kde-edu mailing list