Sequencer: revert selection & keymap changes from D7679

These changes aren't aligned with other timeline selection keymaps
(graph & action for e.g.).

Revert these changes, shortcuts to time-line editors
should take other similar spaces into account.
This commit is contained in:
Campbell Barton 2020-06-18 16:30:56 +10:00
parent 502e6bd839
commit 099d47f8a3
2 changed files with 3 additions and 29 deletions

View File

@ -2467,7 +2467,7 @@ def km_sequencer(params):
{"properties": [("all", False)]}),
("sequencer.gap_remove", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True},
{"properties": [("all", True)]}),
("sequencer.gap_insert", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True}, None),
("sequencer.gap_insert", {"type": 'EQUAL', "value": 'PRESS', "shift": True}, None),
("sequencer.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None),
("sequencer.swap_inputs", {"type": 'S', "value": 'PRESS', "alt": True}, None),
*(
@ -2523,14 +2523,6 @@ def km_sequencer(params):
{"properties": [("side", 'LEFT')]}),
("sequencer.select_side_of_frame", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
{"properties": [("side", 'RIGHT')]}),
("sequencer.select_side_of_frame", {"type": 'EQUAL', "value": 'PRESS'},
{"properties": [("side", 'OVERLAP')]}),
("sequencer.select_side_of_frame", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True},
{"properties": [("side", 'LEFT'), ("extend", True)]}),
("sequencer.select_side_of_frame", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
{"properties": [("side", 'RIGHT'), ("extend", True)]}),
("sequencer.select_side_of_frame", {"type": 'EQUAL', "value": 'PRESS', "shift": True},
{"properties": [("side", 'OVERLAP'), ("extend", True)]}),
*_template_items_context_menu("SEQUENCER_MT_context_menu", params.context_menu_event),
])

View File

@ -409,32 +409,15 @@ static int sequencer_select_exec(bContext *C, wmOperator *op)
/* Select left, right or overlapping the current frame. */
if (side_of_frame) {
/* Use different logic for this. */
float x;
if (extend == false) {
ED_sequencer_deselect_all(scene);
}
/* 10px margin around current frame to select under the current frame with mouse. */
float margin = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask) * 10;
x = UI_view2d_region_to_view_x(v2d, mval[0]);
if (x >= CFRA - margin && x <= CFRA + margin) {
x = CFRA;
}
const float x = UI_view2d_region_to_view_x(v2d, mval[0]);
SEQP_BEGIN (ed, seq) {
bool test = false;
/* FIXME(campbell): this functionality is only in the sequencer,
* either we should support this for all timeline views or remove it. */
if ((x == CFRA) && (seq->startdisp <= CFRA) && (seq->enddisp >= CFRA)) {
/* Select overlapping the current frame. */
test = true;
}
else if ((x < CFRA && seq->enddisp <= CFRA) || (x > CFRA && seq->startdisp >= CFRA)) {
if (((x < CFRA) && (seq->enddisp <= CFRA)) || ((x >= CFRA) && (seq->startdisp >= CFRA))) {
/* Select left or right. */
test = true;
}
if (test) {
seq->flag |= SELECT;
recurs_sel_seq(seq);
}
@ -1023,7 +1006,6 @@ static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_select_side_of_frame(wmOperatorType *ot)
{
static const EnumPropertyItem sequencer_select_left_right_types[] = {
{0, "OVERLAP", 0, "Overlap", "Select overlapping the current frame"},
{-1, "LEFT", 0, "Left", "Select to the left of the current frame"},
{1, "RIGHT", 0, "Right", "Select to the right of the current frame"},
{0, NULL, 0, NULL, NULL},