feat: message box dynamic sizing, documentation page updates

This commit is contained in:
2026-04-22 20:27:55 +02:00
parent 15a092d0b4
commit 867d56b342
6 changed files with 101 additions and 25 deletions
+9 -2
View File
@@ -19,9 +19,15 @@ struct MessageBoxLayout {
namespace messagebox {
constexpr int MESSAGE_INIT_W = 460;
constexpr int MESSAGE_INIT_H = 220;
constexpr int MESSAGE_MIN_W = 300;
constexpr int MESSAGE_MAX_W = 560;
constexpr int MESSAGE_MIN_H = 124;
constexpr int MESSAGE_MAX_H = 280;
constexpr int FOOTER_H = 56;
constexpr int TEXT_X = 20;
constexpr int TEXT_Y = 24;
constexpr int TEXT_BOTTOM_GAP = 24;
constexpr int BUTTON_RIGHT_PAD = 16;
constexpr int BUTTON_W = 88;
constexpr int BUTTON_H = 30;
constexpr int BUTTON_GAP = 8;
@@ -30,6 +36,7 @@ constexpr int MAX_LINES = 7;
constexpr int MAX_LINE_LEN = 128;
void init(const char* message, uint8_t buttons, uint8_t default_choice = 0);
void preferred_size(const char* title, int* out_w, int* out_h);
void draw();
void handle_mouse(const Montauk::WinEvent& ev);
void handle_key(const Montauk::KeyEvent& key);