From: Flavio Tordini Date: Sun, 21 Sep 2014 16:43:04 +0000 (+0200) Subject: Rounded corners for suggestions popup X-Git-Tag: 2.3~24 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1f9b66acda4bd74f6d83e1239c3755cd50a6413e;p=minitube Rounded corners for suggestions popup --- 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() {