summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ae03a09..09a0880 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -145,84 +145,95 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
setCaption("KO/Pi");
KOPrefs *p = KOPrefs::instance();
KPimGlobalPrefs::instance()->setGlobalConfig();
if ( p->mHourSize > 22 )
p->mHourSize = 22;
QMainWindow::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUp )
tbd = Right;
else
tbd = Left;
}
if ( KOPrefs::instance()->mUseAppColors )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
globalFlagBlockStartup = 1;
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;
else
tbd = Top;
}
else {
if ( p->mToolBarUpF )
tbd = Right;
else
tbd = Left;
}
filterToolBar = new QPEToolBar ( this );
filterMenubar = new QPEMenuBar( filterToolBar );
QFontMetrics fm ( filterMenubar->font() );
filterPopupMenu = new QPopupMenu( this );
filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
QString addTest = "Ax";
#ifdef DESKTOP_VERSION
addTest = "AAAx";
#endif
filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) );
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;
filterPopupMenu = 0;
}
if ( p->mShowIconOnetoolbar ) {
viewToolBar = iconToolBar ;
navigatorToolBar = iconToolBar ;
} else {
+#ifndef DESKTOP_VERSION
+ setToolBarsMovable( false );
+#endif
if ( p->mToolBarHorV ) {
if ( p->mToolBarUpV )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUpV )
tbd = Right;
else
tbd = Left;
}
viewToolBar = new QPEToolBar( this );
addToolBar (viewToolBar , tbd );
if ( p->mToolBarHorN ) {
if ( p->mToolBarUpN )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUpN )
tbd = Right;
else
@@ -2389,24 +2400,37 @@ void MainWindow::weekAction()
y = 0;
}
}
//qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
{
month = picker->getResult();
emit selectWeek ( month );
//qDebug("weekSelected %d ", month);
}
delete popup;
}
void MainWindow::hideEvent ( QHideEvent * )
{
QString message;
QDateTime nextA = mCalendar->nextAlarmEventDateTime();
if ( nextA.isValid() ) {
QString sum = mCalendar->nextSummary();
message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
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);
+}