Minor code editor fixes.

Improved touch dragging.
Minor API change in UIMenu::add*.
Updated the README.md.
Added TODO.md (to keep track on the things I want to improve/implement).
This commit is contained in:
Martín Lucas Golini
2020-06-16 17:39:49 -03:00
parent eebaa7e790
commit abc47067a4
18 changed files with 257 additions and 127 deletions

View File

@@ -663,15 +663,18 @@ void App::initSearchBar() {
UITextInput* findInput = mSearchBarLayout->find<UITextInput>( "search_find" );
UITextInput* replaceInput = mSearchBarLayout->find<UITextInput>( "search_replace" );
UICheckBox* caseSensitiveChk = mSearchBarLayout->find<UICheckBox>( "case_sensitive" );
findInput->addEventListener(
Event::OnTextChanged, [&, findInput, caseSensitiveChk]( const Event* ) {
findInput->addEventListener( Event::OnTextChanged, [&, findInput,
caseSensitiveChk]( const Event* ) {
if ( mCurEditor ) {
if ( !findInput->getText().empty() ) {
mCurEditor->getDocument().setSelection( mCurEditor->getDocument().startOfDoc() );
findNextText( findInput->getText(), caseSensitiveChk->isChecked() );
} else if ( mCurEditor ) {
} else {
mCurEditor->getDocument().setSelection(
mCurEditor->getDocument().getSelection().start() );
}
} );
}
} );
mSearchBarLayout->addCommand( "close-searchbar", [&] {
mSearchBarLayout->setEnabled( false )->setVisible( false );
mCurEditor->setFocus();