From 36b537365b6faa309ec7b521720a0cf9ece9d422 Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Wed, 15 Jul 2026 11:47:45 +0800 Subject: [PATCH] feat(ui): add int slider support and fix update_text_scale calls --- include/Cubed/ui/slider.hpp | 13 ++++++++-- src/ui/slider.cpp | 52 ++++++++++++++++++++++++++++--------- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/include/Cubed/ui/slider.hpp b/include/Cubed/ui/slider.hpp index 5f6f9b0..3cccfb6 100644 --- a/include/Cubed/ui/slider.hpp +++ b/include/Cubed/ui/slider.hpp @@ -5,12 +5,18 @@ #include "Cubed/ui/widget.hpp" namespace Cubed { + +enum class ValueType { + FLOAT, + INT, +}; + class Slider : public Widget { public: Slider(Widget* parent); Slider& set_slider(float* value, const float& min, const float& max); - + Slider& set_slider(int* value, const int& min, const int& max); float width() const override; float height() const override; @@ -33,16 +39,19 @@ private: std::unique_ptr m_track; std::unique_ptr m_thumb; std::unique_ptr