Sdk/TextAreaWidget: Fix cursor showing up on readonly text area
This commit is contained in:
parent
d98b7a8f4f
commit
3cff3fbadc
|
|
@ -170,8 +170,7 @@ namespace Ndk
|
|||
inline void TextAreaWidget::SetReadOnly(bool readOnly)
|
||||
{
|
||||
m_readOnly = readOnly;
|
||||
|
||||
m_cursorEntity->Enable(!m_readOnly);
|
||||
m_cursorEntity->Enable(!m_readOnly && HasFocus());
|
||||
}
|
||||
|
||||
inline void TextAreaWidget::SetText(const Nz::String& text)
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ namespace Ndk
|
|||
|
||||
void TextAreaWidget::OnFocusReceived()
|
||||
{
|
||||
if (!m_readOnly)
|
||||
m_cursorEntity->Enable(true);
|
||||
}
|
||||
|
||||
|
|
@ -289,6 +290,9 @@ namespace Ndk
|
|||
|
||||
void TextAreaWidget::RefreshCursor()
|
||||
{
|
||||
if (m_readOnly)
|
||||
return;
|
||||
|
||||
const auto& lineInfo = m_drawer.GetLine(m_cursorPosition.y);
|
||||
std::size_t cursorGlyph = GetGlyphIndex(m_cursorPosition);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue