MCPcopy Create free account
hub / github.com/YACReader/yacreader / applyHtmlTheme

Method applyHtmlTheme

custom_widgets/help_about_dialog.cpp:123–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void 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}

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
replaceMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected