From 53caa824cf6fce59d98ccc623e90afd2ff0f3c28 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 2 Jul 2019 18:49:01 +0530 Subject: [PATCH] Implement foreground --- src/calibre/gui2/comments_editor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 9a50e7b303..1ccd7953a6 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -471,8 +471,10 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{ col = QColorDialog.getColor(Qt.black, self, _('Choose foreground color'), QColorDialog.ShowAlphaChannel) if col.isValid(): - raise NotImplementedError('TODO') - self.exec_command('foreColor', unicode_type(col.name())) + fmt = QTextCharFormat() + fmt.setForeground(QBrush(col)) + with self.editing_cursor() as c: + c.mergeCharFormat(fmt) def do_background(self): col = QColorDialog.getColor(Qt.white, self,