diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-12-04 08:37:55 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-12-04 08:37:55 +0300 |
commit | 6fe9a03456b48fdb689c2432788afcf0149e9b3e (patch) | |
tree | 5ed02476c7a81a6e86742325746af414872a9636 /source/blender/editors/space_time/time_ops.c | |
parent | efe8ad86e30b23e4611292b219ebdea0037b5611 (diff) |
View2D: Scrollbar tweaks
* Added back vertical scale markings for vertical scrollbars. Currently untested (until IPO Editor can be put back in). Also, there was a special exception for the Sequencer, which will need to be checked when the time comes too.
* Fixed the display of frame numbers in scrollbars. Was caused by error in using an int, where a float was required (this is one place MSVC gives better warnings than GCC).
* Outliner horizontal scrollbar now displays a more useful range. The previous range was based on screen width, not width of content.
* Outliner horizontal scrollbar now draws with bevel-highlight line again. Was missed out in a previous commit.
* Added simple toggle Frames/Seconds operator to TimeLine to test if the View2D code is working right for this. This uses the same hotkey (TKEY) as it's counterpart (with a menu for input) did in previous incarnations of Blender.
Diffstat (limited to 'source/blender/editors/space_time/time_ops.c')
-rw-r--r-- | source/blender/editors/space_time/time_ops.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index 86ff9d9b0ab..9b7af8b3f45 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -39,6 +39,7 @@ #include "BLI_blenlib.h" #include "BKE_global.h" +#include "BKE_utildefines.h" #include "UI_interface.h" #include "UI_view2d.h" @@ -175,16 +176,46 @@ void ED_TIME_OT_change_frame(wmOperatorType *ot) prop= RNA_def_property(ot->srna, "frame", PROP_INT, PROP_NONE); } +/* ****************** time display toggle operator ****************************/ + +static int toggle_time_exec(bContext *C, wmOperator *op) +{ + SpaceTime *stime; + + if (ELEM(NULL, C->area, C->area->spacedata.first)) + return OPERATOR_CANCELLED; + + /* simply toggle draw frames flag for now */ + // XXX in past, this displayed menu to choose... (for later!) + stime= C->area->spacedata.first; + stime->flag ^= TIME_DRAWFRAMES; + + return OPERATOR_FINISHED; +} + +void ED_TIME_OT_toggle_time(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Toggle Frames/Seconds"; + ot->idname= "ED_TIME_OT_toggle_time"; + + /* api callbacks */ + ot->exec= toggle_time_exec; +} + /* ************************** registration **********************************/ void time_operatortypes(void) { WM_operatortype_append(ED_TIME_OT_change_frame); + WM_operatortype_append(ED_TIME_OT_toggle_time); } void time_keymap(wmWindowManager *wm) { WM_keymap_verify_item(&wm->timekeymap, "ED_TIME_OT_change_frame", LEFTMOUSE, KM_PRESS, 0, 0); + WM_keymap_verify_item(&wm->timekeymap, "ED_TIME_OT_toggle_time", TKEY, KM_PRESS, 0, 0); + /* markers (XXX move to function?) */ WM_keymap_verify_item(&wm->timekeymap, "ED_MARKER_OT_add", MKEY, KM_PRESS, 0, 0); |