Make FontWrapper conditional

simplify_debugging
Evil Eye 1 year ago
parent 492e336c0c
commit 4e05dd3cd3

@ -1,6 +1,7 @@
#ifndef OPENMW_WIDGETS_WRAPPER_H
#define OPENMW_WIDGETS_WRAPPER_H
#include <MyGUI_Prerequest.h>
#include <components/settings/settings.hpp>
#include <algorithm>
@ -10,6 +11,7 @@ namespace Gui
template <class T>
class FontWrapper : public T
{
#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3, 4, 2)
public:
void setFontName(const std::string& name) override
{
@ -22,6 +24,7 @@ namespace Gui
{
T::setPropertyOverride(_key, _value);
// https://github.com/MyGUI/mygui/issues/113
// There is a bug in MyGUI: when it initializes the FontName property, it reset the font height.
// We should restore it.
if (_key == "FontName")
@ -31,7 +34,7 @@ namespace Gui
}
private:
std::string getFontSize()
const std::string& getFontSize()
{
// Note: we can not use the FontLoader here, so there is a code duplication a bit.
static const std::string fontSize
@ -39,6 +42,7 @@ namespace Gui
return fontSize;
}
};
#endif
}
#endif

Loading…
Cancel
Save