Fix enum icon button size for fractional UI scale.
Err on the side of too much padding.
This commit is contained in:
@@ -721,7 +721,7 @@ static void ui_item_enum_expand_exec(
|
||||
if (icon && name[0] && !icon_only)
|
||||
but = uiDefIconTextButR_prop(block, but_type, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
|
||||
else if (icon)
|
||||
but = uiDefIconButR_prop(block, but_type, 0, icon, 0, 0, (is_first) ? itemw : itemw - UI_DPI_FAC, h, ptr, prop, -1, 0, value, -1, -1, NULL);
|
||||
but = uiDefIconButR_prop(block, but_type, 0, icon, 0, 0, (is_first) ? itemw : ceilf(itemw - UI_DPI_FAC), h, ptr, prop, -1, 0, value, -1, -1, NULL);
|
||||
else
|
||||
but = uiDefButR_prop(block, but_type, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_gpencil_types.h"
|
||||
|
||||
#include "BLI_math_base.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.h"
|
||||
@@ -142,10 +143,10 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C)
|
||||
0, 0, UI_UNIT_X, UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0,
|
||||
TIP_("Vertex select - Shift-Click for multiple modes, Ctrl-Click contracts selection"));
|
||||
uiDefIconButBitS(block, UI_BTYPE_TOGGLE, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL,
|
||||
0, 0, UI_UNIT_X - UI_DPI_FAC, UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0,
|
||||
0, 0, ceilf(UI_UNIT_X - UI_DPI_FAC), UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0,
|
||||
TIP_("Edge select - Shift-Click for multiple modes, Ctrl-Click expands/contracts selection"));
|
||||
uiDefIconButBitS(block, UI_BTYPE_TOGGLE, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL,
|
||||
0, 0, UI_UNIT_X - UI_DPI_FAC, UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0,
|
||||
0, 0, ceilf(UI_UNIT_X - UI_DPI_FAC), UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0,
|
||||
TIP_("Face select - Shift-Click for multiple modes, Ctrl-Click expands selection"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user