Widgets: Improve theme
- move simple styles classes ton their own file - add button hovered texture - add button hovered/pressed texture - add label style
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Widgets/WidgetTheme.hpp>
|
||||
#include <Nazara/Graphics/Components/GraphicsComponent.hpp>
|
||||
#include <Nazara/Utility/Components/NodeComponent.hpp>
|
||||
#include <Nazara/Widgets/Canvas.hpp>
|
||||
#include <Nazara/Widgets/Debug.hpp>
|
||||
|
||||
@@ -12,11 +14,23 @@ namespace Nz
|
||||
|
||||
BaseWidgetStyle::~BaseWidgetStyle() = default;
|
||||
|
||||
entt::entity BaseWidgetStyle::CreateGraphicsEntity()
|
||||
{
|
||||
auto& registry = GetRegistry();
|
||||
|
||||
entt::entity entity = CreateEntity();
|
||||
registry.emplace<GraphicsComponent>(entity, m_widgetOwner->IsVisible());
|
||||
registry.emplace<NodeComponent>(entity).SetParent(m_widgetOwner);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
UInt32 BaseWidgetStyle::GetRenderMask() const
|
||||
{
|
||||
return m_widgetOwner->GetCanvas()->GetRenderMask();
|
||||
}
|
||||
|
||||
|
||||
void ButtonWidgetStyle::OnHoverBegin()
|
||||
{
|
||||
}
|
||||
@@ -32,4 +46,13 @@ namespace Nz
|
||||
void ButtonWidgetStyle::OnRelease()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void LabelWidgetStyle::OnHoverBegin()
|
||||
{
|
||||
}
|
||||
|
||||
void LabelWidgetStyle::OnHoverEnd()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user