You've already forked pico-launcher
mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-01-09 16:28:48 -08:00
Initial commit
This commit is contained in:
29
arm9/source/themes/ThemeFactory.cpp
Normal file
29
arm9/source/themes/ThemeFactory.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "common.h"
|
||||
#include "material/MaterialTheme.h"
|
||||
#include "custom/CustomTheme.h"
|
||||
#include "ThemeFactory.h"
|
||||
|
||||
std::unique_ptr<ITheme> ThemeFactory::CreateFromThemeInfo(const ThemeInfo* themeInfo) const
|
||||
{
|
||||
switch (themeInfo->GetType())
|
||||
{
|
||||
case ThemeType::Material:
|
||||
{
|
||||
return std::make_unique<MaterialTheme>(
|
||||
themeInfo->GetFolderName(),
|
||||
themeInfo->GetPrimaryColor(),
|
||||
themeInfo->GetIsDarkTheme());
|
||||
}
|
||||
case ThemeType::Custom:
|
||||
{
|
||||
return std::make_unique<CustomTheme>(
|
||||
themeInfo->GetFolderName(),
|
||||
themeInfo->GetPrimaryColor(),
|
||||
themeInfo->GetIsDarkTheme());
|
||||
}
|
||||
default:
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user