From 69d664719a7b43fa3506e9381eebe8d9fbfea24f Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Tue, 6 Apr 2004 14:15:38 +0000 Subject: [PATCH] * modules/gui/wxwindows/*: changed slider aspect and moved the time display into the statusbar. --- modules/gui/wxwindows/bookmarks.cpp | 1 + modules/gui/wxwindows/interface.cpp | 31 +++++++++++++---------------- modules/gui/wxwindows/timer.cpp | 15 ++++++++++---- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/modules/gui/wxwindows/bookmarks.cpp b/modules/gui/wxwindows/bookmarks.cpp index 3fc0310a8d..4973a3ddee 100644 --- a/modules/gui/wxwindows/bookmarks.cpp +++ b/modules/gui/wxwindows/bookmarks.cpp @@ -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 ); diff --git a/modules/gui/wxwindows/interface.cpp b/modules/gui/wxwindows/interface.cpp index a0e4cc41c6..2386b2b2f6 100644 --- a/modules/gui/wxwindows/interface.cpp +++ b/modules/gui/wxwindows/interface.cpp @@ -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 } } diff --git a/modules/gui/wxwindows/timer.cpp b/modules/gui/wxwindows/timer.cpp index 85f831016c..517a3f930c 100644 --- a/modules/gui/wxwindows/timer.cpp +++ b/modules/gui/wxwindows/timer.cpp @@ -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 + * Authors: Gildas Bazin * * 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 ); } } } -- GitLab