Small refactoring of CarouselComponent and TextListComponent.

This commit is contained in:
Leon Styhre 2022-11-06 21:28:15 +01:00
parent bbc996f66e
commit 5bedb7a8fa
2 changed files with 9 additions and 9 deletions

View file

@ -66,14 +66,14 @@ public:
return mLetterCaseGroupedCollections;
}
void setCursorChangedCallback(const std::function<void(CursorState state)>& func) override
{
mCursorChangedCallback = func;
}
void setCancelTransitionsCallback(const std::function<void()>& func) override
{
mCancelTransitionsCallback = func;
}
void setCursorChangedCallback(const std::function<void(CursorState state)>& func) override
{
mCursorChangedCallback = func;
}
bool input(InputConfig* config, Input input) override;
void update(int deltaTime) override;

View file

@ -57,14 +57,14 @@ public:
void setAlignment(PrimaryAlignment align) override { mAlignment = align; }
void setCursorChangedCallback(const std::function<void(CursorState state)>& func) override
{
mCursorChangedCallback = func;
}
void setCancelTransitionsCallback(const std::function<void()>& func) override
{
mCancelTransitionsCallback = func;
}
void setCursorChangedCallback(const std::function<void(CursorState state)>& func) override
{
mCursorChangedCallback = func;
}
void setFont(const std::shared_ptr<Font>& font)
{
@ -111,6 +111,7 @@ private:
Renderer* mRenderer;
std::function<void()> mCancelTransitionsCallback;
std::function<void(CursorState state)> mCursorChangedCallback;
float mCamOffset;
int mPreviousScrollVelocity;
@ -122,7 +123,6 @@ private:
PrimaryAlignment mAlignment;
float mHorizontalMargin;
std::function<void(CursorState state)> mCursorChangedCallback;
ImageComponent mSelectorImage;
std::shared_ptr<Font> mFont;