UI: Decrease Alert Dialog Icon Size

Decrease the size of the icons shown on the large dialogs and
confirmations from 64 pixels (at 1X resolution scale) to 40.

Pull Request: https://projects.blender.org/blender/blender/pulls/134302
This commit is contained in:
Harley Acheson
2025-02-12 18:30:52 +01:00
committed by Harley Acheson
parent 33db2d372f
commit 497f2884e8
4 changed files with 26 additions and 17 deletions

View File

@@ -6485,7 +6485,7 @@ uiLayout *uiItemsAlertBox(uiBlock *block,
uiLayout *uiItemsAlertBox(uiBlock *block, const int size, const eAlertIcon icon)
{
const uiStyle *style = UI_style_get_dpi();
const short icon_size = 64 * UI_SCALE_FAC;
const short icon_size = 40 * UI_SCALE_FAC;
const int dialog_width = icon_size + (style->widget.points * size * UI_SCALE_FAC);
return uiItemsAlertBox(block, style, dialog_width, icon, icon_size);
}

View File

@@ -4077,7 +4077,7 @@ static uiBlock *block_create_autorun_warning(bContext *C, ARegion *region, void
const int dialog_width = std::max(int(400.0f * UI_SCALE_FAC),
text_width + int(style->columnspace * 2.5));
const short icon_size = 64 * UI_SCALE_FAC;
const short icon_size = 40 * UI_SCALE_FAC;
uiLayout *layout = uiItemsAlertBox(
block, style, dialog_width + icon_size, ALERT_ICON_ERROR, icon_size);
@@ -4092,7 +4092,7 @@ static uiBlock *block_create_autorun_warning(bContext *C, ARegion *region, void
PointerRNA pref_ptr = RNA_pointer_create_discrete(nullptr, &RNA_PreferencesFilePaths, &U);
uiItemR(layout, &pref_ptr, "use_scripts_auto_execute", UI_ITEM_NONE, checkbox_text, ICON_NONE);
uiItemS_ex(layout, 3.0f);
uiItemS_ex(layout, 2.0f);
/* Buttons. */
uiBut *but;
@@ -4752,7 +4752,7 @@ static uiBlock *block_create__close_file_dialog(bContext *C, ARegion *region, vo
BKE_reports_free(&reports);
uiItemS_ex(layout, has_extra_checkboxes ? 2.0f : 4.0f);
uiItemS_ex(layout, 2.0f);
/* Buttons. */
#ifdef _WIN32

View File

@@ -1519,7 +1519,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *region, void *user_
wmOperator *op = data->op;
const uiStyle *style = UI_style_get_dpi();
const bool small = data->size == WM_POPUP_SIZE_SMALL;
const short icon_size = (small ? 32 : 64) * UI_SCALE_FAC;
const short icon_size = (small ? 32 : 40) * UI_SCALE_FAC;
uiBlock *block = UI_block_begin(C, region, __func__, UI_EMBOSS);
UI_block_flag_disable(block, UI_BLOCK_LOOP);
@@ -1581,8 +1581,13 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *region, void *user_
}
/* Message lines. */
for (auto &st : message_lines) {
uiItemL(layout, st, ICON_NONE);
if (message_lines.size() > 0) {
uiLayout *lines = uiLayoutColumn(layout, false);
uiLayoutSetScaleY(lines, 0.65f);
uiItemS_ex(lines, 0.1f);
for (auto &st : message_lines) {
uiItemL(lines, st, ICON_NONE);
}
}
if (data->include_properties) {
@@ -1590,7 +1595,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *region, void *user_
uiTemplateOperatorPropertyButs(C, layout, op, UI_BUT_LABEL_ALIGN_SPLIT_COLUMN, 0);
}
uiItemS_ex(layout, small ? 0.1f : 2.0f);
uiItemS_ex(layout, small ? 0.1f : 1.8f);
/* Clear so the OK button is left alone. */
UI_block_func_set(block, nullptr, nullptr, nullptr);

View File

@@ -2101,7 +2101,7 @@ static uiBlock *block_create_opengl_usage_warning(bContext *C, ARegion *region,
const int dialog_width = std::max(int(400.0f * UI_SCALE_FAC),
text_width + int(style->columnspace * 2.5));
const short icon_size = 64 * UI_SCALE_FAC;
const short icon_size = 40 * UI_SCALE_FAC;
uiLayout *layout = uiItemsAlertBox(
block, style, dialog_width + icon_size, ALERT_ICON_ERROR, icon_size);
@@ -2111,16 +2111,20 @@ static uiBlock *block_create_opengl_usage_warning(bContext *C, ARegion *region,
/* Title and explanation text. */
uiItemL_ex(col, title, ICON_NONE, true, false);
uiItemS_ex(col, 0.8f, LayoutSeparatorType::Space);
uiItemL(col, message1, ICON_NONE);
uiItemL(col, message2, ICON_NONE);
uiItemL(col, message3, ICON_NONE);
uiLayout *messages = uiLayoutColumn(col, false);
uiLayoutSetScaleY(messages, 0.8f);
uiItemL(messages, message1, ICON_NONE);
uiItemL(messages, message2, ICON_NONE);
uiItemL(messages, message3, ICON_NONE);
if (G.opengl_deprecation_usage_filename) {
char location[1024];
SNPRINTF(
location, "%s:%d", G.opengl_deprecation_usage_filename, G.opengl_deprecation_usage_lineno);
uiItemL(col, location, ICON_NONE);
uiItemL(messages, location, ICON_NONE);
}
uiItemL(col, message4, ICON_NONE);
uiItemL(messages, message4, ICON_NONE);
uiItemS_ex(col, 0.5f, LayoutSeparatorType::Space);
@@ -2177,16 +2181,16 @@ static uiBlock *block_create_gpu_backend_fallback(bContext *C, ARegion *region,
/* Title and explanation text. */
uiLayout *col = uiLayoutColumn(layout, false);
uiLayoutSetScaleY(col, 0.8f);
uiItemL_ex(
col, RPT_("Failed to load using Vulkan, using OpenGL instead."), ICON_NONE, true, false);
uiItemL(col, RPT_(""), ICON_NONE);
uiItemS_ex(col, 1.3f, LayoutSeparatorType::Space);
uiItemL(col, RPT_("Updating GPU drivers may solve this issue."), ICON_NONE);
uiItemL(col,
RPT_("The graphics backend can be changed in the System section of the Preferences."),
ICON_NONE);
uiItemS(layout);
UI_block_bounds_set_centered(block, 14 * UI_SCALE_FAC);
return block;