summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
authorzautrix <zautrix>2005-03-30 19:13:02 (UTC)
committer zautrix <zautrix>2005-03-30 19:13:02 (UTC)
commitb9ec42913b1dc7fc39848f245e55c7b36d7c2fa6 (patch) (unidiff)
tree1ef705404ced1d9616f5334923d8d1db446766c9 /korganizer/komonthview.cpp
parent5e354884787756ceaf663ea48167c5193dad6bf1 (diff)
downloadkdepimpi-b9ec42913b1dc7fc39848f245e55c7b36d7c2fa6.zip
kdepimpi-b9ec42913b1dc7fc39848f245e55c7b36d7c2fa6.tar.gz
kdepimpi-b9ec42913b1dc7fc39848f245e55c7b36d7c2fa6.tar.bz2
more fixes
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp53
1 files changed, 38 insertions, 15 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 940d288..ca35a86 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -103,3 +103,3 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
103{ 103{
104 104 //qDebug("KNoScrollListBox::keyPressEvent ");
105 switch(e->key()) { 105 switch(e->key()) {
@@ -157,2 +157,13 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
157 break; 157 break;
158 case Key_Return:
159 case Key_Enter:
160 {
161 if ( currentItem() >= 0 ) {
162 emit doubleClicked( item( currentItem() ) );
163 e->accept();
164 } else {
165 e->ignore();
166 }
167 }
168 break;
158 case Key_Shift: 169 case Key_Shift:
@@ -315,4 +326,4 @@ void MonthViewItem::paint(QPainter *p)
315 int val = td->percentComplete()/20; 326 int val = td->percentComplete()/20;
316 p->fillRect ( x+1, y-1, val ,size+2,Qt::black ); 327 p->fillRect ( x+1, y-2, val ,size+4,Qt::black );
317 p->drawRect ( x, y-1,7,size+2); 328 p->drawRect ( x, y-2,7,size+4);
318 x += size + 3; 329 x += size + 3;
@@ -1054,2 +1065,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1054 mWeekLabels[mNumWeeks]->setText( i18n("W")); 1065 mWeekLabels[mNumWeeks]->setText( i18n("W"));
1066 mWeekLabels[0]->setFocusPolicy(WheelFocus);
1055 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); 1067 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
@@ -1069,2 +1081,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1069 mWeekLabelsW[1]->setText( i18n("W")); 1081 mWeekLabelsW[1]->setText( i18n("W"));
1082 mWeekLabelsW[0]->setFocusPolicy(WheelFocus);
1070 1083
@@ -1468,5 +1481,3 @@ void KOMonthView::updateView()
1468 } 1481 }
1469 (*cells)[0]->setFocus(); 1482 setKeyBFocus();
1470
1471
1472#else 1483#else
@@ -1488,2 +1499,22 @@ void KOMonthView::updateView()
1488 1499
1500void KOMonthView::setKeyBoardFocus()
1501{
1502 bool shootAgain = false;
1503 if ( mShowWeekView ) {
1504 shootAgain = !mWeekLabelsW[0]->hasFocus();
1505 mWeekLabelsW[0]->setFocus();
1506 }
1507 else {
1508 shootAgain = !mWeekLabels[0]->hasFocus();
1509 mWeekLabels[0]->setFocus();
1510 }
1511 if ( shootAgain ) {
1512 QTimer::singleShot( 0, this, SLOT ( setKeyBFocus() ) );
1513 }
1514}
1515void KOMonthView::setKeyBFocus()
1516{
1517 //qDebug("KOMonthView::setKeyBFocus() ");
1518 QTimer::singleShot( 0, this, SLOT ( setKeyBoardFocus() ) );
1519}
1489void KOMonthView::resizeEvent(QResizeEvent * e) 1520void KOMonthView::resizeEvent(QResizeEvent * e)
@@ -1504,7 +1535,3 @@ void KOMonthView::slotComputeLayout()
1504 clPending = true; 1535 clPending = true;
1505 if ( mShowWeekView ) 1536 setKeyBFocus();
1506 mCellsW[0]->setFocus();
1507 else
1508 mCells[0]->setFocus();
1509
1510} 1537}
@@ -1819,3 +1846,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
1819 if ( mShowWeekView ) { 1846 if ( mShowWeekView ) {
1820 mCellsW[0]->setFocus();
1821 emit selectWeekNum ( currentWeek() - 1 ); 1847 emit selectWeekNum ( currentWeek() - 1 );
@@ -1823,3 +1849,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
1823 else { 1849 else {
1824 mCells[0]->setFocus();
1825 emit prevMonth(); 1850 emit prevMonth();
@@ -1832,3 +1857,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
1832 if ( mShowWeekView ) { 1857 if ( mShowWeekView ) {
1833 mCellsW[0]->setFocus();
1834 emit selectWeekNum ( currentWeek() +1); 1858 emit selectWeekNum ( currentWeek() +1);
@@ -1836,3 +1860,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
1836 else { 1860 else {
1837 mCells[0]->setFocus();
1838 emit nextMonth(); 1861 emit nextMonth();