Fixed searchclients to handle new Google URLs correctly; added GUI
[movie-schedule] / src / ui / backgroundlabel.cpp
index b9c622b..2ae0e2c 100644 (file)
 // along with MovieSchedule.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "backgroundlabel.h"
+#include "uiutils.h"
 
 #include <QPainter>
 #include <QFont>
+#include <iostream>
 
 static const int MINIMUM_FONT_SIZE = 40;
 
@@ -50,9 +52,10 @@ void BackgroundLabel::paintEvent(QPaintEvent *event)
 
     QRect widget_rect = painter.worldTransform().inverted().mapRect(rect());
     if (_cached_label_font_size <= 0 || widget_rect != _cached_widget_rect) {
+        bool landscape = rect().width() >= rect().height();
         _cached_widget_rect = widget_rect;
         _cached_label_rect = widget_rect;
-        _cached_label_rect.setTop(_cached_label_rect.top() + 20);
+        _cached_label_rect.setTop(_cached_label_rect.top() + (landscape ? 20 : 10));
         _cached_label_alignment = Qt::AlignHCenter | Qt::AlignTop;
         int font_size = 80;