diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-02-02 06:12:39 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-02-02 06:12:39 +0300 |
commit | b04bccd44e45dcb759de55c08d2913400853ee82 (patch) | |
tree | 27cdf399e21384f477950cad2a8819fed1f53577 /source/blender/editors/animation/anim_markers.c | |
parent | c57cd7c5bdb9a45516da9fa8310e903e921f7fc8 (diff) |
Bugfix [#25907] Impossible to "select all" on narrow action editors
Marker selection operators now use a special poll() callback which
checks that there are some markers before trying to run them. This
means that when there are no markers, the full screen range is
available, instead of just those areas above the region masked off for
markers which can be quite slim when trying to save space by only
showing the summary channel.
Diffstat (limited to 'source/blender/editors/animation/anim_markers.c')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index e1a3d8d2fa0..58dc5008959 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -403,6 +403,19 @@ static int ed_markers_poll_selected_markers(bContext *C) /* check if some marker is selected */ return ED_markers_get_first_selected(markers) != NULL; } + +/* special poll() which checks if there are any markers at all first */ +static int ed_markers_poll_markers_exist(bContext *C) +{ + ListBase *markers = ED_context_get_markers(C); + + /* first things first: markers can only exist in timeline views */ + if (ED_operator_animview_active(C) == 0) + return 0; + + /* list of markers must exist, as well as some markers in it! */ + return (markers && markers->first); +} /* ------------------------ */ @@ -1011,7 +1024,7 @@ static void MARKER_OT_select(wmOperatorType *ot) /* api callbacks */ ot->invoke= ed_marker_select_invoke_wrapper; - ot->poll= ED_operator_animview_active; + ot->poll= ed_markers_poll_markers_exist; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1098,7 +1111,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot) ot->invoke= ed_marker_select_border_invoke_wrapper; ot->modal= WM_border_select_modal; - ot->poll= ED_operator_animview_active; + ot->poll= ed_markers_poll_markers_exist; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1152,7 +1165,7 @@ static void MARKER_OT_select_all(wmOperatorType *ot) /* api callbacks */ ot->exec= ed_marker_select_all_exec; ot->invoke = ed_markers_opwrap_invoke; - ot->poll= ED_operator_animview_active; + ot->poll= ed_markers_poll_markers_exist; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1219,12 +1232,12 @@ static int ed_marker_rename_exec(bContext *C, wmOperator *op) { TimeMarker *marker= ED_markers_get_first_selected(ED_context_get_markers(C)); - if(marker) { + if (marker) { RNA_string_get(op->ptr, "name", marker->name); - + WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL); - + return OPERATOR_FINISHED; } else { |