#include "mainwindow.h"
namespace The {
-QMap<QString, QAction*>* globalActions();
+QHash<QString, QAction*>* globalActions();
}
static const QString recentKeywordsKey = "recentKeywords";
#endif
QBoxLayout *mainLayout = new QVBoxLayout();
- mainLayout->setMargin(0);
+ mainLayout->setMargin(PADDING);
mainLayout->setSpacing(0);
// hidden message widget
message->hide();
mainLayout->addWidget(message);
-#ifdef APP_ACTIVATION
- if (!Activation::instance().isActivated())
- mainLayout->addWidget(Extra::buyButton(tr("Get the full version")), 0, Qt::AlignCenter);
-#endif
-
mainLayout->addStretch();
mainLayout->addSpacing(PADDING);
mainLayout->addSpacing(PADDING);
mainLayout->addStretch();
+#ifdef APP_ACTIVATION
+ if (!Activation::instance().isActivated())
+ mainLayout->addWidget(Extra::buyButton(tr("Get the full version")), 0, Qt::AlignRight);
+#endif
+
setLayout(mainLayout);
}
}
void SearchView::paintEvent(QPaintEvent * /*event*/) {
+ QPainter painter(this);
+
#if defined(APP_MAC) | defined(APP_WIN)
QBrush brush;
if (window()->isActiveWindow()) {
} else {
brush = palette().window();
}
- QPainter painter(this);
painter.fillRect(0, 0, width(), height(), brush);
#endif
+
+ static QLinearGradient shadow;
+ static const int shadowHeight = 10;
+ if (shadow.stops().count() == 2) {
+ shadow.setFinalStop(0, shadowHeight);
+ const qreal initialOpacity = 96;
+ for (qreal i = 0; i <= 1; i += 1.0/shadowHeight) {
+ qreal opacity = qPow(initialOpacity, (1.0 - i)) - 1;
+ shadow.setColorAt(i, QColor(0x00, 0x00, 0x00, opacity));
+ }
+ }
+ QRect r = rect();
+ painter.fillRect(r.x(), r.y(), r.width(), shadowHeight, QBrush(shadow));
}
void SearchView::searchTypeChanged(int index) {