summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-01-26 23:05:26 (UTC)
committer zautrix <zautrix>2005-01-26 23:05:26 (UTC)
commit15351333eff09beadb6e691e9f0aab2aaf0a95a0 (patch) (side-by-side diff)
tree443fba1e36ef3a2549b531fe600567d9e1232d7c /korganizer/koagendaview.cpp
parent96fc3903cf690957d0242d7aa2894bd64800edcc (diff)
downloadkdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.zip
kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.tar.gz
kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.tar.bz2
fixes
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 6428757..b5596d9 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -201,7 +201,42 @@ 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*)
@@ -410,6 +445,8 @@ 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);