diff --git a/src/gui/CommandDialog.cxx b/src/gui/CommandDialog.cxx index 048ebeb92..224d76714 100644 --- a/src/gui/CommandDialog.cxx +++ b/src/gui/CommandDialog.cxx @@ -115,16 +115,8 @@ void CommandDialog::loadConfig() myTimeMachineButton->setLabel(instance().state().mode() == StateManager::Mode::TimeMachine ? "Time Machine On" : "No Time Machine"); // Column 3 - myTVFormatButton->setLabel(instance().console().getFormatString() + " Mode"); - string palette, label; - palette = instance().settings().getString("palette"); - if(BSPF::equalsIgnoreCase(palette, "standard")) - label = "Stella Palette"; - else if(BSPF::equalsIgnoreCase(palette, "z26")) - label = "Z26 Palette"; - else - label = "User Palette"; - myPaletteButton->setLabel(label); + updateTVFormat(); + updatePalette(); myPhosphorButton->setLabel(instance().frameBuffer().tiaSurface().phosphorEnabled() ? "Phosphor On" : "Phosphor Off"); mySoundButton->setLabel(instance().audioSettings().enabled() ? "Sound On" : "Sound Off"); } @@ -199,13 +191,13 @@ void CommandDialog::handleCommand(CommandSender* sender, int cmd, // Column 3 case kFormatCmd: - instance().eventHandler().leaveMenuMode(); instance().console().toggleFormat(); + updateTVFormat(); break; case kPaletteCmd: - instance().eventHandler().leaveMenuMode(); instance().console().togglePalette(); + updatePalette(); break; case kPhosphorCmd: @@ -251,3 +243,24 @@ void CommandDialog::updateSlot(int slot) myStateSlotButton->setLabel("State Slot" + buf.str()); myLoadStateButton->setLabel("Load State" + buf.str()); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CommandDialog::updateTVFormat() +{ + myTVFormatButton->setLabel(instance().console().getFormatString() + " Mode"); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CommandDialog::updatePalette() +{ + string palette, label; + + palette = instance().settings().getString("palette"); + if(BSPF::equalsIgnoreCase(palette, "standard")) + label = "Stella Palette"; + else if(BSPF::equalsIgnoreCase(palette, "z26")) + label = "Z26 Palette"; + else + label = "User Palette"; + myPaletteButton->setLabel(label); +} diff --git a/src/gui/CommandDialog.hxx b/src/gui/CommandDialog.hxx index 1309fd06f..d3c1925c2 100644 --- a/src/gui/CommandDialog.hxx +++ b/src/gui/CommandDialog.hxx @@ -35,6 +35,8 @@ class CommandDialog : public Dialog void loadConfig() override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override; void updateSlot(int slot); + void updateTVFormat(); + void updatePalette(); // column 0 ButtonWidget* myColorButton;