1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/components/widgets/fontwrapper.hpp

26 lines
541 B
C++
Raw Normal View History

2023-10-31 10:18:09 +04:00
#ifndef OPENMW_WIDGETS_WRAPPER_H
#define OPENMW_WIDGETS_WRAPPER_H
#include <MyGUI_Prerequest.h>
#include "components/settings/values.hpp"
2023-11-01 11:49:13 +04:00
#include <string>
2023-10-31 10:18:09 +04:00
namespace Gui
{
2023-11-01 11:49:13 +04:00
/// Wrapper to tell UI element to use font size from settings.cfg
2023-10-31 10:18:09 +04:00
template <class T>
class FontWrapper : public T
{
public:
void setFontName(std::string_view name) override
{
T::setFontName(name);
T::setPropertyOverride("FontHeight", std::to_string(Settings::gui().mFontSize));
}
};
}
#endif