33#include <NDEVR/Button.h>
35class QPropertyAnimation;
40 template<
class t_type>
121 QPropertyAnimation* _anim =
nullptr;
A class that can subscribe to any number of Resources which will get updates when the Resource(s) hav...
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
The core String View class for the NDEVR API.
QSize sizeHint() const override
Returns the recommended size for the toggle widget.
QSize minimumSizeHint() const override
Returns the minimum recommended size for the toggle widget.
Toggle(QWidget *parent=nullptr)
Constructs a Toggle with an optional parent widget.
int sliderWidth() const
Returns the width of the slider track in pixels.
Toggle(const TranslatedString &name, const std::function< void(Button *)> &on_click)
Constructs a Toggle with a label and click callback.
Toggle(const std::function< void(Button *)> &on_click)
Constructs a Toggle with a click callback.
void mouseReleaseEvent(QMouseEvent *) override
Handles mouse release to toggle the checked state.
void setOffset(float o)
Sets the horizontal offset of the slider knob and triggers a repaint.
void paintEvent(QPaintEvent *) override
Custom paint handler that draws the toggle slider in touch mode.
Toggle(const TranslatedString &name, const StringView &icon, Resource< bool > &on_click)
Constructs a Toggle bound to a boolean Resource.
Toggle(const TranslatedString &name, const StringView &icon, const std::function< void(Button *)> &on_click)
Constructs a Toggle with a label, icon, and click callback.
void setupToggle()
Performs initial configuration of the toggle appearance and behavior.
int spacing() const
Returns the spacing between the slider and the label in pixels.
float offset() const
Returns the current horizontal offset of the slider knob.
int sliderHeight() const
Returns the height of the slider track in pixels.
QRect sliderRect() const
Returns the bounding rectangle of the slider knob.
void onChecked(bool checked)
Slot invoked when the checked state changes, triggers the slide animation.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.