projects
/
movie-schedule
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed searchclients to handle new Google URLs correctly; added GUI
[movie-schedule]
/
src
/
ui
/
backgroundlabel.cpp
diff --git
a/src/ui/backgroundlabel.cpp
b/src/ui/backgroundlabel.cpp
index
b9c622b
..
2ae0e2c
100644
(file)
--- a/
src/ui/backgroundlabel.cpp
+++ b/
src/ui/backgroundlabel.cpp
@@
-16,9
+16,11
@@
// along with MovieSchedule. If not, see <http://www.gnu.org/licenses/>.
#include "backgroundlabel.h"
// along with MovieSchedule. If not, see <http://www.gnu.org/licenses/>.
#include "backgroundlabel.h"
+#include "uiutils.h"
#include <QPainter>
#include <QFont>
#include <QPainter>
#include <QFont>
+#include <iostream>
static const int MINIMUM_FONT_SIZE = 40;
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) {
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_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;
_cached_label_alignment = Qt::AlignHCenter | Qt::AlignTop;
int font_size = 80;