From 529c0fb8a8bf15e7bd375ddeb355c5802baf4c93 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 30 Mar 2005 23:17:42 +0000 Subject: key fix --- (limited to 'korganizer') diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index ca35a86..b9ce4f4 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -1000,6 +1000,7 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) { + mFlagKeyPressed = false; mShortDayLabelsM = false; mShortDayLabelsW = false; skipResize = false; @@ -1837,9 +1838,25 @@ void KOMonthView::clearSelection() mSelectedCell = 0; } } + +void KOMonthView::keyReleaseEvent ( QKeyEvent * e) +{ + if ( !e->isAutoRepeat() ) { + mFlagKeyPressed = false; + } +} + void KOMonthView::keyPressEvent ( QKeyEvent * e ) { - //qDebug("KOMonthView::keyPressEvent "); + + qApp->processEvents(); + if ( e->isAutoRepeat() && !mFlagKeyPressed ) { + //e->ignore(); + e->accept(); + return; + } + if (! e->isAutoRepeat() ) + mFlagKeyPressed = true; switch(e->key()) { case Key_Up: { diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index c1ca3d4..88050fe 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -311,9 +311,10 @@ class KOMonthView: public KOEventView QDate mStartDate; MonthViewCell *mSelectedCell; - + bool mFlagKeyPressed; KOEventPopupMenu *mContextMenu; void keyPressEvent ( QKeyEvent * ) ; + void keyReleaseEvent ( QKeyEvent * ) ; }; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ae03a09..09a0880 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -166,7 +166,13 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : iconToolBar = new QPEToolBar( this ); addToolBar (iconToolBar , tbd ); - if ( KOPrefs::instance()->mShowIconFilter ) { +#ifdef DESKTOP_VERSION + if ( KOPrefs::instance()->mShowIconFilter ) +#else + if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) +#endif + +{ if ( p->mToolBarHorF ) { if ( p->mToolBarUpF ) tbd = Bottom; @@ -193,6 +199,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : addToolBar (filterToolBar , tbd ); connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); + if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) + filterToolBar->hide(); } else { filterToolBar = 0; filterMenubar = 0; @@ -202,6 +210,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : viewToolBar = iconToolBar ; navigatorToolBar = iconToolBar ; } else { +#ifndef DESKTOP_VERSION + setToolBarsMovable( false ); +#endif if ( p->mToolBarHorV ) { if ( p->mToolBarUpV ) tbd = Bottom; @@ -2410,3 +2421,16 @@ void MainWindow::hideEvent ( QHideEvent * ) setCaption( message ); } } + +void MainWindow::resizeEvent( QResizeEvent* e) +{ +#ifndef DESKTOP_VERSION + if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar ) { + if (QApplication::desktop()->width() > QApplication::desktop()->height() ) + filterToolBar->hide(); + else + filterToolBar->show(); + } +#endif + QMainWindow::resizeEvent( e); +} diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7c16aeb..4d1753f 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -133,6 +133,7 @@ class MainWindow : public QMainWindow QPopupMenu * filterPopupMenu; void initActions(); void setDefaultPreferences(); + void resizeEvent( QResizeEvent* e); void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; QPopupMenu *configureToolBarMenu; -- cgit v0.9.0.2