]> git.sur5r.net Git - minitube/commitdiff
Rounded corners for suggestions popup
authorFlavio Tordini <flavio.tordini@gmail.com>
Sun, 21 Sep 2014 16:43:04 +0000 (18:43 +0200)
committerFlavio <flavio.tordini@gmail.com>
Sun, 21 Sep 2014 16:43:04 +0000 (18:43 +0200)
src/autocomplete.cpp

index f91540892d972d5266c323821b4c555f080fbb3b..1678073ae1aae5ef267696938355a3abf434a294 100644 (file)
@@ -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() {