Ignore dynamic light/dark mode in headless builds

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-10-10 21:37:27 +01:00
parent e4840dfbf0
commit 930a0ca31e
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
3 changed files with 24 additions and 0 deletions

View file

@ -31,8 +31,10 @@
namespace rack {
namespace asset {
#ifndef HEADLESS
extern bool forceBlackScrew;
extern bool forceSilverScrew;
#endif
std::string userDir; // ignored
std::string systemDir; // points to plugin resources dir (or installed/local Rack dir)
@ -53,10 +55,12 @@ std::string user(std::string filename) {
// get system resource, trimming "res/" prefix if we are loaded as a plugin bundle
std::string system(std::string filename) {
#ifndef HEADLESS
/**/ if (forceBlackScrew && string::endsWith(filename, "/ScrewBlack.svg"))
filename = filename.substr(0, filename.size()-15) + "/./ScrewBlack.svg";
else if (forceSilverScrew && string::endsWith(filename, "/ScrewSilver.svg"))
filename = filename.substr(0, filename.size()-16) + "/./ScrewSilver.svg";
#endif
return system::join(systemDir, bundlePath.empty() ? filename : trim(filename));
}