Switch to vanilla v5, broken

This commit is contained in:
emeric
2022-02-13 14:01:49 +01:00
parent b93a78e1f4
commit b82b042737
2 changed files with 11 additions and 12 deletions
+7 -8
View File
@@ -27,14 +27,12 @@ namespace UserInterface {
LmsTheme::LmsTheme(Database::UITheme theme) LmsTheme::LmsTheme(Database::UITheme theme)
: _theme {theme} : _theme {theme}
{ {
setVersion(Wt::BootstrapVersion::v3);
setResponsive(true); // Should be not necessary since applied via head-matter
} }
void void
LmsTheme::setTheme(Database::UITheme theme) LmsTheme::setTheme(Database::UITheme )
{ {
if (theme == _theme) /* if (theme == _theme)
return; return;
// Hack, use the application interface directly since changing theme is not allowed // Hack, use the application interface directly since changing theme is not allowed
@@ -45,12 +43,13 @@ LmsTheme::setTheme(Database::UITheme theme)
_theme = theme; _theme = theme;
for (const auto& styleSheet : getStyleSheets(theme)) for (const auto& styleSheet : getStyleSheets(theme))
LmsApp->useStyleSheet(styleSheet); LmsApp->useStyleSheet(styleSheet);
*/
} }
/*
std::vector<Wt::WLinkedCssStyleSheet> std::vector<Wt::WLinkedCssStyleSheet>
LmsTheme::styleSheets() const LmsTheme::styleSheets() const
{ {
const std::vector<Wt::WLink> styleSheets {getStyleSheets(_theme)}; / const std::vector<Wt::WLink> styleSheets {getStyleSheets(_theme)};
std::vector<Wt::WLinkedCssStyleSheet> res; std::vector<Wt::WLinkedCssStyleSheet> res;
res.reserve(styleSheets.size()); res.reserve(styleSheets.size());
@@ -59,7 +58,7 @@ LmsTheme::styleSheets() const
} }
std::vector<Wt::WLink> std::vector<Wt::WLink>
LmsTheme::getStyleSheets(Database::UITheme theme) LmsTheme::getStyleSheets(Database::UITheme )
{ {
switch (theme) switch (theme)
{ {
@@ -85,5 +84,5 @@ LmsTheme::getStyleSheets(Database::UITheme theme)
} }
return {}; return {};
} }
*/
} }
+4 -4
View File
@@ -21,14 +21,14 @@
#include <vector> #include <vector>
#include <Wt/WBootstrapTheme.h> #include <Wt/WBootstrap5Theme.h>
#include <Wt/WLinkedCssStyleSheet.h> #include <Wt/WLinkedCssStyleSheet.h>
#include "services/database/Types.hpp" #include "services/database/Types.hpp"
namespace UserInterface namespace UserInterface
{ {
class LmsTheme : public Wt::WBootstrapTheme class LmsTheme : public Wt::WBootstrap5Theme
{ {
public: public:
LmsTheme(Database::UITheme theme); LmsTheme(Database::UITheme theme);
@@ -36,8 +36,8 @@ namespace UserInterface
void setTheme(Database::UITheme theme); void setTheme(Database::UITheme theme);
private: private:
std::vector<Wt::WLinkedCssStyleSheet> styleSheets() const override; // std::vector<Wt::WLinkedCssStyleSheet> styleSheets() const override;
static std::vector<Wt::WLink> getStyleSheets(Database::UITheme theme); // static std::vector<Wt::WLink> getStyleSheets(Database::UITheme theme);
Database::UITheme _theme; Database::UITheme _theme;
}; };