Skip to content

Commit

Permalink
gui_qt/add_translation: fix #1569
Browse files Browse the repository at this point in the history
Setting the stylesheet resets the palette colors to the system default.
For the base color, that'd mean that it'd be reset to `#ffffff`.

While setting the palette from the stylesheet could be done, it's much
simpler to instead let the formatted text inherit
the background color.
  • Loading branch information
DropDemBits committed Nov 12, 2022
1 parent 3066a9a commit 8175897
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions news.d/bugfix/1571.ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix "add translation" dialog ignoring the stylesheet's background color for the translation and stroke text.
2 changes: 0 additions & 2 deletions plover/gui_qt/add_translation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ def __init__(self, *args, **kwargs):

self._special_fmt = (
'<span style="' +
'background-color:' + self.palette().base().color().name() +';' +
'font-family:monospace;' +
'">%s</span>'
)

self._special_fmt_bold = (
'<span style="' +
'background-color:' + self.palette().base().color().name() +';' +
'font-family:monospace;' +
'font-weight:bold;' +
'">%s</span>'
Expand Down

0 comments on commit 8175897

Please sign in to comment.