diff --git a/include/app/RailWidget.hpp b/include/app/RailWidget.hpp
index 7535abcb..05ed7f3f 100644
--- a/include/app/RailWidget.hpp
+++ b/include/app/RailWidget.hpp
@@ -13,6 +13,7 @@ struct RailWidget : widget::TransparentWidget {
RailWidget();
~RailWidget();
+ void step() override;
void draw(const DrawArgs& args) override;
};
diff --git a/res/ComponentLibrary/Rail-dark.svg b/res/ComponentLibrary/Rail-dark.svg
new file mode 100644
index 00000000..f1f87530
--- /dev/null
+++ b/res/ComponentLibrary/Rail-dark.svg
@@ -0,0 +1,540 @@
+
+
+
diff --git a/res/ComponentLibrary/Rail-light.svg b/res/ComponentLibrary/Rail-light.svg
new file mode 100644
index 00000000..4a1f50be
--- /dev/null
+++ b/res/ComponentLibrary/Rail-light.svg
@@ -0,0 +1,564 @@
+
+
+
diff --git a/src/app/RailWidget.cpp b/src/app/RailWidget.cpp
index 93816cf1..cd7711b4 100644
--- a/src/app/RailWidget.cpp
+++ b/src/app/RailWidget.cpp
@@ -3,6 +3,7 @@
#include
#include
#include
+#include
namespace rack {
@@ -26,7 +27,6 @@ RailWidget::RailWidget() {
addChild(internal->railFb);
internal->railSw = new widget::SvgWidget;
- internal->railSw->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/Rail.svg")));
internal->railFb->addChild(internal->railSw);
}
@@ -36,6 +36,29 @@ RailWidget::~RailWidget() {
}
+void RailWidget::step() {
+ // Set rail SVG from theme
+ std::shared_ptr railSvg;
+ if (settings::uiTheme == "light") {
+ railSvg = window::Svg::load(asset::system("res/ComponentLibrary/Rail-light.svg"));
+ }
+ else if (settings::uiTheme == "dark") {
+ railSvg = window::Svg::load(asset::system("res/ComponentLibrary/Rail-dark.svg"));
+ }
+ else {
+ // Default
+ railSvg = window::Svg::load(asset::system("res/ComponentLibrary/Rail.svg"));
+ }
+
+ if (internal->railSw->svg != railSvg) {
+ internal->railSw->setSvg(railSvg);
+ internal->railFb->setDirty();
+ }
+
+ TransparentWidget::step();
+}
+
+
void RailWidget::draw(const DrawArgs& args) {
if (!internal->railSw->svg)
return;