![]() |
StoneyVCV v2
StoneyDSP Modules for VCV Rack 2.
|
The ThemedWidget
struct.
More...
#include <Widget.hpp>
Classes | |
struct | PrefersDarkPanelsChangeEvent |
Occurs after the prefersDarkPanels setting is changed. More... | |
Public Types | |
using | DrawArgs = ::StoneyDSP::StoneyVCV::ComponentLibrary::Widget::DrawArgs |
![]() | |
using | DrawArgs = ::rack::widget::Widget::DrawArgs |
Public Member Functions | |
ThemedWidget () | |
Construct a new ThemedWidget object. | |
ThemedWidget (::rack::math::Rect newBox) | |
Construct a new ThemedWidget object with its' position and size set using a rack::math::Rect . | |
virtual | ~ThemedWidget () noexcept |
Destroys the ThemedWidget object. | |
virtual void | step () override |
Advances the module by one frame. | |
virtual void | draw (const ::StoneyDSP::StoneyVCV::ComponentLibrary::ThemedWidget::DrawArgs &args) override |
Draws a themed background color to the widget's NanoVG context. | |
const bool & | getPrefersDarkPanels () const noexcept |
virtual void | onPrefersDarkPanelsChange (const PrefersDarkPanelsChangeEvent &e) |
Called after the prefersDarkPanels setting is changed. | |
![]() | |
Widget () | |
Construct a new Widget object. | |
Widget (::rack::math::Rect newBox) | |
Construct a new Widget object with its' position and size set using a rack::math::Rect . | |
virtual | ~Widget () noexcept |
Destroys the Widget object. | |
virtual void | onPixelRatioChange (const PixelRatioChangeEvent &e) |
Called after the App->window->pixelRatio setting is changed. | |
const float & | getPixelRatio () const noexcept |
Protected Attributes | |
bool | lastPrefersDarkPanels = {::rack::settings::preferDarkPanels} |
![]() | |
::rack::math::Rect | box = ::rack::math::Rect(::rack::math::Vec(), ::rack::math::Vec(INFINITY, INFINITY)) |
Position relative to parent and size of Widget . | |
::rack::Widget * | parent = NULL |
Automatically set when Widget is added as a child to another Widget . | |
::std::list<::rack::Widget * > | children |
bool | visible = true |
Disables rendering but allow stepping. | |
bool | requestedDelete = false |
If set to true, parent will delete Widget in the next step() . | |
float | lastPixelRatio = { rack::contextGet() ->window->pixelRatio} |
const float * | pixelRatioPtr = NULL |
Private Member Functions | |
ThemedWidget (const ThemedWidget &)=delete | |
ThemedWidget & | operator= (const ThemedWidget &)=delete |
ThemedWidget (ThemedWidget &&)=delete | |
ThemedWidget & | operator= (ThemedWidget &&)=delete |
Private Attributes | |
const bool * | prefersDarkPanelsPtr = NULL |
{&::rack::settings::preferDarkPanels}; | |
The ThemedWidget
struct.
using StoneyDSP::StoneyVCV::ComponentLibrary::ThemedWidget::DrawArgs = ::StoneyDSP::StoneyVCV::ComponentLibrary::Widget::DrawArgs |
StoneyDSP::StoneyVCV::ComponentLibrary::ThemedWidget::ThemedWidget | ( | ) |
Construct a new ThemedWidget
object.
StoneyDSP::StoneyVCV::ComponentLibrary::ThemedWidget::ThemedWidget | ( | ::rack::math::Rect | newBox | ) |
Construct a new ThemedWidget
object with its' position and size set using a rack::math::Rect
.
|
virtualnoexcept |
Destroys the ThemedWidget
object.
|
privatedelete |
|
privatedelete |
Advances the module by one frame.
Calls the superclass's step()
to recurse the children.
Reimplemented from StoneyDSP::StoneyVCV::ComponentLibrary::Widget.
Reimplemented in StoneyDSP::StoneyVCV::ComponentLibrary::ThemedPanelWidget, and StoneyDSP::StoneyVCV::VCA::VCAPanelWidget.
|
overridevirtual |
Draws a themed background color to the widget's NanoVG context.
Calls the superclass's draw(args)
to recurse to children.
args |
Reimplemented from StoneyDSP::StoneyVCV::ComponentLibrary::Widget.
Reimplemented in StoneyDSP::StoneyVCV::ComponentLibrary::ThemedPanelWidget, and StoneyDSP::StoneyVCV::VCA::VCAPanelWidget.
|
noexcept |
|
inlinevirtual |
Called after the prefersDarkPanels
setting is changed.
Sub-classes can override this to receive callbacks when the event is dispatched (from the ThemedWidget::step()
method).
e |
Reimplemented in StoneyDSP::StoneyVCV::ComponentLibrary::ThemedPanelWidget.
|
privatedelete |
|
privatedelete |
|
protected |
|
private |
{&::rack::settings::preferDarkPanels};