Make zoom-fit menu item work.

This commit is contained in:
Jonathan Moore Liles 2008-05-02 18:03:44 -05:00
parent 0da462b62d
commit 0645c0ebbf
3 changed files with 10 additions and 3 deletions

View File

@ -34,7 +34,7 @@ decl {\#include <FL/Fl.H>} {}
decl {extern char *user_config_dir;} {global
}
class TLE {open selected
class TLE {open
} {
decl {Fl_Color system_colors[3];} {public
}
@ -114,7 +114,7 @@ free( path );} {}
label {Non-DAW - Timeline} open
xywh {577 94 1024 768} type Double resizable xclass {Non-DAW} visible
} {
Fl_Menu_Bar menubar {
Fl_Menu_Bar menubar {open
xywh {0 0 1024 25}
} {
Submenu {} {
@ -227,6 +227,7 @@ exit( 0 );}
}
MenuItem {} {
label {&Fit}
callback {timeline->zoom_fit();} selected
xywh {10 10 40 25} divider
}
MenuItem {} {

View File

@ -1073,6 +1073,12 @@ Timeline::zoom ( float secs )
redraw();
}
void
Timeline::zoom_fit ( void )
{
zoom( _length / (float)sample_rate() );
}
Track *
Timeline::track_by_name ( const char *name )
{

View File

@ -181,7 +181,7 @@ public:
void zoom ( float secs );
void zoom_in ( void );
void zoom_out ( void );
void zoom_fit ( void );
private: