From a49b694c286167745886996d990f524f9141adbd Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 10 Jul 2005 12:06:17 +0000 Subject: fixx --- (limited to 'korganizer/mainwindow.cpp') diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 21d5a35..279955f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -423,7 +423,24 @@ MainWindow::~MainWindow() } - +void MainWindow::slotResetFocus() +{ + //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); + mFocusLoop = 3; + QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); +} +void MainWindow::slotResetFocusLoop() +{ + --mFocusLoop; + QWidget* fw = mView->viewManager()->currentView(); + if ( fw ) { + //qDebug("loop "); + fw->setFocus(); + if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) + QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); + } + +} void MainWindow::disableBR(bool b) { #ifndef DESKTOP_VERSION @@ -680,9 +697,11 @@ void MainWindow::initActions() pathString += "iconsmini/"; pixWid = 18; pixHei = 16; } - KMenuBar *menuBar1; + if ( KOPrefs::instance()->mShowFullMenu ) { menuBar1 = new KMenuBar( this );//menuBar(); + //setMenuBar( menuBar1 ); + menuBar1->show(); menuBar1->insertItem( i18n("File"), importMenu ); menuBar1->insertItem( i18n("View"), viewMenu ); menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); @@ -714,8 +733,10 @@ void MainWindow::initActions() menuBar->insertItem( i18n("Help"), helpMenu ); //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); menuBar1->setMaximumSize( menuBar1->sizeHint( )); + connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); } - connect ( menuBar1, SIGNAL( lostFocus () ), mView, SLOT ( slotResetFocus() ) ); + connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); + //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); -- cgit v0.9.0.2