3
4
5
6
7
8
9
10
11
12
15#include <pu/ui/render/render_Renderer.hpp>
63 std::string title_font_name;
64 std::string cnt_font_name;
65 std::string opt_font_name;
68 sdl2::Texture title_tex;
69 sdl2::Texture cnt_tex;
70 std::vector<std::string> opts;
71 std::string cancel_opt;
73 i32 selected_opt_over_alpha;
74 SigmoidIncrementer<i32> selected_opt_over_alpha_incr;
75 i32 prev_selected_opt_idx;
76 i32 prev_selected_opt_over_alpha;
77 SigmoidIncrementer<i32> prev_selected_opt_over_alpha_incr;
83 u32 dialog_extra_base_width;
84 u32 dialog_border_radius;
85 u32 space_between_options;
86 u32 space_between_option_rows;
87 u32 title_extra_width;
89 u32 space_between_cnt_and_options;
95 u32 icon_extra_height;
96 u32 opts_base_h_margin;
99 u32 opt_border_radius;
100 u32 opt_bottom_margin;
101 u8 max_screen_fade_alpha;
105 u8 over_alpha_incr_steps;
106 u8 fade_alpha_incr_steps;
108 inline Color MakeDialogColor(
const u8 alpha) {
109 return this->dialog_clr.WithAlpha(alpha);
112 inline Color MakeOverColor(
const u8 alpha) {
113 return this->over_clr.WithAlpha(alpha);
121 Dialog(
const std::string &title,
const std::string &content);
128 this->cancel_opt = opt_name;
136 return !
this->cancel_opt.empty();
181 return this->icon_tex !=
nullptr;
187 return this->user_cancelled;
191 if(
this->user_cancelled) {
Definition sdl2_Types.hpp:18
Definition ui_Application.hpp:22
Definition ui_Dialog.hpp:22
static constexpr u32 DefaultIconMargin
Definition ui_Dialog.hpp:54
static constexpr Color DefaultTitleColor
Definition ui_Dialog.hpp:24
constexpr bool UserCancelled()
Definition ui_Dialog.hpp:186
void SetCancelOption(const std::string &opt_name)
Definition ui_Dialog.hpp:127
static constexpr u32 DefaultDialogExtraBaseWidth
Definition ui_Dialog.hpp:28
bool HasCancelOption()
Definition ui_Dialog.hpp:135
static constexpr u32 DefaultContentX
Definition ui_Dialog.hpp:41
static constexpr Color DefaultDialogColor
Definition ui_Dialog.hpp:59
void SetContentColor(const Color clr)
static constexpr Color DefaultContentColor
Definition ui_Dialog.hpp:25
static constexpr u32 DefaultTitleTopMargin
Definition ui_Dialog.hpp:37
static constexpr u32 DefaultOptionBorderRadius
Definition ui_Dialog.hpp:49
static constexpr u32 DefaultTitleExtraWidth
Definition ui_Dialog.hpp:34
i32 Show(Application *app_ref)
static constexpr u8 DefaultOverAlphaIncrementSteps
Definition ui_Dialog.hpp:56
static constexpr u32 DefaultOptionHorizontalMargin
Definition ui_Dialog.hpp:48
static constexpr u32 DefaultDialogBorderRadius
Definition ui_Dialog.hpp:29
static constexpr u32 DefaultSpaceBetweenContentAndOptions
Definition ui_Dialog.hpp:36
static constexpr u32 DefaultOptionsBaseHorizontalMargin
Definition ui_Dialog.hpp:46
void SetContent(const std::string &new_content)
void SetTitle(const std::string &new_title)
void SetTitleColor(const Color clr)
static constexpr u8 DefaultMaxScreenFadeAlpha
Definition ui_Dialog.hpp:52
void RemoveCancelOption()
Definition ui_Dialog.hpp:131
static constexpr Color DefaultOverColor
Definition ui_Dialog.hpp:60
static constexpr u32 DefaultOptionBottomMargin
Definition ui_Dialog.hpp:50
static constexpr u32 DefaultSpaceBetweenOptions
Definition ui_Dialog.hpp:31
void AddOption(const std::string &opt_name)
static constexpr u32 DefaultTitleX
Definition ui_Dialog.hpp:39
static constexpr u32 DefaultSpaceBetweenOptionRows
Definition ui_Dialog.hpp:32
static constexpr u32 DefaultIconExtraHeight
Definition ui_Dialog.hpp:44
static constexpr u32 DefaultContentY
Definition ui_Dialog.hpp:42
bool HasIcon()
Definition ui_Dialog.hpp:180
void SetIcon(sdl2::TextureHandle::Ref tex)
static constexpr Color DefaultOptionColor
Definition ui_Dialog.hpp:26
static constexpr u32 DefaultOptionHeight
Definition ui_Dialog.hpp:47
static constexpr u32 DefaultContentExtraWidth
Definition ui_Dialog.hpp:35
bool IsOk()
Definition ui_Dialog.hpp:190
static constexpr u32 DefaultTitleY
Definition ui_Dialog.hpp:40
static constexpr u8 DefaultFadeAlphaIncrementSteps
Definition ui_Dialog.hpp:57
Dialog(const std::string &title, const std::string &content)
Definition sdl2_Types.hpp:10
#define PU_SMART_CTOR(type)
Definition pu_Include.hpp:20
#define PU_CLASS_POD_GETSET(fn_name, var_name, type)
Definition pu_Include.hpp:37
#define PU_CLASS_POD_GET(fn_name, var_name, type)
Definition pu_Include.hpp:27
Definition ui_Types.hpp:44