diff options
author | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-03-20 12:20:53 +0100 |
---|---|---|
committer | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-03-20 12:20:53 +0100 |
commit | c03ecbeff265d422cc503806023cc1b28050e7bb (patch) | |
tree | 4e8c7f37bc82df68c46e09016c2d7385635152ea | |
parent | f4a63ef38874f11b04d637693c14951d1a08638c (diff) |
[guilib] hint text not displayed in keyboard dialog
-rw-r--r-- | xbmc/guilib/GUIEditControl.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/xbmc/guilib/GUIEditControl.cpp b/xbmc/guilib/GUIEditControl.cpp index e9b4877d57..cc4ce48715 100644 --- a/xbmc/guilib/GUIEditControl.cpp +++ b/xbmc/guilib/GUIEditControl.cpp @@ -486,13 +486,14 @@ void CGUIEditControl::ProcessText(unsigned int currentTime) changed |= m_label2.SetMaxRect(m_clipRect.x1 + m_textOffset, m_posY, m_clipRect.Width() - m_textOffset, m_height); std::wstring text = GetDisplayedText(); - // add the cursor and highlighting if we're focused - if ((HasFocus() || m_cursorShowAlways) && m_inputType != INPUT_TYPE_READONLY) - changed |= SetStyledText(text); + std::string hint = m_hintInfo.GetLabel(GetParentID()); + + if (!HasFocus() && text.empty() && !hint.empty()) + changed |= m_label2.SetText(hint); else { - if (text.empty()) - changed |= m_label2.SetText(m_hintInfo.GetLabel(GetParentID())); + if (m_inputType != INPUT_TYPE_READONLY) + changed |= SetStyledText(text); else changed |= m_label2.SetTextW(text); } @@ -582,10 +583,13 @@ bool CGUIEditControl::SetStyledText(const std::wstring &text) } // show the cursor - unsigned int ch = L'|'; - if ((++m_cursorBlink % 64) > 32) - ch |= (3 << 16); - styled.insert(styled.begin() + m_cursorPos, ch); + if (HasFocus() || GetParentID() == WINDOW_DIALOG_KEYBOARD) + { + unsigned int ch = L'|'; + if ((++m_cursorBlink % 64) > 32) + ch |= (3 << 16); + styled.insert(styled.begin() + m_cursorPos, ch); + } return m_label2.SetStyledText(styled, colors); } |