Commit 69d66471 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: changed slider aspect and moved the time display into the statusbar.

parent b0e050e4
......@@ -112,6 +112,7 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf, wxWindow *p_parent )
{
/* Initializations */
p_intf = _p_intf;
SetIcon( *p_intf->p_sys->p_icon );
wxPanel *main_panel = new wxPanel( this, -1 );
wxBoxSizer *main_sizer = new wxBoxSizer( wxHORIZONTAL );
......
......@@ -495,24 +495,15 @@ void Interface::CreateOurSlider()
/* Create a new frame and sizer containing the slider */
slider_frame = new wxPanel( this, -1, wxDefaultPosition, wxDefaultSize );
slider_frame->SetAutoLayout( TRUE );
wxBoxSizer *frame_sizer =
new wxBoxSizer( wxHORIZONTAL );
/* Create static box to surround the slider */
slider_box = new wxStaticBox( slider_frame, -1, wxT("") );
/* Create sizer for slider frame */
wxStaticBoxSizer *slider_sizer =
new wxStaticBoxSizer( slider_box, wxHORIZONTAL );
slider_sizer->SetMinSize( -1, 50 );
wxBoxSizer *frame_sizer = new wxBoxSizer( wxHORIZONTAL );
//frame_sizer->SetMinSize( -1, 50 );
/* Create slider */
slider = new wxSlider( slider_frame, SliderScroll_Event, 0, 0,
SLIDER_MAX_POS, wxDefaultPosition, wxDefaultSize );
slider_sizer->Add( slider, 1, wxEXPAND | wxALL, 5 );
/* Add everything to the frame */
frame_sizer->Add( slider_sizer, 1, wxEXPAND | wxBOTTOM, 5 );
frame_sizer->Add( slider, 1, wxEXPAND | wxALL, 5 );
slider_frame->SetSizer( frame_sizer );
frame_sizer->Layout();
frame_sizer->SetSizeHints(slider_frame);
......@@ -1221,13 +1212,19 @@ void Interface::OnSliderUpdate( wxScrollEvent& event )
{
/* Update stream date */
#define p_area p_intf->p_sys->p_input->stream.p_selected_area
char psz_time[ MSTRTIME_MAX_SIZE ];
char psz_time[ MSTRTIME_MAX_SIZE ], psz_total[ MSTRTIME_MAX_SIZE ];
mtime_t i_seconds;
vlc_value_t val;
var_Get( p_intf->p_sys->p_input, "length", &val );
i_seconds = val.i_time / 1000000;
secstotimestr ( psz_total, i_seconds );
slider_box->SetLabel(
statusbar->SetStatusText(
wxU(input_OffsetToTime( p_intf->p_sys->p_input,
psz_time,
p_area->i_size * event.GetPosition()
/ SLIDER_MAX_POS )) );
psz_time, p_area->i_size * event.GetPosition()
/ SLIDER_MAX_POS )) + wxString(wxT(" / ")) +
wxU(psz_total), 0 );
#undef p_area
}
}
......
......@@ -2,9 +2,9 @@
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2003 VideoLAN
* $Id: timer.cpp,v 1.36 2003/12/03 13:27:51 rocky Exp $
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -147,6 +147,7 @@ void Timer::Notify()
i_old_playing_status = PAUSE_S;
}
p_main_interface->statusbar->SetStatusText( wxT(""), 0 );
p_main_interface->statusbar->SetStatusText( wxT(""), 2 );
vlc_object_release( p_intf->p_sys->p_input );
......@@ -185,6 +186,7 @@ void Timer::Notify()
{
vlc_value_t pos;
char psz_time[ MSTRTIME_MAX_SIZE ];
char psz_total[ MSTRTIME_MAX_SIZE ];
vlc_value_t time;
mtime_t i_seconds;
......@@ -200,10 +202,15 @@ void Timer::Notify()
var_Get( p_intf->p_sys->p_input, "time", &time );
i_seconds = time.i_time / 1000000;
secstotimestr ( psz_time, i_seconds );
p_main_interface->slider_box->SetLabel( wxU(psz_time) );
var_Get( p_intf->p_sys->p_input, "length", &time );
i_seconds = time.i_time / 1000000;
secstotimestr ( psz_total, i_seconds );
p_main_interface->statusbar->SetStatusText(
wxU(psz_time) + wxString(wxT(" / ")) +
wxU(psz_total), 0 );
}
}
}
......
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