D19542: [WIP] Make pop-up note text visible whatever background color is

Yuri Chornoivan noreply at phabricator.kde.org
Tue Mar 5 15:08:04 GMT 2019


yurchor created this revision.
yurchor added a reviewer: Okular.
Herald added a project: Okular.
Herald added a subscriber: okular-devel.
yurchor requested review of this revision.

REVISION SUMMARY
  The user can choose the blue or some dark color for annotation background and the black text is hardly visible on such backgrounds.
  
  Example:
  F6659432: dummy.png <https://phabricator.kde.org/F6659432>
  
  This patch tries to use the luminance of background to determine what color (white or black) should be used for the text.
  
  I know that it's a silly thing to use the dark background for the black text but it seems that someone's gotta do it. ;)
  
  Currently, you should type something in the pop-up note to make the text visible. I could not find the right place for the color change yet. The help in determining the entry point to change the color from the beginning will be much appreciated.
  
  BUG: 405105

TEST PLAN
  1. Create a pop-up note with the default (yellow) background (F6, click on the "Pop-up Note" button, click somewhere in the document).
  2. Type something. The text should be black (light background).
  3. Use "Settings -> Configure Okular..." in the main menu. Go to the "Annotations" page, choose "Pop-up Note", then press "Edit" and select the blue color.
  4. Create a pop-up note with the new (blue) background.
  5. Type something. The text should be white (dark background).
  
  Screenshot:
  F6659428: new.png <https://phabricator.kde.org/F6659428>
  
  Test file (you should type something in the "blue" pop-up note window to see the text):
  F6659429: test.pdf <https://phabricator.kde.org/F6659429>

REPOSITORY
  R223 Okular

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

AFFECTED FILES
  ui/annotwindow.cpp

To: yurchor, #okular
Cc: okular-devel, tfella, ngraham, darcyshen, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20190305/59c61ae8/attachment.html>


More information about the Okular-devel mailing list