mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement foreground
This commit is contained in:
parent
35e531a737
commit
53caa824cf
@ -471,8 +471,10 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{
|
|||||||
col = QColorDialog.getColor(Qt.black, self,
|
col = QColorDialog.getColor(Qt.black, self,
|
||||||
_('Choose foreground color'), QColorDialog.ShowAlphaChannel)
|
_('Choose foreground color'), QColorDialog.ShowAlphaChannel)
|
||||||
if col.isValid():
|
if col.isValid():
|
||||||
raise NotImplementedError('TODO')
|
fmt = QTextCharFormat()
|
||||||
self.exec_command('foreColor', unicode_type(col.name()))
|
fmt.setForeground(QBrush(col))
|
||||||
|
with self.editing_cursor() as c:
|
||||||
|
c.mergeCharFormat(fmt)
|
||||||
|
|
||||||
def do_background(self):
|
def do_background(self):
|
||||||
col = QColorDialog.getColor(Qt.white, self,
|
col = QColorDialog.getColor(Qt.white, self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user