X-Git-Url: http://git.maemo.org/git/?p=movie-schedule;a=blobdiff_plain;f=src%2Fui%2Fbackgroundlabel.cpp;h=2ae0e2c029fbfbe2731763f71265309993665b53;hp=b9c622b8d4c7dd31f1041f196285e56b4a0e12b9;hb=bb467534ecac666816ae036272a474174d9d8449;hpb=fbbb2a758b18a7afff51d27852f85977fe796b35
diff --git a/src/ui/backgroundlabel.cpp b/src/ui/backgroundlabel.cpp
index b9c622b..2ae0e2c 100644
--- a/src/ui/backgroundlabel.cpp
+++ b/src/ui/backgroundlabel.cpp
@@ -16,9 +16,11 @@
// along with MovieSchedule. If not, see .
#include "backgroundlabel.h"
+#include "uiutils.h"
#include
#include
+#include
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;