WidgetTheme* WidgetThemeManager::getThemeFromPropertyList(cefix::PropertyList* pl) { WidgetTheme* theme = getCurrentTheme(); if (pl->hasKey("customTheme")) { std::string tn(pl->get("customTheme")->asString()); if ( hasTheme(tn) ) theme = get(tn); else { log::info("WidgetThemeManager::getThemeFromPropertyList") << "theme " << tn << " not found, using current " << std::endl; } } return theme; }
void SelectWnd::setCurrent () { lbThemes->selectionModel()->clear(); QString ct = getCurrentTheme(); mAppliedIndex = mModel->defaultIndex(); if (!ct.isEmpty()) mAppliedIndex = mModel->findIndex(ct); else mAppliedIndex = mModel->defaultIndex(); if (mAppliedIndex.isValid()) { const XCursorThemeData *theme = mModel->theme(mAppliedIndex); // Select the current theme selectRow(mAppliedIndex); lbThemes->scrollTo(mAppliedIndex, QListView::PositionAtCenter); // Update the preview widget as well if (theme) preview->setTheme(*theme);// else preview->clearTheme(); } }