From 497d1e83a1793d8db930543d8fe2a018d101d211 Mon Sep 17 00:00:00 2001 From: Olivier Keshavjee Date: Sat, 21 Oct 2017 00:01:43 +0200 Subject: [PATCH] Corrects a stylesheet mistake that could make context menu in textEditView hard to read --- manuskript/ui/views/textEditView.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/manuskript/ui/views/textEditView.py b/manuskript/ui/views/textEditView.py index 2db1df45..d557e4d3 100644 --- a/manuskript/ui/views/textEditView.py +++ b/manuskript/ui/views/textEditView.py @@ -204,10 +204,17 @@ class textEditView(QTextEdit): # We set the parent background to the editor's background in case # there are margins. We check that the parent class is a QWidget because # if textEditView is used in fullScreenEditor, then we don't want to - # set the background + # set the background. if self.parent().__class__ == QWidget: - self.parent().setStyleSheet("background: {bg};".format( - bg=opt["background"])) + self.parent().setStyleSheet(""" + QWidget#{name}{{ + background: {bg}; + }}""".format( + # We style by name, otherwise all heriting widgets get the same + # colored background, for example context menu. + name=self.parent().objectName(), + bg=opt["background"], + )) cf = QTextCharFormat() # cf.setFont(f)