Set a lower limit to available font size

This commit is contained in:
Gaute Lindkvist 2020-06-04 15:55:32 +02:00
parent 0709056d30
commit 664dc03c5b
2 changed files with 9 additions and 3 deletions

View File

@ -47,6 +47,8 @@
namespace caf
{
const int FontTools::MIN_FONT_SIZE = 6;
template <>
void FontTools::FontSizeEnum::setUp()
{
@ -132,8 +134,11 @@ QList<PdmOptionItemInfo> FontTools::relativeSizeValueOptions(FontSize normalPoin
QString uiText = RelativeSizeEnum::uiTextFromIndex(i);
RelativeSize relSize = RelativeSizeEnum::fromIndex(i);
int absolutePointSize = FontTools::absolutePointSize(normalPointSize, relSize);
if (absolutePointSize >= MIN_FONT_SIZE)
{
uiText += QString(" (%1 pt)").arg(absolutePointSize);
options.push_back(PdmOptionItemInfo(uiText, relSize));
}
}
return options;
}

View File

@ -54,10 +54,11 @@ namespace caf
class FontTools
{
public:
static const int MIN_FONT_SIZE;
enum class FontSize
{
INVALID = -1,
MIN_FONT_SIZE = 8,
FONT_SIZE_8 = 8,
FONT_SIZE_10 = 10,
FONT_SIZE_12 = 12,