summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookday.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp
index f4008e9..4d64099 100644
--- a/core/pim/datebook/datebookday.cpp
+++ b/core/pim/datebook/datebookday.cpp
@@ -19,3 +19,2 @@
**********************************************************************/
-#include <qmessagebox.h>
@@ -25,19 +24,9 @@
-#include <qpe/datebookdb.h>
#include <qpe/resource.h>
-#include <qpe/event.h>
#include <qpe/qpeapplication.h>
-#include <qpe/timestring.h>
-#include <qpe/qpedebug.h>
#include <qpe/ir.h>
-#include <qheader.h>
-#include <qdatetime.h>
-#include <qpainter.h>
#include <qsimplerichtext.h>
#include <qpopupmenu.h>
-#include <qtextcodec.h>
-#include <qpalette.h>
-#include <qlineedit.h>
@@ -55,3 +44,3 @@ DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, const char *
verticalHeader()->setPalette(white);
- verticalHeader()->setResizeEnabled(FALSE);
+ verticalHeader()->setResizeEnabled(FALSE);
setSelectionMode( Single );
@@ -74,2 +63,3 @@ void DateBookDayView::initHeader()
QString strTmp;
+ int preferredWidth = 0;
for ( int i = 0; i < 24; ++i ) {
@@ -92,4 +82,14 @@ void DateBookDayView::initHeader()
verticalHeader()->setLabel( i, strTmp );
+
+ // Compute correct width for current Font (Add some space right)
+ int actWidth = QFontMetrics( QFont::defaultFont() ).width( strTmp + QString(" ") );
+ if ( preferredWidth < actWidth )
+ preferredWidth = actWidth;
setRowStretchable( i, FALSE );
}
+
+ // It seems as if the header has a bug. It does not resize
+ // correct horizontally if it is used vertical..
+ // Thus, we do it manually..
+ setLeftMargin( preferredWidth );
}
@@ -175,3 +175,3 @@ void DateBookDayView::setRowStyle( int style )
-void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent *e )
+void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent* /* e */ )
{
@@ -221,3 +221,3 @@ void DateBookDayViewQuickLineEdit::finallyCallClose() {
-void DateBookDayViewQuickLineEdit::focusOutEvent ( QFocusEvent * e )
+void DateBookDayViewQuickLineEdit::focusOutEvent ( QFocusEvent* /* e */)
{