Loading...
Searching...
No Matches
InputSettings.h
Go to the documentation of this file.
1//
2// InputSettings.h
3//
4
5#ifndef MALENA_INPUTSETTINGS_H
6#define MALENA_INPUTSETTINGS_H
7
8#pragma once
9
13#include <cstddef>
14
15namespace ml
16{
27 {
28 sf::Vector2f size = {200.f, 36.f};
29 std::size_t maxLength = 0;
30 bool passwordMode = false;
31 char32_t passwordChar = U'\u2022';
32
33 // ── Assignment from parent levels ─────────────────────────────────────
34
36 { static_cast<ControlSettings&>(*this) = c; return *this; }
37
39 { static_cast<ControlSettings&>(*this) = g; return *this; }
40
41 // ── Getters / setters ─────────────────────────────────────────────────
42
43 [[nodiscard]] sf::Vector2f getSize() const { return size; }
44 [[nodiscard]] std::size_t getMaxLength() const { return maxLength; }
45 [[nodiscard]] bool isPasswordMode() const { return passwordMode; }
46 [[nodiscard]] char32_t getPasswordChar() const { return passwordChar; }
47
48 void setSize(const sf::Vector2f& s) { size = s; }
49 void setMaxLength(std::size_t n) { maxLength = n; }
50 void setPasswordMode(bool b) { passwordMode = b; }
51 void setPasswordChar(char32_t c) { passwordChar = c; }
52 };
53
54} // namespace ml
55
56#endif // MALENA_INPUTSETTINGS_H
Definition Component.h:22
Vector2< float > Vector2f
Settings trait for interactive UI controls — layout only.
Base settings trait for all visual components — geometry only.
Layout and behaviour settings shared by all input controls.
InputSettings & operator=(const GraphicSettings &g)
void setPasswordMode(bool b)
void setSize(const sf::Vector2f &s)
char32_t passwordChar
Bullet •
sf::Vector2f getSize() const
InputSettings & operator=(const ControlSettings &c)
char32_t getPasswordChar() const
std::size_t getMaxLength() const
bool isPasswordMode() const
void setMaxLength(std::size_t n)
std::size_t maxLength
0 = unlimited
sf::Vector2f size
void setPasswordChar(char32_t c)