-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 37 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 7 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 7 |
4 files changed, 51 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 06454c2..1d5a57e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2515,5 +2515,5 @@ void CalendarView::showEventEditor() mEventEditor = mDialogManager->getEventEditor(); + topLevelWidget()->setCaption( i18n("") ); } mEventEditor->showMaximized(); - topLevelWidget()->setCaption( i18n("") ); #endif @@ -2530,5 +2530,5 @@ void CalendarView::showTodoEditor() mTodoEditor = mDialogManager->getTodoEditor(); + topLevelWidget()->setCaption( i18n("") ); } mTodoEditor->showMaximized(); - topLevelWidget()->setCaption( i18n("") ); #endif diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 6428757..b5596d9 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -204,2 +204,37 @@ void TimeLabels::setAgenda(KOAgenda* agenda) +void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) +{ + mMouseDownY = e->pos().y(); +} + +void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) +{ + int diff = mMouseDownY - e->pos().y(); + if ( diff < 10 && diff > -10 ) + return; + int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; + if ( tSize < 4 ) + tSize = 4; + if ( tSize > 18 ) + tSize = 18; + tSize = (tSize-2)/2; + topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); + +} +void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) +{ + int diff = mMouseDownY - e->pos().y(); + if ( diff < 10 && diff > -10 ) + return; + int tSize = KOPrefs::instance()->mHourSize + (diff/10); + if ( tSize < 4 ) + tSize = 4; + if ( tSize > 18 ) + tSize = 18; + tSize = (tSize/2)*2; + if ( tSize == KOPrefs::instance()->mHourSize ) + return; + KOPrefs::instance()->mHourSize = tSize; + emit scaleChanged(); +} @@ -412,2 +447,4 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : agendaLayout->addWidget(mTimeLabels,1,0); + connect(mTimeLabels,SIGNAL( scaleChanged()), + this,SLOT(updateConfig())); diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 0079253..221b0ea 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -65,2 +65,5 @@ class TimeLabels : public QScrollView { virtual void paintEvent(QPaintEvent* e); + void contentsMousePressEvent ( QMouseEvent * ) ; + void contentsMouseReleaseEvent ( QMouseEvent * ); + void contentsMouseMoveEvent ( QMouseEvent * ); @@ -69,3 +72,4 @@ class TimeLabels : public QScrollView { void positionChanged(); - + signals: + void scaleChanged(); protected: @@ -74,2 +78,3 @@ class TimeLabels : public QScrollView { private: + int mMouseDownY; int mRows; diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index c99c0cb..41a4dc1 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -295,2 +295,5 @@ KOEventEditor *KODialogManager::getEventEditor() +#ifndef DESKTOP_VERSION + eventEditor->resize( QApplication::desktop()->width() -20, 100 ); +#endif return eventEditor; @@ -322,3 +325,5 @@ KOTodoEditor *KODialogManager::getTodoEditor() //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); - +#ifndef DESKTOP_VERSION + todoEditor->resize( QApplication::desktop()->width() -20, 100 ); +#endif return todoEditor; |