UI: Small Confirmation Position
For small confirmations that appear at mouse position, change the position slightly so that the mouse pointer is less likely to obscure the confirm button text. Pull Request: https://projects.blender.org/blender/blender/pulls/119536
This commit is contained in:
parent
e2e26d3872
commit
a4a26bf90d
|
@ -1605,8 +1605,8 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *region, void *user_
|
||||||
const int padding = (small ? 7 : 14) * UI_SCALE_FAC;
|
const int padding = (small ? 7 : 14) * UI_SCALE_FAC;
|
||||||
|
|
||||||
if (data->position == WM_POPUP_POSITION_MOUSE) {
|
if (data->position == WM_POPUP_POSITION_MOUSE) {
|
||||||
const float button_center_x = windows_layout ? -0.33f : -0.66f;
|
const float button_center_x = windows_layout ? -0.4f : -0.90f;
|
||||||
const float button_center_y = small ? 1.9f : 3.1f;
|
const float button_center_y = small ? 2.0f : 3.1f;
|
||||||
const int bounds_offset[2] = {int(button_center_x * uiLayoutGetWidth(layout)),
|
const int bounds_offset[2] = {int(button_center_x * uiLayoutGetWidth(layout)),
|
||||||
int(button_center_y * UI_UNIT_X)};
|
int(button_center_y * UI_UNIT_X)};
|
||||||
UI_block_bounds_set_popup(block, padding, bounds_offset);
|
UI_block_bounds_set_popup(block, padding, bounds_offset);
|
||||||
|
|
Loading…
Reference in New Issue