UI: Minimum Width for Large Confirmation Dialogs #119978

Merged
Harley Acheson merged 1 commits from Harley/blender:LargeConfirmMinWidth into main 2024-03-27 22:28:12 +01:00
1 changed files with 5 additions and 1 deletions

View File

@ -1681,8 +1681,12 @@ int WM_operator_confirm_ex(bContext *C,
{
wmOpPopUp *data = MEM_new<wmOpPopUp>(__func__);
data->op = op;
data->width = int(180.0f * UI_SCALE_FAC * UI_style_get()->widgetlabel.points /
/* Larger dialog needs a wider minimum width to balance with the big icon. */
const float min_width = (message == nullptr) ? 180.0f : 230.0f;
data->width = int(min_width * UI_SCALE_FAC * UI_style_get()->widgetlabel.points /
UI_DEFAULT_TEXT_POINTS);
data->free_op = true;
data->title = (title == nullptr) ? WM_operatortype_name(op->type, op->ptr) : title;
data->message = (message == nullptr) ? std::string() : message;