Add the ability to select custom themes in the settings dialog (#4570)
Themes are loaded from the Themes directory (under the Chatterino directory, so %APPDATA%/Chatterino2/Themes). Themes are json files (see the built in themes as an example). After importing a theme, you must restart Chatterino for it to show up in the settings
This commit is contained in:
@@ -114,8 +114,18 @@ void GeneralPage::initLayout(GeneralPageView &layout)
|
||||
auto &s = *getSettings();
|
||||
|
||||
layout.addTitle("Interface");
|
||||
layout.addDropdown("Theme", {"White", "Light", "Dark", "Black"},
|
||||
getApp()->themes->themeName);
|
||||
|
||||
layout.addDropdown<QString>(
|
||||
"Theme", getApp()->themes->availableThemes(),
|
||||
getApp()->themes->themeName,
|
||||
[](const auto *combo, const auto &themeKey) {
|
||||
return combo->findData(themeKey, Qt::UserRole);
|
||||
},
|
||||
[](const auto &args) {
|
||||
return args.combobox->itemData(args.index, Qt::UserRole).toString();
|
||||
},
|
||||
{}, Theme::fallbackTheme.name);
|
||||
|
||||
layout.addDropdown<QString>(
|
||||
"Font", {"Segoe UI", "Arial", "Choose..."},
|
||||
getApp()->fonts->chatFontFamily,
|
||||
|
||||
Reference in New Issue
Block a user