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

Method applyTheme

YACReader/translator.cpp:128–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void YACReaderTranslator::applyTheme(const Theme &theme)
129{
130 const auto &tr = theme.translator;
131
132 QPalette p(this->palette());
133 p.setColor(QPalette::Window, tr.backgroundColor);
134 this->setPalette(p);
135
136 text->setStyleSheet(tr.textEditQSS + tr.scrollBarQSS);
137 from->setStyleSheet(tr.comboBoxQSS + tr.scrollBarQSS);
138 to->setStyleSheet(tr.comboBoxQSS + tr.scrollBarQSS);
139
140 titleLabel->setStyleSheet(tr.titleQSS);
141 resultsTitle->setStyleSheet(tr.resultsTitleQSS);
142 resultText->setStyleSheet(tr.resultTextQSS);
143 clearButton->setStyleSheet(tr.clearButtonQSS);
144
145 searchButton->setStyleSheet(
146 QString("QPushButton {border:none; background:%1;}").arg(tr.inputBackgroundColor.name()));
147
148 closeButton->setIcon(tr.closeIcon);
149 speakButton->setIcon(tr.speakerIcon);
150 searchButton->setIcon(tr.searchIcon);
151 arrowLabel->setPixmap(tr.fromToPixmap);
152}
153
154void YACReaderTranslator::hideResults()
155{

Callers

nothing calls this directly

Calls 5

setIconMethod · 0.80
setPixmapMethod · 0.80
QStringClass · 0.50
setColorMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected