mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Extend SliderOption instead of duplicating code
This commit is contained in:
@@ -222,20 +222,7 @@ struct ResizableSplitOption {
|
||||
template <typename T>
|
||||
struct SliderOption {
|
||||
Ref<T> value;
|
||||
ConstRef<T> min = T(0);
|
||||
ConstRef<T> max = T(100);
|
||||
ConstRef<T> increment = (max() - min()) / 20;
|
||||
Direction direction = Direction::Right;
|
||||
Color color_active = Color::White;
|
||||
Color color_inactive = Color::GrayDark;
|
||||
};
|
||||
|
||||
// @brief Option for the `SliderWithCallback` component.
|
||||
// @ingroup component
|
||||
template <typename T>
|
||||
struct SliderWithCallbackOption {
|
||||
std::function<void(T)> callback;
|
||||
Ref<T> value;
|
||||
std::function<void(T)> callback = nullptr;
|
||||
ConstRef<T> min = T(0);
|
||||
ConstRef<T> max = T(100);
|
||||
ConstRef<T> increment = (max() - min()) / 20;
|
||||
|
||||
Reference in New Issue
Block a user