Skip to content
Snippets Groups Projects
Commit 21185a44 authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Properly reset the autocomplete anchor when the popup closes

fixes #305
parent fde066e2
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,8 @@
#include <QPainter>
#include <QStyleOption>
constexpr int PopupHMargin = 5;
constexpr int PopupItemMargin = 4;
constexpr int PopupHMargin = 4;
constexpr int PopupItemMargin = 3;
PopupItem::PopupItem(QWidget *parent)
: QWidget(parent)
......@@ -23,6 +23,8 @@ PopupItem::PopupItem(QWidget *parent)
topLayout_ = new QHBoxLayout(this);
topLayout_->setContentsMargins(
PopupHMargin, PopupItemMargin, PopupHMargin, PopupItemMargin);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
}
void
......
......@@ -217,6 +217,7 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
auto word = cursor.selectedText();
if (cursor.position() == 0) {
resetAnchor();
closeSuggestions();
return;
}
......@@ -231,6 +232,7 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
emit showSuggestions(query());
} else {
resetAnchor();
closeSuggestions();
}
......
......@@ -70,7 +70,7 @@ PreviewUploadOverlay::init()
winsize = window->frameGeometry().size();
center = window->frameGeometry().center();
} else {
nhlog::ui()->warn("unable to load the retrieve MainWindow's size");
nhlog::ui()->warn("unable to retrieve MainWindow's size");
}
fileName_.setText(QFileInfo{filePath_}.fileName());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment