Explicitly set color since default differs on some platforms

This commit is contained in:
Dpeta 2022-04-17 14:21:08 +02:00
parent 3420a4f198
commit fe53f1bf7b
3 changed files with 11 additions and 3 deletions

View file

@ -531,7 +531,14 @@ class PesterInput(QtWidgets.QLineEdit):
super(PesterInput, self).__init__(parent)
self.changeTheme(theme)
def changeTheme(self, theme):
self.setStyleSheet(theme[self.stylesheet_path])
# Explicitly set color if not already set.
# (Some platforms seem to default to white instead of black.)
StyleSheet = theme[self.stylesheet_path]
if "color:" not in theme[self.stylesheet_path].replace(' ', ''):
StyleSheet = "color: black; " + StyleSheet
self.setStyleSheet(StyleSheet)
def focusInEvent(self, event):
self.parent().clearNewMessage()
self.parent().textArea.textCursor().clearSelection()

View file

@ -386,6 +386,7 @@ class PesterMemo(PesterConvo):
self.textArea = MemoText(self.mainwindow.theme, self)
self.textInput = MemoInput(self.mainwindow.theme, self)
print(self.textInput)
self.textInput.setFocus()
self.miniUserlist = QtWidgets.QPushButton(">\n>", self)

View file

@ -255,7 +255,7 @@
"style": "background: white; font-size: 14px;font:bold; border:2px solid #c48a00;text-align:center; margin-right:10px; margin-left:10px;font-family: 'Courier'"
},
"input": {
"style": "background: white; border:2px solid #c48a00;margin-top:5px; margin-right:10px; margin-left:10px; font-size: 12px;font-family: 'Courier'"
"style": "color: black; background: white; border:2px solid #c48a00;margin-top:5px; margin-right:10px; margin-left:10px; font-size: 12px;font-family: 'Courier'"
},
"tabwindow" : {
"style": "background-color:#fdb302;border:0px"
@ -303,7 +303,7 @@
"minheight": 47,
"maxheight": 47
},
"input": { "style": "background: white; border:2px solid #c48a00;margin-top:5px; margin-right:10px; margin-left:10px; font-size: 12px;" },
"input": { "style": "color: black; background: white; border:2px solid #c48a00;margin-top:5px; margin-right:10px; margin-left:10px; font-size: 12px;" },
"textarea": { "style": "background: white; font-size: 14px;font:bold; border:2px solid #c48a00;text-align:center; margin-right:10px; margin-left:10px;" },
"margins": {"top": 0, "bottom": 6, "left": 0, "right": 0 },
"userlist": { "width": 150,