mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-16 23:12:55 -05:00
feat: Add cancel function for progress indicator
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
|
||||
#include <texteditor/basehoverhandler.h>
|
||||
#include <QPointer>
|
||||
#include <functional>
|
||||
|
||||
namespace QodeAssist {
|
||||
|
||||
@ -31,6 +32,8 @@ class CompletionProgressHandler : public TextEditor::BaseHoverHandler
|
||||
public:
|
||||
void showProgress(TextEditor::TextEditorWidget *widget);
|
||||
void hideProgress();
|
||||
void setCancelCallback(std::function<void()> callback);
|
||||
bool isProgressVisible() const { return !m_progressWidget.isNull(); }
|
||||
|
||||
protected:
|
||||
void identifyMatch(
|
||||
@ -41,6 +44,7 @@ private:
|
||||
QPointer<TextEditor::TextEditorWidget> m_widget;
|
||||
QPointer<ProgressWidget> m_progressWidget;
|
||||
QPoint m_iconPosition;
|
||||
std::function<void()> m_cancelCallback;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist
|
||||
|
||||
Reference in New Issue
Block a user