commit 0d3498fb6803819eabf55c09269174c4f67e3ea4
parent 734441f045be4fd79c6cb890b3151490ad6e4edf
Author: Matt Demanett <matt@demanett.net>
Date: Thu, 29 Mar 2018 22:28:42 -0400
Tone down the knob/port shadows.
Diffstat:
M | src/widgets.cpp | | | 53 | +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
M | src/widgets.hpp | | | 58 | ++++++++++++++++++---------------------------------------- |
2 files changed, 71 insertions(+), 40 deletions(-)
diff --git a/src/widgets.cpp b/src/widgets.cpp
@@ -3,6 +3,55 @@
using namespace bogaudio;
+Button18::Button18() {
+ addFrame(SVG::load(assetPlugin(plugin, "res/button_18px_0.svg")));
+ addFrame(SVG::load(assetPlugin(plugin, "res/button_18px_1.svg")));
+ box.size = Vec(18, 18);
+}
+
+
+BGKnob::BGKnob(const char* svg, int dim) {
+ setSVG(SVG::load(assetPlugin(plugin, svg)));
+ box.size = Vec(dim, dim);
+ shadow->blurRadius = 2.0;
+ // k->shadow->opacity = 0.15;
+ shadow->box.pos = Vec(0.0, 3.0); // Vec(0.0, box.size.y * 0.1);
+}
+
+
+Knob16::Knob16() : BGKnob("res/knob_16px.svg", 16) {
+}
+
+
+Knob26::Knob26() : BGKnob("res/knob_26px.svg", 26) {
+}
+
+
+Knob29::Knob29() : BGKnob("res/knob_29px.svg", 29) {
+}
+
+
+Knob38::Knob38() : BGKnob("res/knob_38px.svg", 38) {
+}
+
+
+Knob68::Knob68() : BGKnob("res/knob_68px.svg", 68) {
+}
+
+
+Port24::Port24() {
+ setSVG(SVG::load(assetPlugin(plugin, "res/port.svg")));
+ box.size = Vec(24, 24);
+ shadow->box.pos = Vec(0.0, 1.3);
+}
+
+
+SliderSwitch2State14::SliderSwitch2State14() {
+ addFrame(SVG::load(assetPlugin(plugin, "res/slider_switch_2_14px_0.svg")));
+ addFrame(SVG::load(assetPlugin(plugin, "res/slider_switch_2_14px_1.svg")));
+}
+
+
StatefulButton::StatefulButton(const char* offSVGPath, const char* onSVGPath) {
_svgWidget = new SVGWidget();
addChild(_svgWidget);
@@ -35,3 +84,7 @@ void StatefulButton::onDragEnd(EventDragEnd& e) {
_svgWidget->setSVG(_frames[0]);
dirty = true;
}
+
+
+StatefulButton9::StatefulButton9() : StatefulButton("res/button_9px_0.svg", "res/button_9px_1.svg") {
+}
diff --git a/src/widgets.hpp b/src/widgets.hpp
@@ -7,61 +7,39 @@ extern Plugin *plugin;
namespace bogaudio {
struct Button18 : SVGSwitch, MomentarySwitch {
- Button18() {
- addFrame(SVG::load(assetPlugin(plugin, "res/button_18px_0.svg")));
- addFrame(SVG::load(assetPlugin(plugin, "res/button_18px_1.svg")));
- box.size = Vec(18, 18);
- }
+ Button18();
};
-struct Knob16 : RoundKnob {
- Knob16() {
- setSVG(SVG::load(assetPlugin(plugin, "res/knob_16px.svg")));
- box.size = Vec(16, 16);
- }
+struct BGKnob : RoundKnob {
+ BGKnob(const char* svg, int dim);
};
-struct Knob26 : RoundKnob {
- Knob26() {
- setSVG(SVG::load(assetPlugin(plugin, "res/knob_26px.svg")));
- box.size = Vec(26, 26);
- }
+struct Knob16 : BGKnob {
+ Knob16();
};
-struct Knob29 : RoundKnob {
- Knob29() {
- setSVG(SVG::load(assetPlugin(plugin, "res/knob_29px.svg")));
- box.size = Vec(29, 29);
- }
+struct Knob26 : BGKnob {
+ Knob26();
};
-struct Knob38 : RoundKnob {
- Knob38() {
- setSVG(SVG::load(assetPlugin(plugin, "res/knob_38px.svg")));
- box.size = Vec(38, 38);
- }
+struct Knob29 : BGKnob {
+ Knob29();
};
-struct Knob68 : RoundKnob {
- Knob68() {
- setSVG(SVG::load(assetPlugin(plugin, "res/knob_68px.svg")));
- box.size = Vec(68, 68);
- }
+struct Knob38 : BGKnob {
+ Knob38();
+};
+
+struct Knob68 : BGKnob {
+ Knob68();
};
struct Port24 : SVGPort {
- Port24() {
- background->svg = SVG::load(assetPlugin(plugin, "res/port.svg"));
- background->wrap();
- box.size = Vec(24, 24);
- }
+ Port24();
};
struct SliderSwitch2State14 : SVGSwitch, ToggleSwitch {
- SliderSwitch2State14() {
- addFrame(SVG::load(assetPlugin(plugin, "res/slider_switch_2_14px_0.svg")));
- addFrame(SVG::load(assetPlugin(plugin, "res/slider_switch_2_14px_1.svg")));
- }
+ SliderSwitch2State14();
};
struct StatefulButton : ParamWidget, FramebufferWidget {
@@ -75,7 +53,7 @@ struct StatefulButton : ParamWidget, FramebufferWidget {
};
struct StatefulButton9 : StatefulButton {
- StatefulButton9() : StatefulButton("res/button_9px_0.svg", "res/button_9px_1.svg") {}
+ StatefulButton9();
};
} // namespace bogaudio