Unify font+theme into Display menu

This commit is contained in:
Charles J. Cliffe 2016-07-28 19:33:59 -04:00
parent d23f59a3c9
commit 9ea5d704c0

View File

@ -379,20 +379,10 @@ AppFrame::AppFrame() :
menuBar->Append(menu, wxT("Audio &Output")); menuBar->Append(menu, wxT("Audio &Output"));
menu = new wxMenu; sampleRateMenu = new wxMenu;
menuBar->Append(sampleRateMenu, wxT("Sample &Rate"));
int themeId = wxGetApp().getConfig()->getTheme();
menu->AppendRadioItem(wxID_THEME_DEFAULT, "Default")->Check(themeId==COLOR_THEME_DEFAULT);
menu->AppendRadioItem(wxID_THEME_RADAR, "RADAR")->Check(themeId==COLOR_THEME_RADAR);
menu->AppendRadioItem(wxID_THEME_BW, "Black & White")->Check(themeId==COLOR_THEME_BW);
menu->AppendRadioItem(wxID_THEME_SHARP, "Sharp")->Check(themeId==COLOR_THEME_SHARP);
menu->AppendRadioItem(wxID_THEME_RAD, "Rad")->Check(themeId==COLOR_THEME_RAD);
menu->AppendRadioItem(wxID_THEME_TOUCH, "Touch")->Check(themeId==COLOR_THEME_TOUCH);
menu->AppendRadioItem(wxID_THEME_HD, "HD")->Check(themeId==COLOR_THEME_HD);
menuBar->Append(menu, wxT("&Color Scheme"));
// Audio Sample Rates
menu = new wxMenu; menu = new wxMenu;
#define NUM_RATES_DEFAULT 4 #define NUM_RATES_DEFAULT 4
@ -441,22 +431,36 @@ AppFrame::AppFrame() :
} }
} }
sampleRateMenu = new wxMenu;
menuBar->Append(sampleRateMenu, wxT("Sample &Rate"));
menuBar->Append(menu, wxT("Audio &Sample Rate")); menuBar->Append(menu, wxT("Audio &Sample Rate"));
//Add Display menu //Add Display menu
displayMenu = new wxMenu; displayMenu = new wxMenu;
menuBar->Append(displayMenu, wxT("&Display")); wxMenu *fontMenu = new wxMenu;
int fontScale = wxGetApp().getConfig()->getFontScale(); int fontScale = wxGetApp().getConfig()->getFontScale();
displayMenu->AppendRadioItem(wxID_DISPLAY_BASE, "Text Size: Normal")->Check(GLFont::GLFONT_SCALE_NORMAL == fontScale); fontMenu->AppendRadioItem(wxID_DISPLAY_BASE, "Normal")->Check(GLFont::GLFONT_SCALE_NORMAL == fontScale);
displayMenu->AppendRadioItem(wxID_DISPLAY_BASE + 1, "Text Size: 1.5x")->Check(GLFont::GLFONT_SCALE_MEDIUM == fontScale); fontMenu->AppendRadioItem(wxID_DISPLAY_BASE + 1, "1.5x")->Check(GLFont::GLFONT_SCALE_MEDIUM == fontScale);
displayMenu->AppendRadioItem(wxID_DISPLAY_BASE + 2, "Text Size: 2.0x")->Check(GLFont::GLFONT_SCALE_LARGE == fontScale); fontMenu->AppendRadioItem(wxID_DISPLAY_BASE + 2, "2.0x")->Check(GLFont::GLFONT_SCALE_LARGE == fontScale);
displayMenu->AppendSubMenu(fontMenu, "&Text Size");
wxMenu *themeMenu = new wxMenu;
int themeId = wxGetApp().getConfig()->getTheme();
themeMenu->AppendRadioItem(wxID_THEME_DEFAULT, "Default")->Check(themeId==COLOR_THEME_DEFAULT);
themeMenu->AppendRadioItem(wxID_THEME_RADAR, "RADAR")->Check(themeId==COLOR_THEME_RADAR);
themeMenu->AppendRadioItem(wxID_THEME_BW, "Black & White")->Check(themeId==COLOR_THEME_BW);
themeMenu->AppendRadioItem(wxID_THEME_SHARP, "Sharp")->Check(themeId==COLOR_THEME_SHARP);
themeMenu->AppendRadioItem(wxID_THEME_RAD, "Rad")->Check(themeId==COLOR_THEME_RAD);
themeMenu->AppendRadioItem(wxID_THEME_TOUCH, "Touch")->Check(themeId==COLOR_THEME_TOUCH);
themeMenu->AppendRadioItem(wxID_THEME_HD, "HD")->Check(themeId==COLOR_THEME_HD);
displayMenu->AppendSubMenu(themeMenu, wxT("&Color Scheme"));
menuBar->Append(displayMenu, wxT("&Display"));
GLFont::setScale((GLFont::GLFontScale)fontScale); GLFont::setScale((GLFont::GLFontScale)fontScale);
@ -721,7 +725,7 @@ void AppFrame::updateDeviceParams() {
sampleRateMenuItems[wxID_BANDWIDTH_MANUAL]->Check(true); sampleRateMenuItems[wxID_BANDWIDTH_MANUAL]->Check(true);
} }
menuBar->Replace(4, newSampleRateMenu, wxT("Sample &Rate")); menuBar->Replace(3, newSampleRateMenu, wxT("Sample &Rate"));
sampleRateMenu = newSampleRateMenu; sampleRateMenu = newSampleRateMenu;
if (!wxGetApp().getAGCMode()) { if (!wxGetApp().getAGCMode()) {