1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00
OpenMW/components/widgets/fontwrapper.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
541 B
C++
Raw Normal View History

2023-10-31 06:18:09 +00:00
#ifndef OPENMW_WIDGETS_WRAPPER_H
#define OPENMW_WIDGETS_WRAPPER_H
#include <MyGUI_Prerequest.h>
#include "components/settings/values.hpp"
2023-11-01 07:49:13 +00:00
#include <string>
2023-10-31 06:18:09 +00:00
namespace Gui
{
2023-11-01 07:49:13 +00:00
/// Wrapper to tell UI element to use font size from settings.cfg
2023-10-31 06:18:09 +00: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