VideoConfigDiag: Snap the convergence slider.

This commit is contained in:
Jules Blok 2015-09-19 16:33:19 +02:00
parent ee657c04fe
commit 3f7bf5ca93
2 changed files with 10 additions and 2 deletions

View File

@ -439,7 +439,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Depth:")), 1, wxALIGN_CENTER_VERTICAL, 0);
szr_stereo->Add(sep_slider, 0, wxEXPAND | wxRIGHT);
wxSlider* const conv_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoConvergencePercentage, 0, 200, wxDefaultPosition, wxDefaultSize);
conv_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoConvergencePercentage, 0, 200, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
conv_slider->ClearTicks();
conv_slider->SetTick(100);
conv_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoConvergence, this);
RegisterControl(conv_slider, wxGetTranslation(stereo_convergence_desc));

View File

@ -168,7 +168,12 @@ protected:
void Event_StereoConvergence(wxCommandEvent &ev)
{
vconfig.iStereoConvergencePercentage = ev.GetInt();
// Snap the slider
int value = ev.GetInt();
if (90 < value && value < 110)
conv_slider->SetValue(100);
vconfig.iStereoConvergencePercentage = conv_slider->GetValue();
ev.Skip();
}
@ -256,6 +261,7 @@ protected:
wxStaticText* text_aamode;
wxChoice* choice_aamode;
wxSlider* conv_slider;
wxStaticText* label_display_resolution;