summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-27 10:47:39 (UTC)
committer zautrix <zautrix>2005-03-27 10:47:39 (UTC)
commit1800cf5f3af1f666dddcbfffe3171adcd467ae3d (patch) (unidiff)
tree64b69e4bfbeacf5a036f027dd099c82c6c77e299 /korganizer
parentb170a7414ff72016285ea207caa7ccf786530e77 (diff)
downloadkdepimpi-1800cf5f3af1f666dddcbfffe3171adcd467ae3d.zip
kdepimpi-1800cf5f3af1f666dddcbfffe3171adcd467ae3d.tar.gz
kdepimpi-1800cf5f3af1f666dddcbfffe3171adcd467ae3d.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index fa6b951..18f242c 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -123,31 +123,43 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
123 int cell = ((int)(cy/mCellHeight)); 123 int cell = ((int)(cy/mCellHeight));
124 int y = cell * mCellHeight; 124 int y = cell * mCellHeight;
125 QFontMetrics fm = fontMetrics(); 125 QFontMetrics fm = fontMetrics();
126 QString hour; 126 QString hour;
127 QString suffix; 127 QString suffix;
128 QString fullTime; 128 QString fullTime;
129 int tW = fm.width("24:00i"); 129 int tW = fm.width("24:00i");
130 int timeHeight = fm.height(); 130 int timeHeight = fm.height();
131 timeHeight -= (timeHeight/4-2); 131 //timeHeight -= (timeHeight/4-2);
132 int borderWidth = 0; 132 int borderWidth = 0;
133 QFont nFont = p->font(); 133 QFont nFont = p->font();
134 QFont sFont = nFont; 134
135 sFont.setPointSize( sFont.pointSize()/2+2 );
136 if (!KGlobal::locale()->use12Clock()) 135 if (!KGlobal::locale()->use12Clock())
137 suffix = "00"; 136 suffix = "00";
138 else 137 else
139 borderWidth = 0; 138 borderWidth = 0;
140 QFontMetrics fmS( sFont );
141 int sHei = fmS.height();
142 if ( timeHeight > mCellHeight ) { 139 if ( timeHeight > mCellHeight ) {
143 timeHeight = mCellHeight-1; 140 timeHeight = mCellHeight-1;
144 sHei -= 2; 141 int pointS = nFont.pointSize();
142 while ( pointS > 4 ) {
143 nFont.setPointSize( pointS );
144 fm = QFontMetrics( nFont );
145 if ( fm.height() < mCellHeight )
146 break;
147 -- pointS;
148 }
149 fm = QFontMetrics( nFont );
150 borderWidth = 4;
151 timeHeight = fm.height();
145 } 152 }
153 timeHeight -= (timeHeight/4-2);
154 QFont sFont = nFont;
155 sFont.setPointSize( sFont.pointSize()/2+2 );
156 QFontMetrics fmS( sFont );
157 int sHei = fmS.height();
146 158
147 while (y < cy + ch) { 159 while (y < cy + ch) {
148 p->drawLine(cx,y,cx+tW,y); 160 p->drawLine(cx,y,cx+tW,y);
149 hour.setNum(cell); 161 hour.setNum(cell);
150 162
151 // handle 24h and am/pm time formats 163 // handle 24h and am/pm time formats
152 if (KGlobal::locale()->use12Clock()) { 164 if (KGlobal::locale()->use12Clock()) {
153 if (cell > 11) suffix = "pm"; 165 if (cell > 11) suffix = "pm";
@@ -884,16 +896,22 @@ void KOAgendaView::updateView()
884/* 896/*
885 Update configuration settings for the agenda view. This method is not 897 Update configuration settings for the agenda view. This method is not
886 complete. 898 complete.
887*/ 899*/
888void KOAgendaView::updateConfig() 900void KOAgendaView::updateConfig()
889{ 901{
890 if ( mBlockUpdating ) 902 if ( mBlockUpdating )
891 return; 903 return;
904 if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) {
905 int old = KOPrefs::instance()->mHourSize;
906 KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1;
907 qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize );
908 }
909
892 910
893 // update config for children 911 // update config for children
894 mTimeLabels->updateConfig(); 912 mTimeLabels->updateConfig();
895 mAgenda->storePosition(); 913 mAgenda->storePosition();
896 mAgenda->updateConfig(); 914 mAgenda->updateConfig();
897 mAllDayAgenda->updateConfig(); 915 mAllDayAgenda->updateConfig();
898 // widget synchronization 916 // widget synchronization
899 //TODO: find a better way, maybe signal/slot 917 //TODO: find a better way, maybe signal/slot