Commit 8dacc8fa authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/subtitles.cpp: new "font size" option.

parent c174051a
...@@ -1280,8 +1280,9 @@ void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) ) ...@@ -1280,8 +1280,9 @@ void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) )
if( subsfile_dialog->encoding_combo ) if( subsfile_dialog->encoding_combo )
subsfile_mrl.Add( wxString(wxT("subsdec-encoding=")) + subsfile_mrl.Add( wxString(wxT("subsdec-encoding=")) +
subsfile_dialog->encoding_combo->GetValue() ); subsfile_dialog->encoding_combo->GetValue() );
subsfile_mrl.Add( wxString::Format( wxT("sub-delay=%i"), subsfile_mrl.Add( wxString::Format( wxT("freetype-rel-fontsize=%i"),
subsfile_dialog->delay_spinctrl->GetValue() ) ); (int)subsfile_dialog->size_combo->GetClientData(
subsfile_dialog->size_combo->GetSelection()) ) );
subsfile_mrl.Add( wxString::Format( wxT("sub-fps=%i"), subsfile_mrl.Add( wxString::Format( wxT("sub-fps=%i"),
subsfile_dialog->fps_spinctrl->GetValue() ) ); subsfile_dialog->fps_spinctrl->GetValue() ) );
} }
......
...@@ -125,8 +125,8 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -125,8 +125,8 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
encoding_combo->SetValue( wxU(p_item->psz_value) ); encoding_combo->SetValue( wxU(p_item->psz_value) );
encoding_combo->SetToolTip( wxU(p_item->psz_longtext) ); encoding_combo->SetToolTip( wxU(p_item->psz_longtext) );
enc_sizer->Add( label, 0, wxALL, 5 ); enc_sizer->Add( label, 0, wxALL | wxALIGN_CENTER, 5 );
enc_sizer->Add( encoding_combo, 0, wxALL, 5 ); enc_sizer->Add( encoding_combo, 0, wxALL | wxALIGN_CENTER, 5 );
enc_sizer_sizer->Add( enc_sizer, 1, wxEXPAND | wxALL, 5 ); enc_sizer_sizer->Add( enc_sizer, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( enc_sizer, 0, wxEXPAND | wxALL, 5 ); panel_sizer->Add( enc_sizer, 0, wxEXPAND | wxALL, 5 );
} }
...@@ -135,22 +135,43 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -135,22 +135,43 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
wxBoxSizer *misc_sizer_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *misc_sizer_sizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBox *misc_box = new wxStaticBox( panel, -1, wxStaticBox *misc_box = new wxStaticBox( panel, -1,
wxU(_("Subtitles options")) ); wxU(_("Subtitles options")) );
wxStaticBoxSizer *misc_sizer = new wxStaticBoxSizer( misc_box, wxStaticBoxSizer *misc_sizer = new wxStaticBoxSizer( misc_box,
wxHORIZONTAL ); wxHORIZONTAL );
wxStaticText *label =
new wxStaticText(panel, -1, wxU(_("Delay subtitles (in 1/10s)"))); /* Font size */
int i_delay = config_GetInt( p_intf, "sub-delay" ); p_item =
/* Outside the new wxSpinCtrl to avoid an internal error in gcc2.95 ! */ config_FindConfig( VLC_OBJECT(p_intf), "freetype-rel-fontsize" );
wxString format_delay(wxString::Format(wxT("%d"), i_delay)); if( p_item )
delay_spinctrl = new wxSpinCtrl( panel, -1, format_delay, {
wxBoxSizer *size_sizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticText *label =
new wxStaticText(panel, -1, wxU(p_item->psz_text));
size_combo = new wxComboBox( panel, -1, wxT(""),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, NULL, wxCB_READONLY );
-650000, 650000, i_delay );
misc_sizer->Add( label, 0, wxALL, 5 ); /* build a list of available options */
misc_sizer->Add( delay_spinctrl, 0, wxALL, 5 ); for( int i_index = 0; i_index < p_item->i_list; i_index++ )
{
size_combo->Append( wxU(p_item->ppsz_list_text[i_index]),
(void *)p_item->pi_list[i_index] );
if( p_item->i_value == p_item->pi_list[i_index] )
{
size_combo->SetSelection( i_index );
size_combo->SetValue(wxU(p_item->ppsz_list_text[i_index]));
}
}
encoding_combo->SetToolTip( wxU(p_item->psz_longtext) );
size_sizer->Add( label, 0, wxALL | wxALIGN_CENTER, 5 );
size_sizer->Add( size_combo, 0, wxALL | wxALIGN_CENTER, 5 );
misc_sizer->Add( size_sizer, 1, wxEXPAND | wxALL, 5 );
}
label = new wxStaticText(panel, -1, wxU(_("Frames per second"))); wxStaticText *label =
new wxStaticText(panel, -1, wxU(_("Frames per second")));
float f_fps = config_GetFloat( p_intf, "sub-fps" ); float f_fps = config_GetFloat( p_intf, "sub-fps" );
/* Outside the new wxSpinCtrl to avoid an internal error in gcc2.95 ! */ /* Outside the new wxSpinCtrl to avoid an internal error in gcc2.95 ! */
...@@ -161,8 +182,8 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -161,8 +182,8 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
0, 16000, (int)f_fps ); 0, 16000, (int)f_fps );
fps_spinctrl->SetToolTip( wxU(_("Override frames per second. " fps_spinctrl->SetToolTip( wxU(_("Override frames per second. "
"It will only work with MicroDVD subtitles.")) ); "It will only work with MicroDVD subtitles.")) );
misc_sizer->Add( label, 0, wxALL, 5 ); misc_sizer->Add( label, 0, wxALL | wxALIGN_CENTER, 5 );
misc_sizer->Add( fps_spinctrl, 0, wxALL, 5 ); misc_sizer->Add( fps_spinctrl, 0, wxALL | wxALIGN_CENTER, 5 );
misc_sizer_sizer->Add( misc_sizer, 1, wxEXPAND | wxALL, 5 ); misc_sizer_sizer->Add( misc_sizer, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( misc_sizer, 0, wxEXPAND | wxALL, 5 ); panel_sizer->Add( misc_sizer, 0, wxEXPAND | wxALL, 5 );
......
...@@ -629,7 +629,7 @@ public: ...@@ -629,7 +629,7 @@ public:
wxComboBox *file_combo; wxComboBox *file_combo;
wxComboBox *encoding_combo; wxComboBox *encoding_combo;
wxSpinCtrl *delay_spinctrl; wxComboBox *size_combo;
wxSpinCtrl *fps_spinctrl; wxSpinCtrl *fps_spinctrl;
private: private:
......
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