Merge lp:~tzeentch-gm/bzr-explorer/536954-dark-color-status-fix into lp:bzr-explorer

Proposed by Michael Gliwinski
Status: Merged
Merged at revision: not available
Proposed branch: lp:~tzeentch-gm/bzr-explorer/536954-dark-color-status-fix
Merge into: lp:bzr-explorer
Diff against target: 23 lines (+7/-6)
1 file modified
lib/kinds.py (+7/-6)
To merge this branch: bzr merge lp:~tzeentch-gm/bzr-explorer/536954-dark-color-status-fix
Reviewer Review Type Date Requested Status
Alexander Belchenko Approve
Review via email: mp+21186@code.launchpad.net

Description of the change

This changes good and warning status messages produced by bzrlib.plugins.explorer.kinds.html_status_message to use default color, instead of explicitly black. Since background color isn't explicitly set, this allows QTextBrowser to use colors appropriate for current system color scheme in use.

In effect, the text color is white on dark schemes and black on light schemes.

To post a comment you must log in.
Revision history for this message
Alexander Belchenko (bialix) :
review: Approve
Revision history for this message
Michael Gliwinski (tzeentch-gm) wrote :

BTW, I checked this on KDE 4.4 and 4.3 on both dark and light color schemes. Haven't checked other platforms though.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/kinds.py'
2--- lib/kinds.py 2010-02-26 08:13:31 +0000
3+++ lib/kinds.py 2010-03-11 21:51:27 +0000
4@@ -455,14 +455,15 @@
5
6
7 def html_status_message(status_kind, text):
8- colour = {
9- ERROR_STATUS: "red",
10- WARNING_STATUS: "black",
11- GOOD_STATUS: "black",
12+ icon_fmt = '<img src="%s">'
13+ text_fmt = {
14+ ERROR_STATUS: '<font color="red">%s</font>',
15+ WARNING_STATUS: '%s',
16+ GOOD_STATUS: '%s',
17 }[status_kind]
18- return '<img src="%s">&nbsp;&nbsp;<font color=%s>%s</font>' % (
19+ message_fmt = '%s&nbsp;&nbsp;%s' % (icon_fmt, text_fmt)
20+ return message_fmt % (
21 path_for_icon(status_kind),
22- colour,
23 escape(text))
24
25

Subscribers

People subscribed via source and target branches