mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Initial commit
This commit is contained in:
17
arm9/source/themes/Theme.cpp
Normal file
17
arm9/source/themes/Theme.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "common.h"
|
||||
#include "core/mini-printf.h"
|
||||
#include "material/MaterialColorSchemeFactory.h"
|
||||
#include "Theme.h"
|
||||
|
||||
Theme::Theme(const TCHAR* folderName, const Rgb<8, 8, 8>& primaryColor, bool darkMode)
|
||||
: _folderName(folderName)
|
||||
{
|
||||
MaterialColorSchemeFactory::FromPrimaryColor(primaryColor, darkMode, _materialColorScheme);
|
||||
}
|
||||
|
||||
bool Theme::OpenThemeFile(File& file, const TCHAR* subPath) const
|
||||
{
|
||||
TCHAR pathBuffer[128];
|
||||
mini_snprintf(pathBuffer, sizeof(pathBuffer), "/_pico/themes/%s/%s", _folderName.GetString(), subPath);
|
||||
return file.Open(pathBuffer, FA_OPEN_EXISTING | FA_READ) == FR_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user