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
|