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

Method applyTheme

YACReaderLibrary/folder_content_view.cpp:267–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void FolderContentView::applyTheme(const Theme &theme)
268{
269 QQmlContext *ctxt = view->rootContext();
270 const auto &giv = theme.gridAndInfoView;
271
272 toolbar->setStyleSheet(theme.comicsViewToolbar.toolbarQSS);
273
274 // Continue reading section colors
275 ctxt->setContextProperty("continueReadingBackgroundColor", giv.continueReadingBackgroundColor);
276 ctxt->setContextProperty("continueReadingTextColor", giv.continueReadingTextColor);
277
278 // Grid colors
279 ctxt->setContextProperty("backgroundColor", giv.backgroundColor);
280 ctxt->setContextProperty("cellColor", giv.cellColor);
281 ctxt->setContextProperty("cellSelectedColor", giv.cellSelectedColor);
282 ctxt->setContextProperty("cellSelectedBorderColor", giv.cellSelectedBorderColor);
283 ctxt->setContextProperty("borderColor", giv.borderColor);
284 ctxt->setContextProperty("itemTitleColor", giv.itemTitleColor);
285 ctxt->setContextProperty("itemDetailsColor", giv.itemDetailsColor);
286 ctxt->setContextProperty("dropShadow", QVariant(giv.showDropShadow));
287
288 // Info panel colors
289 ctxt->setContextProperty("infoBackgroundColor", giv.infoBackgroundColor);
290 ctxt->setContextProperty("infoMetadataTextColor", giv.infoMetadataTextColor);
291 ctxt->setContextProperty("infoTextColor", giv.infoTextColor);
292
293 // Rating and favorite colors
294 ctxt->setContextProperty("ratingUnselectedColor", giv.ratingUnselectedColor);
295 ctxt->setContextProperty("ratingSelectedColor", giv.ratingSelectedColor);
296 ctxt->setContextProperty("favUncheckedColor", giv.favUncheckedColor);
297 ctxt->setContextProperty("favCheckedColor", giv.favCheckedColor);
298 ctxt->setContextProperty("readTickUncheckedColor", giv.readTickUncheckedColor);
299 ctxt->setContextProperty("readTickCheckedColor", giv.readTickCheckedColor);
300
301 // New item indicator, cover borders, placeholder pages, scrollbar
302 ctxt->setContextProperty("newItemColor", giv.newItemColor);
303 ctxt->setContextProperty("scrollbarColor", giv.scrollbarColor);
304 ctxt->setContextProperty("scrollbarBorderColor", giv.scrollbarBorderColor);
305 ctxt->setContextProperty("comicCoverBorderColor", giv.comicCoverBorderColor);
306 ctxt->setContextProperty("folderCoverBorderColor", giv.folderCoverBorderColor);
307 ctxt->setContextProperty("placeholderFolder1Color", giv.placeholderFolder1Color);
308 ctxt->setContextProperty("placeholderFolder1BorderColor", giv.placeholderFolder1BorderColor);
309 ctxt->setContextProperty("placeholderFolder2Color", giv.placeholderFolder2Color);
310 ctxt->setContextProperty("placeholderFolder2BorderColor", giv.placeholderFolder2BorderColor);
311
312 // Update zoom slider icons
313 if (smallZoomLabel) {
314 smallZoomLabel->setPixmap(theme.comicsViewToolbar.smallGridZoomIcon.pixmap(18, 18));
315 }
316 if (bigZoomLabel) {
317 bigZoomLabel->setPixmap(theme.comicsViewToolbar.bigGridZoomIcon.pixmap(18, 18));
318 }
319}

Callers

nothing calls this directly

Calls 2

setPixmapMethod · 0.80
pixmapMethod · 0.80

Tested by

no test coverage detected