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
@@ -17,29 +17,18 @@
** not clear to you.
**
**********************************************************************/
-#include <qmessagebox.h>
#include "datebookday.h"
#include "datebookdayheaderimpl.h"
#include "datebookdayallday.h"
-#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>
#include <qtimer.h>
@@ -53,7 +42,7 @@ DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, const char *
setColumnStretchable( 0, TRUE );
setHScrollBarMode( QScrollView::AlwaysOff );
verticalHeader()->setPalette(white);
- verticalHeader()->setResizeEnabled(FALSE);
+ verticalHeader()->setResizeEnabled(FALSE);
setSelectionMode( Single );
// get rid of being able to edit things...
@@ -72,6 +61,7 @@ DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, const char *
void DateBookDayView::initHeader()
{
QString strTmp;
+ int preferredWidth = 0;
for ( int i = 0; i < 24; ++i ) {
if ( ampm ) {
if ( i == 0 )
@@ -90,8 +80,18 @@ void DateBookDayView::initHeader()
}
strTmp = strTmp.rightJustify( 6, ' ' );
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 );
}
void DateBookDayView::slotDateChanged( int y, int m, int d )
@@ -173,7 +173,7 @@ void DateBookDayView::setRowStyle( int style )
setRowHeight(i, style*10+20);
}
-void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent *e )
+void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent* /* e */ )
{
int sh=99,eh=-1;
@@ -219,7 +219,7 @@ void DateBookDayViewQuickLineEdit::finallyCallClose() {
close(true); // also deletes this widget...
}
-void DateBookDayViewQuickLineEdit::focusOutEvent ( QFocusEvent * e )
+void DateBookDayViewQuickLineEdit::focusOutEvent ( QFocusEvent* /* e */)
{
slotReturnPressed(); // Reuse code to add event and close this widget.
}