MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / ApplyApplicationFont

Method ApplyApplicationFont

AdaptixClient/Source/MainAdaptix.cpp:241–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void MainAdaptix::ApplyApplicationFont() const
242{
243 if (!qlementineStyle)
244 return;
245
246 QString appFontFamily = settings->data.FontFamily;
247 if (appFontFamily.contains(" - "))
248 appFontFamily = appFontFamily.split("-")[1].trimmed();
249
250 appFontFamily = FontManager::instance().resolveFamily(appFontFamily);
251
252 QFont testFont(appFontFamily);
253 QFontInfo testInfo(testFont);
254 if (testInfo.family() != appFontFamily && !testInfo.family().startsWith(appFontFamily)) {
255 appFontFamily = FontManager::instance().resolveFamily("JetBrains Mono");
256 }
257
258 int appFontSize = settings->data.FontSize;
259
260 auto theme = qlementineStyle->theme();
261
262 theme.fontRegular.setFamily(appFontFamily);
263 theme.fontRegular.setPointSize(appFontSize);
264
265 theme.fontBold.setFamily(appFontFamily);
266 theme.fontBold.setPointSize(appFontSize);
267
268 theme.fontH1.setFamily(appFontFamily);
269 theme.fontH2.setFamily(appFontFamily);
270 theme.fontH3.setFamily(appFontFamily);
271 theme.fontH4.setFamily(appFontFamily);
272 theme.fontH5.setFamily(appFontFamily);
273
274 theme.fontCaption.setFamily(appFontFamily);
275
276 theme.fontMonospace.setFamily(appFontFamily);
277 theme.fontMonospace.setPointSize(appFontSize);
278
279 qlementineStyle->setTheme(theme);
280 QApplication::setFont(theme.fontRegular);
281}

Callers 1

onApplyMethod · 0.80

Calls 4

resolveFamilyMethod · 0.80
startsWithMethod · 0.80
containsMethod · 0.45
setThemeMethod · 0.45

Tested by

no test coverage detected