Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-04-24 10:39:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-24 10:39:11 +0300
commite8d3996e6776029ce27e29d7e717b0f301a0fa55 (patch)
tree4a7c6783572bfae6657b5a9ce3ce53044a471c94 /source/blender/editors/space_view3d/view3d_header.c
parentb0b6fb8a9390c5ef35709f39091979100acfe945 (diff)
Fix edit-mesh selection mode switching causing two undo pushes
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_header.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index be0084d8869..119ba059a70 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -138,10 +138,11 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C)
if (obedit && (obedit->type == OB_MESH)) {
BMEditMesh *em = BKE_editmesh_from_object(obedit);
uiLayout *row;
+ uiBut *but;
row = uiLayoutRow(layout, true);
block = uiLayoutGetBlock(row);
- uiDefIconButBitS(
+ but = uiDefIconButBitS(
block,
UI_BTYPE_TOGGLE,
SCE_SELECT_VERTEX,
@@ -157,23 +158,26 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C)
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,
- ceilf(UI_UNIT_X - U.pixelsize),
- 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(
+ UI_but_flag_disable(but, UI_BUT_UNDO);
+ but = uiDefIconButBitS(
+ block,
+ UI_BTYPE_TOGGLE,
+ SCE_SELECT_EDGE,
+ B_SEL_EDGE,
+ ICON_EDGESEL,
+ 0,
+ 0,
+ ceilf(UI_UNIT_X - U.pixelsize),
+ UI_UNIT_Y,
+ &em->selectmode,
+ 1.0,
+ 0.0,
+ 0,
+ 0,
+ TIP_("Edge select - Shift-Click for multiple modes, "
+ "Ctrl-Click expands/contracts selection depending on the current mode"));
+ UI_but_flag_disable(but, UI_BUT_UNDO);
+ but = uiDefIconButBitS(
block,
UI_BTYPE_TOGGLE,
SCE_SELECT_FACE,
@@ -189,6 +193,7 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C)
0,
0,
TIP_("Face select - Shift-Click for multiple modes, Ctrl-Click expands selection"));
+ UI_but_flag_disable(but, UI_BUT_UNDO);
}
}