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) (side-by-side diff)
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) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp55
1 files changed, 39 insertions, 16 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)
{
-
+ //qDebug("KNoScrollListBox::keyPressEvent ");
switch(e->key()) {
@@ -156,2 +156,13 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
e->ignore();
+ break;
+ case Key_Return:
+ case Key_Enter:
+ {
+ if ( currentItem() >= 0 ) {
+ emit doubleClicked( item( currentItem() ) );
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ }
break;
@@ -315,4 +326,4 @@ void MonthViewItem::paint(QPainter *p)
int val = td->percentComplete()/20;
- p->fillRect ( x+1, y-1, val ,size+2,Qt::black );
- p->drawRect ( x, y-1,7,size+2);
+ p->fillRect ( x+1, y-2, val ,size+4,Qt::black );
+ p->drawRect ( x, y-2,7,size+4);
x += size + 3;
@@ -1054,2 +1065,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
mWeekLabels[mNumWeeks]->setText( i18n("W"));
+ mWeekLabels[0]->setFocusPolicy(WheelFocus);
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)
mWeekLabelsW[1]->setText( i18n("W"));
+ mWeekLabelsW[0]->setFocusPolicy(WheelFocus);
@@ -1468,5 +1481,3 @@ void KOMonthView::updateView()
}
- (*cells)[0]->setFocus();
-
-
+ setKeyBFocus();
#else
@@ -1488,2 +1499,22 @@ void KOMonthView::updateView()
+void KOMonthView::setKeyBoardFocus()
+{
+ bool shootAgain = false;
+ if ( mShowWeekView ) {
+ shootAgain = !mWeekLabelsW[0]->hasFocus();
+ mWeekLabelsW[0]->setFocus();
+ }
+ else {
+ shootAgain = !mWeekLabels[0]->hasFocus();
+ mWeekLabels[0]->setFocus();
+ }
+ if ( shootAgain ) {
+ QTimer::singleShot( 0, this, SLOT ( setKeyBFocus() ) );
+ }
+}
+void KOMonthView::setKeyBFocus()
+{
+ //qDebug("KOMonthView::setKeyBFocus() ");
+ QTimer::singleShot( 0, this, SLOT ( setKeyBoardFocus() ) );
+}
void KOMonthView::resizeEvent(QResizeEvent * e)
@@ -1503,8 +1534,4 @@ void KOMonthView::slotComputeLayout()
computeLayout();
- clPending = true;
- if ( mShowWeekView )
- mCellsW[0]->setFocus();
- else
- mCells[0]->setFocus();
-
+ clPending = true;
+ setKeyBFocus();
}
@@ -1819,3 +1846,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
if ( mShowWeekView ) {
- mCellsW[0]->setFocus();
emit selectWeekNum ( currentWeek() - 1 );
@@ -1823,3 +1849,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
else {
- mCells[0]->setFocus();
emit prevMonth();
@@ -1832,3 +1857,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
if ( mShowWeekView ) {
- mCellsW[0]->setFocus();
emit selectWeekNum ( currentWeek() +1);
@@ -1836,3 +1860,2 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
else {
- mCells[0]->setFocus();
emit nextMonth();