Пример #1
0
void MainWindow::toggleDefaultTheme()
{
     Wt::WApplication* app = Wt::WApplication::instance(); // Get the Wt::WApplication intstance for our thread
     std::string oldTheme = "polished";
     oldTheme = app->theme()->name();
     std::string newTheme = "default";

     newTheme = oldTheme == "default" ? "polished" : "default";
     app->setCssTheme(newTheme); // Toggle the theme between 'default' and 'polished'
     _btnToggleDefaultTheme->hide();
     _btnTogglePolishTheme->setText("Change to  polished theme" );
     // Make the client reload the css
     app->doJavaScript(app->javaScriptClass() + ".updateStyles()");
     app->refresh();

}