diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index 38ae0893..8173ecba 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -39,11 +39,47 @@ class GuiDocViewer(QTextBrowser): self.theQDoc = self.document() self.theQDoc.setDefaultStyleSheet(( + "body {{" + " font-size: {textSize}pt;" + " color: rgb({tColR},{tColG},{tColB});" + "}}\n" "h1, h2, h3, h4 {{" - " color: rgb({0},{1},{2});" - "}}" + " color: rgb({hColR},{hColG},{hColB});" + "}}\n" + "a {{" + " color: rgb({aColR},{aColG},{aColB});" + "}}\n" + "pre {{" + " color: rgb({cColR},{cColG},{cColB});" + " font-size: {preSize}pt;" + "}}\n" + "mark {{" + " color: rgb({eColR},{eColG},{eColB});" + "}}\n" + "table {{" + " margin: 10px 0px;" + "}}\n" + "td {{" + " padding: 0px 4px;" + "}}\n" ).format( - *self.theTheme.colHead + textSize = self.mainConf.textSize, + preSize = self.mainConf.textSize*0.9, + tColR = self.theTheme.colText[0], + tColG = self.theTheme.colText[1], + tColB = self.theTheme.colText[2], + hColR = self.theTheme.colHead[0], + hColG = self.theTheme.colHead[1], + hColB = self.theTheme.colHead[2], + cColR = self.theTheme.colComm[0], + cColG = self.theTheme.colComm[1], + cColB = self.theTheme.colComm[2], + eColR = self.theTheme.colEmph[0], + eColG = self.theTheme.colEmph[1], + eColB = self.theTheme.colEmph[2], + aColR = self.theTheme.colLink[0], + aColG = self.theTheme.colLink[1], + aColB = self.theTheme.colLink[2], )) self.setMinimumWidth(300) self.initEditor() diff --git a/nw/theme.py b/nw/theme.py index 88fe121d..806e7b46 100644 --- a/nw/theme.py +++ b/nw/theme.py @@ -86,6 +86,8 @@ class Theme: ## Syntax cnfSec = "Syntax" if confParser.has_section(cnfSec): + self.colText = self._loadColour(confParser,cnfSec,"text") + self.colLink = self._loadColour(confParser,cnfSec,"link") self.colHead = self._loadColour(confParser,cnfSec,"headertext") self.colHeadH = self._loadColour(confParser,cnfSec,"headertag") self.colEmph = self._loadColour(confParser,cnfSec,"emphasis") diff --git a/nw/themes/default/styles.css b/nw/themes/default/styles.css index 1d78fe66..ddf008ae 100644 --- a/nw/themes/default/styles.css +++ b/nw/themes/default/styles.css @@ -10,7 +10,6 @@ QTextEdit { QTextBrowser { background-color: #141414; color: #c7cfd0; - /* padding: 40px; */ } QTreeView, QHeaderView { diff --git a/nw/themes/default/theme.conf b/nw/themes/default/theme.conf index b230f3a5..7f4729e8 100644 --- a/nw/themes/default/theme.conf +++ b/nw/themes/default/theme.conf @@ -1,4 +1,6 @@ [Syntax] +text = 199, 207, 208 +link = 184, 200, 0 headertext = 0, 155, 200 headertag = 0, 105, 135 emphasis = 200, 120, 0