From: Philipp Spitzer Date: Mon, 12 Dec 2011 22:04:03 +0000 (+0000) Subject: Better calculation of the day navigator date position. X-Git-Tag: 0.5.5~35 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/4383ab5d686280b6bf9a1128a9568035da355733 Better calculation of the day navigator date position. --- diff --git a/src/gui/daynavigatorwidget.cpp b/src/gui/daynavigatorwidget.cpp index c48f354..f47d630 100644 --- a/src/gui/daynavigatorwidget.cpp +++ b/src/gui/daynavigatorwidget.cpp @@ -105,8 +105,7 @@ void DayNavigatorWidget::nextDayButtonClicked() { } -void DayNavigatorWidget::paintEvent(QPaintEvent *aEvent) -{ +void DayNavigatorWidget::paintEvent(QPaintEvent *aEvent) { Q_UNUSED(aEvent); QString selectedDateStr = mCurDate.isValid() ? mCurDate.toString("dddd\nyyyy-MM-dd") : tr("No date"); @@ -114,13 +113,7 @@ void DayNavigatorWidget::paintEvent(QPaintEvent *aEvent) painter.save(); // rectangle only for the text - int marginSize = 9; - int buttonSize = 32; -#ifdef MAEMO - QRect q(y()-height()+1*marginSize+2.5*buttonSize, x(), height()-2*marginSize-2.5*buttonSize, width()); -#else - QRect q(y()-height()+1*marginSize+2*buttonSize, x(), height()-2*marginSize-3*buttonSize, width()); -#endif + QRect q(-selectedDate->height()-selectedDate->y(), selectedDate->x(), selectedDate->height(), selectedDate->width()); painter.rotate(270); // font size adjustion, static on maemo, dynamically otherwise