SDK/TextAreaWidget: Add [Get|Set]TextFont
This commit is contained in:
parent
55e3e05f0c
commit
8457cb4df7
|
|
@ -278,6 +278,7 @@ Nazara Development Kit:
|
||||||
- Console has been remade with widgets (allowing to scroll back history, select text, etc.)
|
- Console has been remade with widgets (allowing to scroll back history, select text, etc.)
|
||||||
- Added TextAreaWidget line wrap option
|
- Added TextAreaWidget line wrap option
|
||||||
- TextAreaWidget will now shift the text to the left/right in order to keep the cursor visible
|
- TextAreaWidget will now shift the text to the left/right in order to keep the cursor visible
|
||||||
|
- Added TextAreaWidget::[Get|Set]TextFont
|
||||||
|
|
||||||
# 0.4:
|
# 0.4:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ namespace Ndk
|
||||||
inline std::size_t GetGlyphIndex(const Nz::Vector2ui& cursorPosition) const;
|
inline std::size_t GetGlyphIndex(const Nz::Vector2ui& cursorPosition) const;
|
||||||
inline const Nz::String& GetText() const;
|
inline const Nz::String& GetText() const;
|
||||||
inline const Nz::Color& GetTextColor() const;
|
inline const Nz::Color& GetTextColor() const;
|
||||||
|
inline Nz::Font* GetTextFont() const;
|
||||||
inline const Nz::Color& GetTextOulineColor() const;
|
inline const Nz::Color& GetTextOulineColor() const;
|
||||||
inline float GetTextOulineThickness() const;
|
inline float GetTextOulineThickness() const;
|
||||||
|
|
||||||
|
|
@ -76,6 +77,7 @@ namespace Ndk
|
||||||
inline void SetSelection(Nz::Vector2ui fromPosition, Nz::Vector2ui toPosition);
|
inline void SetSelection(Nz::Vector2ui fromPosition, Nz::Vector2ui toPosition);
|
||||||
inline void SetText(const Nz::String& text);
|
inline void SetText(const Nz::String& text);
|
||||||
inline void SetTextColor(const Nz::Color& text);
|
inline void SetTextColor(const Nz::Color& text);
|
||||||
|
inline void SetTextFont(Nz::FontRef font);
|
||||||
inline void SetTextOutlineColor(const Nz::Color& color);
|
inline void SetTextOutlineColor(const Nz::Color& color);
|
||||||
inline void SetTextOutlineThickness(float thickness);
|
inline void SetTextOutlineThickness(float thickness);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,11 @@ namespace Ndk
|
||||||
return m_drawer.GetColor();
|
return m_drawer.GetColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Nz::Font* TextAreaWidget::GetTextFont() const
|
||||||
|
{
|
||||||
|
return m_drawer.GetFont();
|
||||||
|
}
|
||||||
|
|
||||||
inline const Nz::Color& TextAreaWidget::GetTextOulineColor() const
|
inline const Nz::Color& TextAreaWidget::GetTextOulineColor() const
|
||||||
{
|
{
|
||||||
return m_drawer.GetOutlineColor();
|
return m_drawer.GetOutlineColor();
|
||||||
|
|
@ -265,6 +270,13 @@ namespace Ndk
|
||||||
UpdateDisplayText();
|
UpdateDisplayText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void TextAreaWidget::SetTextFont(Nz::FontRef font)
|
||||||
|
{
|
||||||
|
m_drawer.SetFont(font);
|
||||||
|
|
||||||
|
UpdateDisplayText();
|
||||||
|
}
|
||||||
|
|
||||||
inline void TextAreaWidget::SetTextOutlineColor(const Nz::Color& color)
|
inline void TextAreaWidget::SetTextOutlineColor(const Nz::Color& color)
|
||||||
{
|
{
|
||||||
m_drawer.SetOutlineColor(color);
|
m_drawer.SetOutlineColor(color);
|
||||||
|
|
|
||||||
|
|
@ -170,8 +170,8 @@ namespace Ndk
|
||||||
NazaraAssert(font && font->IsValid(), "Invalid font");
|
NazaraAssert(font && font->IsValid(), "Invalid font");
|
||||||
|
|
||||||
m_defaultFont = std::move(font);
|
m_defaultFont = std::move(font);
|
||||||
//m_historyDrawer.SetFont(m_defaultFont);
|
m_history->SetTextFont(m_defaultFont);
|
||||||
//m_inputDrawer.SetFont(m_defaultFont);
|
m_input->SetTextFont(m_defaultFont);
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue