From 2445dc03d33cfcfcb1882c24b4c662ae6f675fd5 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Wed, 2 Jun 2021 21:11:23 +0200 Subject: [PATCH] Add "long" to slider. --- include/ftxui/component/component.hpp | 2 +- src/ftxui/component/slider.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/ftxui/component/component.hpp b/include/ftxui/component/component.hpp index 8bddb2c..ff7085a 100644 --- a/include/ftxui/component/component.hpp +++ b/include/ftxui/component/component.hpp @@ -31,7 +31,7 @@ Component Input(StringRef content, ConstStringRef placeholder); Component Menu(const std::vector* entries, int* selected_); Component Radiobox(const std::vector* entries, int* selected_); Component Toggle(const std::vector* entries, int* selected); -template // T = {int, float} +template // T = {int, float, long} Component Slider(StringRef label, T* value, T min, T max, T increment); Component Renderer(Component child, std::function); Component Renderer(std::function); diff --git a/src/ftxui/component/slider.cpp b/src/ftxui/component/slider.cpp index 0ec1091..ff50c16 100644 --- a/src/ftxui/component/slider.cpp +++ b/src/ftxui/component/slider.cpp @@ -134,6 +134,12 @@ template Component Slider(StringRef label, float max, float increment); +template Component Slider(StringRef label, + long* value, + long min, + long max, + long increment); + } // namespace ftxui // Copyright 2020 Arthur Sonzogni. All rights reserved.