[UI] Remove fullscreen resolution UI.
This commit is contained in:
parent
84ca9a4aec
commit
aa4088a494
|
@ -180,7 +180,7 @@ void SConfig::SaveDisplaySettings(IniFile& ini)
|
||||||
{
|
{
|
||||||
IniFile::Section* display = ini.GetOrCreateSection("Display");
|
IniFile::Section* display = ini.GetOrCreateSection("Display");
|
||||||
|
|
||||||
display->Set("FullscreenResolution", strFullscreenResolution);
|
display->Set("FullscreenDisplayRes", strFullscreenResolution);
|
||||||
display->Set("Fullscreen", bFullscreen);
|
display->Set("Fullscreen", bFullscreen);
|
||||||
display->Set("RenderToMain", bRenderToMain);
|
display->Set("RenderToMain", bRenderToMain);
|
||||||
display->Set("RenderWindowXPos", iRenderWindowXPos);
|
display->Set("RenderWindowXPos", iRenderWindowXPos);
|
||||||
|
@ -460,7 +460,7 @@ void SConfig::LoadDisplaySettings(IniFile& ini)
|
||||||
IniFile::Section* display = ini.GetOrCreateSection("Display");
|
IniFile::Section* display = ini.GetOrCreateSection("Display");
|
||||||
|
|
||||||
display->Get("Fullscreen", &bFullscreen, false);
|
display->Get("Fullscreen", &bFullscreen, false);
|
||||||
display->Get("FullscreenResolution", &strFullscreenResolution, "Auto");
|
display->Get("FullscreenDisplayRes", &strFullscreenResolution, "Auto");
|
||||||
display->Get("RenderToMain", &bRenderToMain, false);
|
display->Get("RenderToMain", &bRenderToMain, false);
|
||||||
display->Get("RenderWindowXPos", &iRenderWindowXPos, -1);
|
display->Get("RenderWindowXPos", &iRenderWindowXPos, -1);
|
||||||
display->Get("RenderWindowYPos", &iRenderWindowYPos, -1);
|
display->Get("RenderWindowYPos", &iRenderWindowYPos, -1);
|
||||||
|
|
|
@ -47,7 +47,6 @@ void GeneralWidget::CreateWidgets()
|
||||||
m_video_layout = new QGridLayout();
|
m_video_layout = new QGridLayout();
|
||||||
|
|
||||||
m_backend_combo = new QComboBox();
|
m_backend_combo = new QComboBox();
|
||||||
m_resolution_combo = new QComboBox();
|
|
||||||
m_aspect_combo =
|
m_aspect_combo =
|
||||||
new GraphicsChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
|
new GraphicsChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
|
||||||
Config::GFX_ASPECT_RATIO);
|
Config::GFX_ASPECT_RATIO);
|
||||||
|
@ -60,25 +59,14 @@ void GeneralWidget::CreateWidgets()
|
||||||
for (auto& backend : g_available_video_backends)
|
for (auto& backend : g_available_video_backends)
|
||||||
m_backend_combo->addItem(tr(backend->GetDisplayName().c_str()));
|
m_backend_combo->addItem(tr(backend->GetDisplayName().c_str()));
|
||||||
|
|
||||||
#ifndef __APPLE__
|
|
||||||
m_resolution_combo->addItem(tr("Auto"));
|
|
||||||
|
|
||||||
for (const auto& res : VideoUtils::GetAvailableResolutions(m_xrr_config))
|
|
||||||
m_resolution_combo->addItem(QString::fromStdString(res));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_video_layout->addWidget(new QLabel(tr("Backend:")), 0, 0);
|
m_video_layout->addWidget(new QLabel(tr("Backend:")), 0, 0);
|
||||||
m_video_layout->addWidget(m_backend_combo, 0, 1);
|
m_video_layout->addWidget(m_backend_combo, 0, 1);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
m_video_layout->addWidget(new QLabel(tr("Adapter:")), 1, 0);
|
m_video_layout->addWidget(new QLabel(tr("Adapter:")), 1, 0);
|
||||||
m_video_layout->addWidget(m_adapter_combo, 1, 1);
|
m_video_layout->addWidget(m_adapter_combo, 1, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __APPLE__
|
|
||||||
m_video_layout->addWidget(new QLabel(tr("Fullscreen Resolution:")), 2, 0);
|
|
||||||
m_video_layout->addWidget(m_resolution_combo, 2, 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_video_layout->addWidget(new QLabel(tr("Aspect Ratio:")), 3, 0);
|
m_video_layout->addWidget(new QLabel(tr("Aspect Ratio:")), 3, 0);
|
||||||
m_video_layout->addWidget(m_aspect_combo, 3, 1);
|
m_video_layout->addWidget(m_aspect_combo, 3, 1);
|
||||||
|
|
||||||
|
@ -126,10 +114,6 @@ void GeneralWidget::ConnectWidgets()
|
||||||
// Video Backend
|
// Video Backend
|
||||||
connect(m_backend_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(m_backend_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
[this](int) { SaveSettings(); });
|
[this](int) { SaveSettings(); });
|
||||||
// Fullscreen Resolution
|
|
||||||
connect(m_resolution_combo,
|
|
||||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
|
||||||
[this](int) { SaveSettings(); });
|
|
||||||
// Enable Fullscreen
|
// Enable Fullscreen
|
||||||
for (QCheckBox* checkbox : {m_enable_fullscreen, m_hide_cursor, m_render_main_window})
|
for (QCheckBox* checkbox : {m_enable_fullscreen, m_hide_cursor, m_render_main_window})
|
||||||
connect(checkbox, &QCheckBox::toggled, this, &GeneralWidget::SaveSettings);
|
connect(checkbox, &QCheckBox::toggled, this, &GeneralWidget::SaveSettings);
|
||||||
|
@ -149,10 +133,6 @@ void GeneralWidget::LoadSettings()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fullscreen Resolution
|
|
||||||
auto resolution = SConfig::GetInstance().strFullscreenResolution;
|
|
||||||
m_resolution_combo->setCurrentIndex(
|
|
||||||
resolution == "Auto" ? 0 : m_resolution_combo->findText(QString::fromStdString(resolution)));
|
|
||||||
// Enable Fullscreen
|
// Enable Fullscreen
|
||||||
m_enable_fullscreen->setChecked(SConfig::GetInstance().bFullscreen);
|
m_enable_fullscreen->setChecked(SConfig::GetInstance().bFullscreen);
|
||||||
// Hide Cursor
|
// Hide Cursor
|
||||||
|
@ -210,10 +190,6 @@ void GeneralWidget::SaveSettings()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fullscreen Resolution
|
|
||||||
SConfig::GetInstance().strFullscreenResolution =
|
|
||||||
m_resolution_combo->currentIndex() == 0 ? "Auto" :
|
|
||||||
m_resolution_combo->currentText().toStdString();
|
|
||||||
// Enable Fullscreen
|
// Enable Fullscreen
|
||||||
SConfig::GetInstance().bFullscreen = m_enable_fullscreen->isChecked();
|
SConfig::GetInstance().bFullscreen = m_enable_fullscreen->isChecked();
|
||||||
// Hide Cursor
|
// Hide Cursor
|
||||||
|
@ -230,9 +206,6 @@ void GeneralWidget::OnEmulationStateChanged(bool running)
|
||||||
{
|
{
|
||||||
m_backend_combo->setEnabled(!running);
|
m_backend_combo->setEnabled(!running);
|
||||||
m_render_main_window->setEnabled(!running);
|
m_render_main_window->setEnabled(!running);
|
||||||
#ifndef __APPLE__
|
|
||||||
m_resolution_combo->setEnabled(!running);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
m_adapter_combo->setEnabled(!running);
|
m_adapter_combo->setEnabled(!running);
|
||||||
|
@ -257,10 +230,6 @@ void GeneralWidget::AddDescriptions()
|
||||||
"slow and only useful for debugging, so unless you have a reason to use it you'll "
|
"slow and only useful for debugging, so unless you have a reason to use it you'll "
|
||||||
"want to select OpenGL here.\n\nIf unsure, select OpenGL.");
|
"want to select OpenGL here.\n\nIf unsure, select OpenGL.");
|
||||||
#endif
|
#endif
|
||||||
static const char* TR_RESOLUTION_DESCRIPTION =
|
|
||||||
QT_TR_NOOP("Selects the display resolution used in fullscreen mode.\nThis should always be "
|
|
||||||
"bigger than or equal to the internal resolution. Performance impact is "
|
|
||||||
"negligible.\n\nIf unsure, select auto.");
|
|
||||||
static const char* TR_FULLSCREEN_DESCRIPTION = QT_TR_NOOP(
|
static const char* TR_FULLSCREEN_DESCRIPTION = QT_TR_NOOP(
|
||||||
"Enable this if you want the whole screen to be used for rendering.\nIf this is disabled, a "
|
"Enable this if you want the whole screen to be used for rendering.\nIf this is disabled, a "
|
||||||
"render window will be created instead.\n\nIf unsure, leave this unchecked.");
|
"render window will be created instead.\n\nIf unsure, leave this unchecked.");
|
||||||
|
@ -301,7 +270,6 @@ void GeneralWidget::AddDescriptions()
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
AddDescription(m_adapter_combo, TR_ADAPTER_DESCRIPTION);
|
AddDescription(m_adapter_combo, TR_ADAPTER_DESCRIPTION);
|
||||||
#endif
|
#endif
|
||||||
AddDescription(m_resolution_combo, TR_RESOLUTION_DESCRIPTION);
|
|
||||||
AddDescription(m_enable_fullscreen, TR_FULLSCREEN_DESCRIPTION);
|
AddDescription(m_enable_fullscreen, TR_FULLSCREEN_DESCRIPTION);
|
||||||
AddDescription(m_autoadjust_window_size, TR_AUTOSIZE_DESCRIPTION);
|
AddDescription(m_autoadjust_window_size, TR_AUTOSIZE_DESCRIPTION);
|
||||||
AddDescription(m_hide_cursor, TR_HIDE_MOUSE_CURSOR_DESCRIPTION);
|
AddDescription(m_hide_cursor, TR_HIDE_MOUSE_CURSOR_DESCRIPTION);
|
||||||
|
|
|
@ -38,7 +38,6 @@ private:
|
||||||
// Video
|
// Video
|
||||||
QGridLayout* m_video_layout;
|
QGridLayout* m_video_layout;
|
||||||
QComboBox* m_backend_combo;
|
QComboBox* m_backend_combo;
|
||||||
QComboBox* m_resolution_combo;
|
|
||||||
QComboBox* m_adapter_combo;
|
QComboBox* m_adapter_combo;
|
||||||
QComboBox* m_aspect_combo;
|
QComboBox* m_aspect_combo;
|
||||||
QCheckBox* m_enable_vsync;
|
QCheckBox* m_enable_vsync;
|
||||||
|
|
|
@ -382,41 +382,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title)
|
||||||
wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, space5, space5);
|
wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, space5, space5);
|
||||||
|
|
||||||
{
|
{
|
||||||
#if !defined(__APPLE__)
|
|
||||||
// display resolution
|
|
||||||
{
|
|
||||||
wxArrayString res_list;
|
|
||||||
res_list.Add(_("Auto"));
|
|
||||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
|
||||||
const auto resolutions = VideoUtils::GetAvailableResolutions(main_frame->m_xrr_config);
|
|
||||||
#else
|
|
||||||
const auto resolutions = VideoUtils::GetAvailableResolutions(nullptr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (const auto& res : resolutions)
|
|
||||||
res_list.Add(res);
|
|
||||||
|
|
||||||
if (res_list.empty())
|
|
||||||
res_list.Add(_("<No resolutions found>"));
|
|
||||||
label_display_resolution =
|
|
||||||
new wxStaticText(page_general, wxID_ANY, _("Fullscreen Resolution:"));
|
|
||||||
choice_display_resolution =
|
|
||||||
new wxChoice(page_general, wxID_ANY, wxDefaultPosition, wxDefaultSize, res_list);
|
|
||||||
RegisterControl(choice_display_resolution, wxGetTranslation(display_res_desc));
|
|
||||||
choice_display_resolution->Bind(wxEVT_CHOICE, &VideoConfigDiag::Event_DisplayResolution,
|
|
||||||
this);
|
|
||||||
|
|
||||||
choice_display_resolution->SetStringSelection(
|
|
||||||
StrToWxStr(SConfig::GetInstance().strFullscreenResolution));
|
|
||||||
// "Auto" is used as a keyword, convert to translated string
|
|
||||||
if (SConfig::GetInstance().strFullscreenResolution == "Auto")
|
|
||||||
choice_display_resolution->SetSelection(0);
|
|
||||||
|
|
||||||
szr_display->Add(label_display_resolution, 0, wxALIGN_CENTER_VERTICAL);
|
|
||||||
szr_display->Add(choice_display_resolution, 0, wxALIGN_CENTER_VERTICAL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// aspect-ratio
|
// aspect-ratio
|
||||||
{
|
{
|
||||||
const wxString ar_choices[] = {_("Auto"), _("Force 16:9"), _("Force 4:3"),
|
const wxString ar_choices[] = {_("Auto"), _("Force 16:9"), _("Force 4:3"),
|
||||||
|
@ -1010,26 +975,6 @@ void VideoConfigDiag::Event_Backend(wxCommandEvent& ev)
|
||||||
ev.Skip();
|
ev.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoConfigDiag::Event_DisplayResolution(wxCommandEvent& ev)
|
|
||||||
{
|
|
||||||
// "Auto" has been translated, it needs to be the English string "Auto" to work
|
|
||||||
switch (choice_display_resolution->GetSelection())
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
SConfig::GetInstance().strFullscreenResolution = "Auto";
|
|
||||||
break;
|
|
||||||
case wxNOT_FOUND:
|
|
||||||
break; // Nothing is selected.
|
|
||||||
default:
|
|
||||||
SConfig::GetInstance().strFullscreenResolution =
|
|
||||||
WxStrToStr(choice_display_resolution->GetStringSelection());
|
|
||||||
}
|
|
||||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
|
||||||
main_frame->m_xrr_config->Update();
|
|
||||||
#endif
|
|
||||||
ev.Skip();
|
|
||||||
}
|
|
||||||
|
|
||||||
void VideoConfigDiag::Event_ProgressiveScan(wxCommandEvent& ev)
|
void VideoConfigDiag::Event_ProgressiveScan(wxCommandEvent& ev)
|
||||||
{
|
{
|
||||||
Config::SetBase(Config::SYSCONF_PROGRESSIVE_SCAN, ev.IsChecked());
|
Config::SetBase(Config::SYSCONF_PROGRESSIVE_SCAN, ev.IsChecked());
|
||||||
|
@ -1135,13 +1080,6 @@ void VideoConfigDiag::OnUpdateUI(wxUpdateUIEvent& ev)
|
||||||
label_adapter->Disable();
|
label_adapter->Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __APPLE__
|
|
||||||
// This isn't supported on OS X.
|
|
||||||
|
|
||||||
choice_display_resolution->Disable();
|
|
||||||
label_display_resolution->Disable();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
progressive_scan_checkbox->Disable();
|
progressive_scan_checkbox->Disable();
|
||||||
render_to_main_checkbox->Disable();
|
render_to_main_checkbox->Disable();
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Event_Backend(wxCommandEvent& ev);
|
void Event_Backend(wxCommandEvent& ev);
|
||||||
void Event_DisplayResolution(wxCommandEvent& ev);
|
|
||||||
void Event_ProgressiveScan(wxCommandEvent& ev);
|
void Event_ProgressiveScan(wxCommandEvent& ev);
|
||||||
void Event_SafeTextureCache(wxCommandEvent& ev);
|
void Event_SafeTextureCache(wxCommandEvent& ev);
|
||||||
|
|
||||||
|
@ -144,7 +143,6 @@ protected:
|
||||||
|
|
||||||
wxChoice* choice_backend;
|
wxChoice* choice_backend;
|
||||||
wxChoice* choice_adapter;
|
wxChoice* choice_adapter;
|
||||||
wxChoice* choice_display_resolution;
|
|
||||||
|
|
||||||
wxStaticText* label_backend;
|
wxStaticText* label_backend;
|
||||||
wxStaticText* label_adapter;
|
wxStaticText* label_adapter;
|
||||||
|
|
Loading…
Reference in New Issue