| 121 | } |
| 122 | |
| 123 | void HelpAboutDialog::applyHtmlTheme() |
| 124 | { |
| 125 | auto helpTheme = theme.helpAboutDialog; |
| 126 | |
| 127 | // Original colors in the HTML CSS |
| 128 | const QString originalHeadingColor = "#302f2d"; |
| 129 | const QString originalLinkColor = "#C19441"; |
| 130 | |
| 131 | if (!aboutHtmlContent.isEmpty()) { |
| 132 | QString themedAbout = aboutHtmlContent; |
| 133 | themedAbout.replace(originalHeadingColor, helpTheme.headingColor.name(), Qt::CaseInsensitive); |
| 134 | themedAbout.replace(originalLinkColor, helpTheme.linkColor.name(), Qt::CaseInsensitive); |
| 135 | aboutText->setHtml(themedAbout); |
| 136 | aboutText->moveCursor(QTextCursor::Start); |
| 137 | } |
| 138 | |
| 139 | if (!helpHtmlContent.isEmpty()) { |
| 140 | QString themedHelp = helpHtmlContent; |
| 141 | themedHelp.replace(originalHeadingColor, helpTheme.headingColor.name(), Qt::CaseInsensitive); |
| 142 | themedHelp.replace(originalLinkColor, helpTheme.linkColor.name(), Qt::CaseInsensitive); |
| 143 | helpText->setHtml(themedHelp); |
| 144 | helpText->moveCursor(QTextCursor::Start); |
| 145 | } |
| 146 | } |