struct mola::gui::SliderFloat

Overview

A floating-point slider in [min_value, max_value].

The displayed value beside the slider uses format_string (printf style, default “%.2f”).

nanogui : nanogui::Slider (0–1 normalised internally) + adjacent Label. The backend maps [min_value, max_value] ↔ [0,1] transparently. ImGui : ImGui::SliderFloat.

#include <GuiWidgetDescription.h>

struct SliderFloat
{
    // fields

    std::string label;
    float initial_value = 0.0f;
    float min_value = 0.0f;
    float max_value = 1.0f;
    std::string format_string = "%.2f";
    std::function<void(float)> on_change;
    int fixed_width = 0;
};

Fields

int fixed_width = 0

0 = auto (nanogui: setFixedWidth on slider)