author | zautrix <zautrix> | 2005-01-26 23:05:26 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-26 23:05:26 (UTC) |
commit | 15351333eff09beadb6e691e9f0aab2aaf0a95a0 (patch) (side-by-side diff) | |
tree | 443fba1e36ef3a2549b531fe600567d9e1232d7c /korganizer | |
parent | 96fc3903cf690957d0242d7aa2894bd64800edcc (diff) | |
download | kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.zip kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.tar.gz kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.tar.bz2 |
fixes
-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 @@ -2512,11 +2512,11 @@ void CalendarView::showEventEditor() topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); delete mEventEditor; mEventEditor = mDialogManager->getEventEditor(); + topLevelWidget()->setCaption( i18n("") ); } mEventEditor->showMaximized(); - topLevelWidget()->setCaption( i18n("") ); #endif } void CalendarView::showTodoEditor() { @@ -2527,11 +2527,11 @@ void CalendarView::showTodoEditor() topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); delete mTodoEditor; mTodoEditor = mDialogManager->getTodoEditor(); + topLevelWidget()->setCaption( i18n("") ); } mTodoEditor->showMaximized(); - topLevelWidget()->setCaption( i18n("") ); #endif } void CalendarView::cloneIncidence() diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 6428757..b5596d9 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -200,9 +200,44 @@ void TimeLabels::positionChanged() void TimeLabels::setAgenda(KOAgenda* agenda) { mAgenda = 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(); +} /** This is called in response to repaint() */ void TimeLabels::paintEvent(QPaintEvent*) { @@ -409,8 +444,10 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : // Create time labels mTimeLabels = new TimeLabels(24,agendaFrame); agendaLayout->addWidget(mTimeLabels,1,0); + connect(mTimeLabels,SIGNAL( scaleChanged()), + this,SLOT(updateConfig())); // Create agenda mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 0079253..221b0ea 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -62,17 +62,22 @@ class TimeLabels : public QScrollView { void setAgenda(KOAgenda* agenda); /** */ virtual void paintEvent(QPaintEvent* e); + void contentsMousePressEvent ( QMouseEvent * ) ; + void contentsMouseReleaseEvent ( QMouseEvent * ); + void contentsMouseMoveEvent ( QMouseEvent * ); public slots: /** update time label positions */ void positionChanged(); - + signals: + void scaleChanged(); protected: void drawContents(QPainter *p,int cx, int cy, int cw, int ch); private: + int mMouseDownY; int mRows; int mCellHeight; /** */ diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index c99c0cb..41a4dc1 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -292,8 +292,11 @@ KOEventEditor *KODialogManager::getEventEditor() mMainView,SLOT(dialogClosing(Incidence*))); //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); +#ifndef DESKTOP_VERSION + eventEditor->resize( QApplication::desktop()->width() -20, 100 ); +#endif return eventEditor; } KOTodoEditor *KODialogManager::getTodoEditor() @@ -319,9 +322,11 @@ KOTodoEditor *KODialogManager::getTodoEditor() mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), // mMainView,SLOT(schedule_cancel(Incidence *))); //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); - +#ifndef DESKTOP_VERSION + todoEditor->resize( QApplication::desktop()->width() -20, 100 ); +#endif return todoEditor; } void KODialogManager::updateSearchDialog() |