Skip to content

Commit

Permalink
Add ability to fill resources from autocompletion dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkanovikov committed Apr 3, 2023
1 parent 4ef8fe2 commit c159ab7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/management_layer/plugins/screenplay_breakdown
15 changes: 15 additions & 0 deletions src/corelib/ui/widgets/text_edit/completer/completer_text_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class CompleterTextEdit::Implementation
*/
bool isCompleterActive = true;

/**
* @brief Активно ли автодополнение
*/
bool isAutoCompleteEnabled = true;

/**
* @brief Подстановщик для завершения текста
*/
Expand Down Expand Up @@ -57,6 +62,16 @@ void CompleterTextEdit::setCompleterActive(bool _use)
d->isCompleterActive = _use;
}

bool CompleterTextEdit::isAutoCompleteEnabled() const
{
return d->isAutoCompleteEnabled;
}

void CompleterTextEdit::setAutoCompleteEnabled(bool _enabled)
{
d->isAutoCompleteEnabled = _enabled;
}

Completer* CompleterTextEdit::completer() const
{
return d->completer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ class CORE_LIBRARY_EXPORT CompleterTextEdit : public SpellCheckTextEdit
bool isCompleterActive() const;
void setCompleterActive(bool _use);

/**
* @brief Автоматическое дополнение
*/
bool isAutoCompleteEnabled() const;
void setAutoCompleteEnabled(bool _enabled);

/**
* @brief Получить подстановщика
*/
Expand Down
4 changes: 3 additions & 1 deletion src/corelib/ui/widgets/text_field/text_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,9 @@ void TextField::focusInEvent(QFocusEvent* _event)

d->finishAnimationIfInvisible();

d->completeIfNeeded();
if (isAutoCompleteEnabled()) {
d->completeIfNeeded();
}
}

void TextField::focusOutEvent(QFocusEvent* _event)
Expand Down

0 comments on commit c159ab7

Please sign in to comment.