Widgets: Add SimpleLabelWidget

A simpler alternative to LabelWidget
This commit is contained in:
SirLynix
2024-02-08 00:24:31 +01:00
parent f0b4674039
commit 23645fc398
13 changed files with 241 additions and 45 deletions

View File

@@ -0,0 +1,26 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Widgets module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Widgets/SimpleLabelWidget.hpp>
#include <Nazara/Utility/AbstractTextDrawer.hpp>
#include <Nazara/Widgets/Debug.hpp>
namespace Nz
{
void SimpleLabelWidget::UpdateText()
{
m_style->UpdateText(m_drawer);
}
void SimpleLabelWidget::UpdateTextAndSize()
{
m_style->UpdateText(m_drawer);
Vector2f size(m_drawer.GetBounds().GetLengths());
SetMinimumSize(size);
SetPreferredSize(size);
Layout();
}
}