Пример #1
0
void MainWindow::togglePolishedTheme()
{
     Wt::WApplication* app = Wt::WApplication::instance(); // Get the Wt::WApplication intstance for our thread

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