diff --git a/BirdyNet.ini b/BirdyNet.ini index 876b696..58e304a 100644 --- a/BirdyNet.ini +++ b/BirdyNet.ini @@ -1,3 +1,9 @@ [default] home = https://example.com -useragent = BirdyNet/$VER ($OS) \ No newline at end of file +useragent = BirdyNet/$VER ($OS) + +[accessibility] +# Which background color (CSS color) should be chosen for websites? "default" for system's default. "white" is recommended for compatibility. +colorBackground = white +# Which text color (CSS color) should be chosen for websites? "default" for system's default. "black" is recommended for compatibility. +colorText = black \ No newline at end of file diff --git a/addons/0.documentViewer.QTextBrowser.py b/addons/0.documentViewer.QTextBrowser.py index ecfa130..803bf96 100644 --- a/addons/0.documentViewer.QTextBrowser.py +++ b/addons/0.documentViewer.QTextBrowser.py @@ -3,7 +3,14 @@ class browserDoc(QTextBrowser): def __init__(self,*args,**kwargs): super().__init__(*args,**kwargs) self.setOpenLinks(False) - self.setStyleSheet("QTextBrowser { background-color: white; color: black }") + style = "" + if (config["accessibility"]["colorBackground"] != "default"): + style += "background-color: " +config["accessibility"]["colorBackground"] + ";" + + if (config["accessibility"]["colorText"] != "default"): + style += "color: " +config["accessibility"]["colorText"]+ ";" + + self.setStyleSheet("QTextBrowser { " +style+ " }") self.anchorClicked.connect(self.cAnchorClicked) def cRenderHtml(self,html):