// 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;
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;