Add option to disable loading SCSS directly

This commit is contained in:
scorpion-26 2024-04-14 17:56:02 +02:00
parent ddee5aa1ad
commit 7948fa073b
4 changed files with 17 additions and 7 deletions

View file

@ -12,6 +12,11 @@
# - foo\nbar -> "foo<newline>bar"
# - foo\sbar -> "foo bar"
# If true, gBar ignores *.scss files and only tries to load *.css files.
# This is useful, if you don't want to SCSS, or if you want to use newer SCSS features,
# that libsass (the backend gBar uses) doesn't support.
ForceCSS: false
# The following three options control the ordering of the widgets.
# Reordering can cause slight margin inconsistencies,
# so it is recommend to only make minor adjustments to the default layout.

View file

@ -111,6 +111,8 @@ namespace CSS
}
for (auto& dir : locations)
{
if (!Config::Get().forceCSS)
{
if (CompileAndLoadSCSS(dir + "/style.scss"))
{
@ -121,6 +123,7 @@ namespace CSS
{
LOG("Warning: Failed loading SCSS, falling back to CSS!");
}
}
if (LoadCSS(dir + "/style.css"))
{

View file

@ -283,6 +283,7 @@ void Config::Load(const std::string& overrideConfigLocation)
AddConfigVar("MicHighIcon", config.micHighIcon, lineView, foundProperty);
AddConfigVar("PackageOutOfDateIcon", config.packageOutOfDateIcon, lineView, foundProperty);
AddConfigVar("ForceCSS", config.forceCSS, lineView, foundProperty);
AddConfigVar("CenterWidgets", config.centerWidgets, lineView, foundProperty);
AddConfigVar("AudioInput", config.audioInput, lineView, foundProperty);
AddConfigVar("AudioRevealer", config.audioRevealer, lineView, foundProperty);

View file

@ -54,6 +54,7 @@ public:
std::string checkPackagesCommand =
"p=\"$(checkupdates)\"; e=$?; if [ $e -eq 127 ] ; then exit 127; fi; if [ $e -eq 2 ] ; then echo \"0\" && exit 0; fi; echo \"$p\" | wc -l";
bool forceCSS = false; // Whether to disable loading SCSS directly.
bool centerWidgets = true; // Force the center widgets to be in the center.
bool audioRevealer = false;
bool audioInput = false;