1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make button sprites (scrollbar arrows) DPI-aware (#14772)

This commit is contained in:
grorp 2024-06-26 15:25:27 +02:00 committed by GitHub
parent fb6ceb2664
commit 4c001bd248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 67 additions and 61 deletions

View file

@ -92,7 +92,7 @@ public:
*/
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
video::SColor color = video::SColor(255, 255, 255, 255),
bool loop = false, bool scale = false) override;
bool loop = false) override;
//! Get the sprite-index for the given state or -1 when no sprite is set
s32 getSpriteIndex(EGUI_BUTTON_STATE state) const override;
@ -103,9 +103,6 @@ public:
//! Returns if the sprite in the given state does loop
bool getSpriteLoop(EGUI_BUTTON_STATE state) const override;
//! Returns if the sprite in the given state is scaled
bool getSpriteScale(EGUI_BUTTON_STATE state) const override;
//! Sets if the button should behave like a push button. Which means it
//! can be in two states: Normal or Pressed. With a click on the button,
//! the user can change the state of the button.
@ -158,19 +155,18 @@ private:
struct ButtonSprite
{
ButtonSprite() :
Index(-1), Loop(false), Scale(false)
Index(-1), Loop(false)
{
}
bool operator==(const ButtonSprite &other) const
{
return Index == other.Index && Color == other.Color && Loop == other.Loop && Scale == other.Scale;
return Index == other.Index && Color == other.Color && Loop == other.Loop;
}
s32 Index;
video::SColor Color;
bool Loop;
bool Scale;
};
ButtonSprite ButtonSprites[EGBS_COUNT];