search fixes, preset fixes, ladspa icon logging, igor pref theme, drag btn rollover
[goodguy/history.git] / cinelerra-5.1 / cinelerra / cpanel.C
index 09c54b5ac34b2e90e46d508ddf07c2f7988cbe7b..1e6ef8d3e5348a86a3b599c88f42c90f911c76c5 100644 (file)
@@ -79,14 +79,15 @@ void CPanel::create_objects()
        y += operation[CWINDOW_TOOL_WINDOW]->get_h();
        subwindow->add_subwindow(operation[CWINDOW_TITLESAFE] = new CPanelTitleSafe(mwindow, this, x, y));
        y += operation[CWINDOW_TITLESAFE]->get_h();
-       x += (w - BC_Slider::get_span(1)) / 2;
-       subwindow->add_subwindow(cpanel_zoom = new CPanelZoom(mwindow, this, x, y+15, h-y-15));
+       x += (w - BC_Slider::get_span(1)) / 2;  y += 15;
+       subwindow->add_subwindow(cpanel_zoom = new CPanelZoom(mwindow, this, x, y, h-y-20));
 }
 
-void CPanel::reposition_buttons(int x, int y)
+void CPanel::reposition_buttons(int x, int y, int h)
 {
        this->x = x;
        this->y = y;
+       this->h = h;
 
        for(int i = 0; i < CPANEL_OPERATIONS; i++)
        {
@@ -94,7 +95,10 @@ void CPanel::reposition_buttons(int x, int y)
                y += operation[i]->get_h();
        }
        x += (w - BC_Slider::get_span(1)) / 2;
-       cpanel_zoom->reposition_window(x, y+15);
+       y += 15;
+       h = this->h - this->y;
+       cpanel_zoom->reposition_window(x, y, w, h-y-20);
+       cpanel_zoom->set_pointer_motion_range(h);
 }
 
 
@@ -365,7 +369,7 @@ int CPanelTitleSafe::handle_event()
 }
 
 CPanelZoom::CPanelZoom(MWindow *mwindow, CPanel *gui, int x, int y, int h)
- : BC_FSlider(x, y, 1, h-30, h, -2., 2., 0, 0)
+ : BC_FSlider(x, y, 1, h, h, -2., 2., 0, 0)
 {
        this->mwindow = mwindow;
        this->gui = gui;
@@ -384,7 +388,7 @@ int CPanelZoom::handle_event()
        double zoom = pow(10.,value);
        switch( mwindow->edl->session->cwindow_operation ) {
        case CWINDOW_ZOOM:
-               gui->subwindow->zoom_canvas(0, zoom, 1);
+               gui->subwindow->zoom_canvas(zoom, 1);
                break;
        case CWINDOW_CAMERA:
                aidx = AUTOMATION_CAMERA_Z;
@@ -411,12 +415,11 @@ int CPanelZoom::handle_event()
 int CPanelZoom::set_shown(int shown)
 {
        if( shown ) {
-               float zoom = gui->subwindow->canvas->get_zoom();
-               gui->subwindow->zoom_canvas(0, zoom, 1);
-               show_window();
+               show();
+               update(gui->subwindow->canvas->get_zoom());
        }
        else
-               hide_window();
+               hide();
        return 1;
 }
 
@@ -434,7 +437,7 @@ void CPanelZoom::update(float zoom)
 {
        if( !is_hidden() ) {
                if( zoom < 0.01 ) zoom = 0.01;
-               float value = log(zoom) / log(10.);
+               float value = log10f(zoom);
                BC_FSlider::update(value);
        }
 }