Commit e4e6b239 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Forms: Don't set the text if the text is the same of the existing text

Causes the text cursor to move around on focus in, which is a bit
confusing to the user
parent 90502b29
Pipeline #24857 passed with stage
in 17 minutes and 17 seconds
......@@ -530,7 +530,8 @@ bool FormLineEdit::event( QEvent* e )
else if ( e->type() == QEvent::FocusIn )
{
const auto fft = static_cast< Okular::FormFieldText * > ( m_ff );
setText( fft->text() );
if ( text() != fft->text() )
setText( fft->text() );
m_editing = true;
if( const Okular::Action *action = m_ff->additionalAction( Okular::Annotation::FocusIn ) )
emit m_controller->focusAction( action, fft );
......@@ -705,7 +706,8 @@ bool TextAreaEdit::event( QEvent* e )
else if ( e->type() == QEvent::FocusIn )
{
const auto fft = static_cast< Okular::FormFieldText * > ( m_ff );
setText( fft->text() );
if ( toPlainText() != fft->text() )
setText( fft->text() );
m_editing = true;
}
else if ( e->type() == QEvent::FocusOut )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment