searchLayout->setAlignment(Qt::AlignVCenter);
queryEdit = new SearchLineEdit(this);
+#ifndef APP_MAC
queryEdit->setFont(biggerFont);
- queryEdit->setMinimumWidth(queryEdit->fontInfo().pixelSize()*15);
+#endif
connect(queryEdit, SIGNAL(search(const QString&)), SLOT(watch(const QString&)));
- connect(queryEdit, SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &)));
- connect(queryEdit, SIGNAL(suggestionAccepted(const QString&)), SLOT(watch(const QString&)));
+ connect(queryEdit, SIGNAL(textEdited(const QString &)), SLOT(textChanged(const QString &)));
+ connect(queryEdit, SIGNAL(suggestionAccepted(Suggestion*)), SLOT(suggestionAccepted(Suggestion*)));
youtubeSuggest = new YTSuggester(this);
channelSuggest = new ChannelSuggest(this);
updateRecentChannels();
queryEdit->selectAll();
queryEdit->enableSuggest();
- QTimer::singleShot(0, queryEdit, SLOT(setFocus()));
+ if (!queryEdit->hasFocus())
+ QTimer::singleShot(10, queryEdit, SLOT(setFocus()));
}
void SearchView::updateRecentKeywords() {
queryEdit->selectAll();
queryEdit->setFocus();
}
+
+void SearchView::suggestionAccepted(Suggestion *suggestion) {
+ watch(suggestion->value);
+}