Make ui::TitleView use ui::Transition for scrolling.

This commit is contained in:
J-D-K
2025-10-04 20:57:27 -04:00
parent c29d874d5a
commit fd655de1d0
6 changed files with 41 additions and 24 deletions

View File

@@ -5,6 +5,7 @@
#include "ui/ColorMod.hpp"
#include "ui/Element.hpp"
#include "ui/TitleTile.hpp"
#include "ui/Transition.hpp"
#include <vector>
@@ -49,8 +50,8 @@ namespace ui
/// @brief Pointer to user passed.
data::User *m_user{};
/// @brief Y coordinate.
double m_y = 32.0f;
/// @brief Transition used for animating the scrolling.
ui::Transition m_transition{};
/// @brief Currently highlighted/selected title.
int m_selected{};

View File

@@ -99,7 +99,10 @@ namespace ui
/// @brief Sets the threshold before snapping occurs.
void set_threshold(int threshold) noexcept;
static inline int DEFAULT_THRESHOLD = 2;
/// @brief Updates the scaling for all transitions.
static void update_scaling() noexcept;
static inline int DEFAULT_THRESHOLD = 1;
private:
/// @brief Current X.
@@ -130,7 +133,7 @@ namespace ui
double m_threshold{};
/// @brief Scaling from config.
double m_scaling{};
static inline double sm_scaling{};
void update_x_coord() noexcept;