Add min_size and max_size options to ResizableSplit component (#1132)
Some checks failed
Build / Bazel, cl, windows-latest (push) Has been cancelled
Build / Bazel, clang++, macos-latest (push) Has been cancelled
Build / Bazel, clang++, ubuntu-latest (push) Has been cancelled
Build / Bazel, g++, macos-latest (push) Has been cancelled
Build / Bazel, g++, ubuntu-latest (push) Has been cancelled
Build / CMake, cl, windows-latest (push) Has been cancelled
Build / CMake, gcc, ubuntu-latest (push) Has been cancelled
Build / CMake, llvm, ubuntu-latest (push) Has been cancelled
Build / CMake, llvm, macos-latest (push) Has been cancelled
Build / Test modules (llvm, ubuntu-latest) (push) Has been cancelled
Documentation / documentation (push) Has been cancelled

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>



Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
Bug:https://github.com/ArthurSonzogni/FTXUI/issues/1131
Bug:https://github.com/ArthurSonzogni/FTXUI/discussions/1130
This commit is contained in:
Copilot
2025-10-18 11:17:59 +02:00
committed by GitHub
parent e858bf9809
commit 252ce67830
6 changed files with 194 additions and 56 deletions

View File

@@ -11,6 +11,7 @@
#include <ftxui/util/ref.hpp> // for Ref, ConstRef, StringRef
#include <ftxui/util/warn_windows_macro.hpp>
#include <functional> // for function
#include <limits> // for numeric_limits
#include <string> // for string
#include "ftxui/component/component_base.hpp" // for Component
@@ -217,6 +218,10 @@ struct ResizableSplitOption {
(direction() == Direction::Left || direction() == Direction::Right) ? 20
: 10;
std::function<Element()> separator_func = [] { return ::ftxui::separator(); };
// Constraints on main_size:
Ref<int> min = 0;
Ref<int> max = std::numeric_limits<int>::max();
};
// @brief Option for the `Slider` component.