From 1f9b66acda4bd74f6d83e1239c3755cd50a6413e Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Sun, 21 Sep 2014 18:43:04 +0200 Subject: [PATCH] Rounded corners for suggestions popup --- src/autocomplete.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/autocomplete.cpp b/src/autocomplete.cpp index f915408..1678073 100644 --- a/src/autocomplete.cpp +++ b/src/autocomplete.cpp @@ -41,6 +41,10 @@ AutoComplete::AutoComplete(SearchLineEdit *parent, QLineEdit *editor): popup->setFocusPolicy(Qt::NoFocus); popup->setFocusProxy(buddy); + popup->setFrameShape(QFrame::NoFrame); + popup->setAttribute(Qt::WA_TranslucentBackground); + popup->viewport()->setStyleSheet("border:0; border-radius:5px; background:palette(base)"); + connect(popup, SIGNAL(itemClicked(QListWidgetItem*)), SLOT(doneCompletion())); // connect(popup, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), @@ -149,6 +153,8 @@ void AutoComplete::showCompletion(const QStringList &choices) { popup->move(buddy->mapToGlobal(QPoint(0, buddy->height()))); + popup->setFrameShape(QFrame::NoFrame); + popup->setFocus(); popup->show(); } @@ -169,6 +175,7 @@ void AutoComplete::preventSuggest() { timer->stop(); enabled = false; popup->hide(); + popup->setFrameShape(QFrame::NoFrame); } void AutoComplete::enableSuggest() { -- 2.39.5