summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp2
-rw-r--r--korganizer/koagendaview.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index b5596d9..05216a7 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -196,42 +196,44 @@ void TimeLabels::positionChanged()
196 setContentsPos(0, adjustment); 196 setContentsPos(0, adjustment);
197} 197}
198 198
199/** */ 199/** */
200void TimeLabels::setAgenda(KOAgenda* agenda) 200void TimeLabels::setAgenda(KOAgenda* agenda)
201{ 201{
202 mAgenda = agenda; 202 mAgenda = agenda;
203} 203}
204 204
205void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) 205void TimeLabels::contentsMousePressEvent ( QMouseEvent * e)
206{ 206{
207 mMouseDownY = e->pos().y(); 207 mMouseDownY = e->pos().y();
208 mOrgCap = topLevelWidget()->caption();
208} 209}
209 210
210void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) 211void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e )
211{ 212{
212 int diff = mMouseDownY - e->pos().y(); 213 int diff = mMouseDownY - e->pos().y();
213 if ( diff < 10 && diff > -10 ) 214 if ( diff < 10 && diff > -10 )
214 return; 215 return;
215 int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; 216 int tSize = KOPrefs::instance()->mHourSize + (diff/10) ;
216 if ( tSize < 4 ) 217 if ( tSize < 4 )
217 tSize = 4; 218 tSize = 4;
218 if ( tSize > 18 ) 219 if ( tSize > 18 )
219 tSize = 18; 220 tSize = 18;
220 tSize = (tSize-2)/2; 221 tSize = (tSize-2)/2;
221 topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); 222 topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize));
222 223
223} 224}
224void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) 225void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e )
225{ 226{
227 topLevelWidget()->setCaption( mOrgCap );
226 int diff = mMouseDownY - e->pos().y(); 228 int diff = mMouseDownY - e->pos().y();
227 if ( diff < 10 && diff > -10 ) 229 if ( diff < 10 && diff > -10 )
228 return; 230 return;
229 int tSize = KOPrefs::instance()->mHourSize + (diff/10); 231 int tSize = KOPrefs::instance()->mHourSize + (diff/10);
230 if ( tSize < 4 ) 232 if ( tSize < 4 )
231 tSize = 4; 233 tSize = 4;
232 if ( tSize > 18 ) 234 if ( tSize > 18 )
233 tSize = 18; 235 tSize = 18;
234 tSize = (tSize/2)*2; 236 tSize = (tSize/2)*2;
235 if ( tSize == KOPrefs::instance()->mHourSize ) 237 if ( tSize == KOPrefs::instance()->mHourSize )
236 return; 238 return;
237 KOPrefs::instance()->mHourSize = tSize; 239 KOPrefs::instance()->mHourSize = tSize;
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 221b0ea..3cf938f 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -68,24 +68,25 @@ class TimeLabels : public QScrollView {
68 void contentsMouseMoveEvent ( QMouseEvent * ); 68 void contentsMouseMoveEvent ( QMouseEvent * );
69 69
70 public slots: 70 public slots:
71 /** update time label positions */ 71 /** update time label positions */
72 void positionChanged(); 72 void positionChanged();
73 signals: 73 signals:
74 void scaleChanged(); 74 void scaleChanged();
75 protected: 75 protected:
76 void drawContents(QPainter *p,int cx, int cy, int cw, int ch); 76 void drawContents(QPainter *p,int cx, int cy, int cw, int ch);
77 77
78 private: 78 private:
79 int mMouseDownY; 79 int mMouseDownY;
80 QString mOrgCap;
80 int mRows; 81 int mRows;
81 int mCellHeight; 82 int mCellHeight;
82 83
83 /** */ 84 /** */
84 KOAgenda* mAgenda; 85 KOAgenda* mAgenda;
85}; 86};
86 87
87class EventIndicator : public QFrame { 88class EventIndicator : public QFrame {
88 Q_OBJECT 89 Q_OBJECT
89 public: 90 public:
90 enum Location { Top, Bottom }; 91 enum Location { Top, Bottom };
91 EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0); 92 EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0);