]> git.sur5r.net Git - minitube/blobdiff - src/searchview.cpp
Fixed search widget
[minitube] / src / searchview.cpp
index aa0038a86f603ddeb1da82cb8d764a72e4c89a63..5b9add75cdcdcc5d1e96f6f68fc3ba63a1761a2e 100644 (file)
@@ -37,6 +37,7 @@ $END_LICENSE */
 #endif
 #include "mainwindow.h"
 #include "painterutils.h"
+#include "iconutils.h"
 
 namespace The {
 QHash<QString, QAction*>* globalActions();
@@ -70,7 +71,7 @@ SearchView::SearchView(QWidget *parent) : View(parent) {
     mainLayout->addLayout(hLayout);
 
     QLabel *logo = new QLabel(this);
-    logo->setPixmap(QPixmap(":/images/app.png"));
+    logo->setPixmap(IconUtils::pixmap(":/images/app.png"));
     hLayout->addWidget(logo, 0, Qt::AlignTop);
     hLayout->addSpacing(PADDING);
 
@@ -81,7 +82,6 @@ SearchView::SearchView(QWidget *parent) : View(parent) {
     QLabel *welcomeLabel =
             new QLabel("<h1 style='font-weight:100'>" +
                        tr("Welcome to <a href='%1'>%2</a>,")
-                       // .replace("<a ", "<a style='color:palette(text)'")
                        .replace("<a ", "<a style='text-decoration:none; color:palette(text);font-weight:normal' ")
                        .arg(Constants::WEBSITE, Constants::NAME)
                        + "</h1>", this);
@@ -139,13 +139,14 @@ SearchView::SearchView(QWidget *parent) : View(parent) {
 #ifdef APP_MAC_SEARCHFIELD
     queryEdit = new SearchLineEditMac(this);
 #else
-    queryEdit = new SearchLineEdit(this);
-    queryEdit->toWidget()->setFont(biggerFont);
+    SearchLineEdit *sle = new SearchLineEdit(this);
+    sle->setFont(biggerFont);
+    queryEdit = sle;
 #endif
 
     qDebug() << "queryEdit->toWidget()" << (queryEdit->toWidget() == 0) << queryEdit->toWidget();
     connect(queryEdit->toWidget(), SIGNAL(search(const QString&)), SLOT(watch(const QString&)));
-    connect(queryEdit->toWidget(), SIGNAL(textEdited(const QString &)), SLOT(textChanged(const QString &)));
+    connect(queryEdit->toWidget(), SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &)));
     connect(queryEdit->toWidget(), SIGNAL(suggestionAccepted(Suggestion*)), SLOT(suggestionAccepted(Suggestion*)));
 
     youtubeSuggest = new YTSuggester(this);
@@ -156,6 +157,9 @@ SearchView::SearchView(QWidget *parent) : View(parent) {
     searchLayout->addSpacing(10);
 
     watchButton = new QPushButton(tr("Watch"), this);
+#ifndef APP_MAC
+    watchButton->setFont(biggerFont);
+#endif
     watchButton->setDefault(true);
     watchButton->setEnabled(false);
     watchButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
@@ -257,7 +261,7 @@ void SearchView::updateRecentKeywords() {
         itemLabel->setAttribute(Qt::WA_DeleteOnClose);
         itemLabel->setProperty("recentItem", true);
         itemLabel->setMaximumWidth(queryEdit->toWidget()->width() + watchButton->width());
-        // itemLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+        itemLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
         // Make links navigable with the keyboard too
         itemLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse);
         if (needStatusTip)