WX: HiDPI: Config Panes

This commit is contained in:
EmptyChaos
2016-08-02 06:22:37 +00:00
parent c893447913
commit a4d633de15
11 changed files with 244 additions and 167 deletions

View File

@ -14,6 +14,7 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "DiscIO/Enums.h"
#include "DolphinWX/Config/WiiConfigPane.h"
#include "DolphinWX/DolphinSlider.h"
#include "DolphinWX/WxUtils.h"
WiiConfigPane::WiiConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id)
@ -52,14 +53,10 @@ void WiiConfigPane::InitializeGUI()
m_connect_keyboard_checkbox = new wxCheckBox(this, wxID_ANY, _("Connect USB Keyboard"));
m_bt_sensor_bar_pos =
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_bt_sensor_bar_pos_strings);
m_bt_sensor_bar_sens = new wxSlider(this, wxID_ANY, 0, 0, 4);
m_bt_speaker_volume = new wxSlider(this, wxID_ANY, 0, 0, 127);
m_bt_sensor_bar_sens = new DolphinSlider(this, wxID_ANY, 0, 0, 4);
m_bt_speaker_volume = new DolphinSlider(this, wxID_ANY, 0, 0, 127);
m_bt_wiimote_motor = new wxCheckBox(this, wxID_ANY, _("Wiimote Motor"));
// With some GTK themes, no minimum size will be applied - so do this manually here
m_bt_sensor_bar_sens->SetMinSize(wxSize(100, -1));
m_bt_speaker_volume->SetMinSize(wxSize(100, -1));
m_screensaver_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnScreenSaverCheckBoxChanged, this);
m_pal60_mode_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnPAL60CheckBoxChanged, this);
m_aspect_ratio_choice->Bind(wxEVT_CHOICE, &WiiConfigPane::OnAspectRatioChoiceChanged, this);
@ -79,67 +76,78 @@ void WiiConfigPane::InitializeGUI()
m_sd_card_checkbox->SetToolTip(_("Saved to /Wii/sd.raw (default size is 128mb)"));
m_connect_keyboard_checkbox->SetToolTip(_("May cause slow down in Wii Menu and some games."));
wxGridBagSizer* const misc_settings_grid_sizer = new wxGridBagSizer();
misc_settings_grid_sizer->Add(m_screensaver_checkbox, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL,
5);
misc_settings_grid_sizer->Add(m_pal60_mode_checkbox, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL,
5);
const int space5 = FromDIP(5);
wxGridBagSizer* const misc_settings_grid_sizer = new wxGridBagSizer(space5, space5);
misc_settings_grid_sizer->Add(m_screensaver_checkbox, wxGBPosition(0, 0), wxGBSpan(1, 2));
misc_settings_grid_sizer->Add(m_pal60_mode_checkbox, wxGBPosition(1, 0), wxGBSpan(1, 2));
misc_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Aspect Ratio:")),
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL,
5);
misc_settings_grid_sizer->Add(m_aspect_ratio_choice, wxGBPosition(2, 1), wxDefaultSpan, wxALL, 5);
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
misc_settings_grid_sizer->Add(m_aspect_ratio_choice, wxGBPosition(2, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
misc_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("System Language:")),
wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL,
5);
misc_settings_grid_sizer->Add(m_system_language_choice, wxGBPosition(3, 1), wxDefaultSpan, wxALL,
5);
wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
misc_settings_grid_sizer->Add(m_system_language_choice, wxGBPosition(3, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
auto* const bt_sensor_bar_pos_sizer = new wxBoxSizer(wxHORIZONTAL);
bt_sensor_bar_pos_sizer->Add(new wxStaticText(this, wxID_ANY, _("Min")), 0,
wxALIGN_CENTER_VERTICAL);
bt_sensor_bar_pos_sizer->Add(m_bt_sensor_bar_sens);
bt_sensor_bar_pos_sizer->Add(m_bt_sensor_bar_sens, 0, wxALIGN_CENTER_VERTICAL);
bt_sensor_bar_pos_sizer->Add(new wxStaticText(this, wxID_ANY, _("Max")), 0,
wxALIGN_CENTER_VERTICAL);
auto* const bt_speaker_volume_sizer = new wxBoxSizer(wxHORIZONTAL);
bt_speaker_volume_sizer->Add(new wxStaticText(this, wxID_ANY, _("Min")), 0,
wxALIGN_CENTER_VERTICAL);
bt_speaker_volume_sizer->Add(m_bt_speaker_volume);
bt_speaker_volume_sizer->Add(m_bt_speaker_volume, 0, wxALIGN_CENTER_VERTICAL);
bt_speaker_volume_sizer->Add(new wxStaticText(this, wxID_ANY, _("Max")), 0,
wxALIGN_CENTER_VERTICAL);
wxGridBagSizer* const bt_settings_grid_sizer = new wxGridBagSizer();
wxGridBagSizer* const bt_settings_grid_sizer = new wxGridBagSizer(space5, space5);
bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Sensor Bar Position:")),
wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL,
5);
bt_settings_grid_sizer->Add(m_bt_sensor_bar_pos, wxGBPosition(0, 1), wxDefaultSpan, wxALL, 5);
wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
bt_settings_grid_sizer->Add(m_bt_sensor_bar_pos, wxGBPosition(0, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("IR Sensitivity:")),
wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL,
5);
bt_settings_grid_sizer->Add(bt_sensor_bar_pos_sizer, wxGBPosition(1, 1), wxDefaultSpan, wxALL, 5);
wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
bt_settings_grid_sizer->Add(bt_sensor_bar_pos_sizer, wxGBPosition(1, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Speaker Volume:")),
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL,
5);
bt_settings_grid_sizer->Add(bt_speaker_volume_sizer, wxGBPosition(2, 1), wxDefaultSpan, wxALL, 5);
bt_settings_grid_sizer->Add(m_bt_wiimote_motor, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALL, 5);
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
bt_settings_grid_sizer->Add(bt_speaker_volume_sizer, wxGBPosition(2, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
bt_settings_grid_sizer->Add(m_bt_wiimote_motor, wxGBPosition(3, 0), wxGBSpan(1, 2),
wxALIGN_CENTER_VERTICAL);
wxStaticBoxSizer* const misc_settings_static_sizer =
new wxStaticBoxSizer(wxVERTICAL, this, _("Misc Settings"));
misc_settings_static_sizer->Add(misc_settings_grid_sizer);
misc_settings_static_sizer->AddSpacer(space5);
misc_settings_static_sizer->Add(misc_settings_grid_sizer, 0, wxLEFT | wxRIGHT, space5);
misc_settings_static_sizer->AddSpacer(space5);
wxStaticBoxSizer* const device_settings_sizer =
new wxStaticBoxSizer(wxVERTICAL, this, _("Device Settings"));
device_settings_sizer->Add(m_sd_card_checkbox, 0, wxALL, 5);
device_settings_sizer->Add(m_connect_keyboard_checkbox, 0, wxALL, 5);
device_settings_sizer->AddSpacer(space5);
device_settings_sizer->Add(m_sd_card_checkbox, 0, wxLEFT | wxRIGHT, space5);
device_settings_sizer->AddSpacer(space5);
device_settings_sizer->Add(m_connect_keyboard_checkbox, 0, wxLEFT | wxRIGHT, space5);
device_settings_sizer->AddSpacer(space5);
auto* const bt_settings_static_sizer =
new wxStaticBoxSizer(wxVERTICAL, this, _("Wii Remote Settings"));
bt_settings_static_sizer->Add(bt_settings_grid_sizer);
bt_settings_static_sizer->AddSpacer(space5);
bt_settings_static_sizer->Add(bt_settings_grid_sizer, 0, wxLEFT | wxRIGHT, space5);
bt_settings_static_sizer->AddSpacer(space5);
wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
main_sizer->Add(misc_settings_static_sizer, 0, wxEXPAND | wxALL, 5);
main_sizer->Add(device_settings_sizer, 0, wxEXPAND | wxALL, 5);
main_sizer->Add(bt_settings_static_sizer, 0, wxEXPAND | wxALL, 5);
main_sizer->AddSpacer(space5);
main_sizer->Add(misc_settings_static_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
main_sizer->AddSpacer(space5);
main_sizer->Add(device_settings_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
main_sizer->AddSpacer(space5);
main_sizer->Add(bt_settings_static_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
main_sizer->AddSpacer(space5);
SetSizer(main_sizer);
}