summaryrefslogtreecommitdiff
authorwaspe <waspe>2003-11-04 16:37:14 (UTC)
committer waspe <waspe>2003-11-04 16:37:14 (UTC)
commitefcd8d6a743261194b55df3afeec956fde9886d4 (patch) (side-by-side diff)
tree7bf7232a92c40c8236813fc06aac18b4f8d16d1d
parentd2c52ff34d0ef37d055f74bb9fd957c6ffc583a9 (diff)
downloadopie-efcd8d6a743261194b55df3afeec956fde9886d4.zip
opie-efcd8d6a743261194b55df3afeec956fde9886d4.tar.gz
opie-efcd8d6a743261194b55df3afeec956fde9886d4.tar.bz2
remove merge conflict
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebookday.cpp26
1 files changed, 13 insertions, 13 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
@@ -12,39 +12,28 @@
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** 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>
DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, const char *name )
: QTable( 24, 1, parent, name ), ampm( whichClock ), currDate( QDate::currentDate() )
{
enableClipper(TRUE);
setTopMargin( 0 );
@@ -67,16 +56,17 @@ DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, const char *
initHeader();
QObject::connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(slotChangeClock(bool)) );
}
void DateBookDayView::initHeader()
{
QString strTmp;
+ int preferredWidth = 0;
for ( int i = 0; i < 24; ++i ) {
if ( ampm ) {
if ( i == 0 )
strTmp = QString::number(12) + ":00";
else if ( i == 12 )
strTmp = QString::number(12) + tr(":00p");
else if ( i > 12 )
strTmp = QString::number( i - 12 ) + tr(":00p");
@@ -85,18 +75,28 @@ void DateBookDayView::initHeader()
} else {
if ( i < 10 )
strTmp = "0" + QString::number(i) + ":00";
else
strTmp = QString::number(i) + ":00";
}
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 )
{
currDate.setYMD(y,m,d);
}
void DateBookDayView::slotChangeClock( bool newClock )
@@ -168,17 +168,17 @@ void DateBookDayView::keyPressEvent( QKeyEvent *e )
void DateBookDayView::setRowStyle( int style )
{
if (style<0) style = 0;
for (int i=0; i<numRows(); i++)
setRowHeight(i, style*10+20);
}
-void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent *e )
+void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent* /* e */ )
{
int sh=99,eh=-1;
for(int i=0;i<this->numSelections();i++) {
QTableSelection sel = this->selection( i );
sh = QMIN(sh,sel.topRow());
eh = QMAX(sh,sel.bottomRow()+1);
}
@@ -214,17 +214,17 @@ void DateBookDayViewQuickLineEdit::slotReturnPressed()
}
/* we need to return to this object.. */
QTimer::singleShot(500, this, SLOT(finallyCallClose()) ); // Close and also delete this widget
}
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.
}
//===========================================================================
DateBookDay::DateBookDay( bool ampm, bool startOnMonday, DateBookDB *newDb, QWidget *parent, const char *name )
: QVBox( parent, name ), currDate( QDate::currentDate() ), db( newDb ), startTime( 0 )