Commit ea641770 authored by Dennis van Amerongen's avatar Dennis van Amerongen

* wxwidgets: revert go-where-you-click slider changes from [15391] and [15393]...

* wxwidgets: revert go-where-you-click slider changes from [15391] and [15393] as it wasn't optimal (more accurate at the middle and not so much towards the beginning or end) and this also prevented proper slider select and drag usage.
parent 88014c2c
......@@ -75,10 +75,6 @@ InputManager::InputManager( intf_thread_t *_p_intf, Interface *_p_main_intf,
/* Create slider */
slider = new wxSlider( this, SliderScroll_Event, 0, 0, SLIDER_MAX_POS );
/* Add mouse click on slider */
slider->Connect( wxEVT_LEFT_DOWN,
wxMouseEventHandler( InputManager::OnSliderClick ),
NULL, this );
/* Create disc buttons */
disc_frame = new wxPanel( this );
......@@ -431,33 +427,6 @@ void InputManager::OnSliderUpdate( wxScrollEvent& event )
vlc_mutex_unlock( &p_intf->change_lock );
}
void InputManager::OnSliderClick( wxMouseEvent& event )
{
wxSlider* slider = wxStaticCast( event.GetEventObject(), wxSlider );
int i_min = slider->GetMin();
int i_max = slider->GetMax();
int i_pos = event.GetPosition().x;
int i_dim = slider->GetClientSize().x;
int i_val = i_min + ( i_pos * ( i_max - i_min + 1 ) ) / i_dim;
if( i_pos < 0 || i_pos >= i_dim ) return;
vlc_mutex_lock( &p_intf->change_lock );
slider->SetValue( i_val );
if( i_slider_pos != i_val && p_intf->p_sys->p_input )
{
vlc_value_t pos;
pos.f_float = (float)i_val / (float)SLIDER_MAX_POS;
var_Set( p_intf->p_sys->p_input, "position", pos );
}
vlc_mutex_unlock( &p_intf->change_lock );
event.Skip();
}
void InputManager::ShowSlider( bool show )
{
if( !!show == !!slider->IsShown() ) return;
......
......@@ -54,7 +54,6 @@ namespace wxvlc
void ShowSlider( bool show = true );
void OnSliderUpdate( wxScrollEvent& event );
void OnSliderClick( wxMouseEvent& event );
void OnDiscMenu( wxCommandEvent& event );
void OnDiscPrev( wxCommandEvent& event );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment