author | zautrix <zautrix> | 2005-03-26 13:13:04 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-26 13:13:04 (UTC) |
commit | 93d1be2c6eead07300e7f90f3b417fcef0f109d3 (patch) (unidiff) | |
tree | cdcac27cfa1e02c6fa388c252287ed9818b95847 /korganizer/koagendaview.cpp | |
parent | bc8929ccca1ad8cd04f61366c78254803d9c1565 (diff) | |
download | kdepimpi-93d1be2c6eead07300e7f90f3b417fcef0f109d3.zip kdepimpi-93d1be2c6eead07300e7f90f3b417fcef0f109d3.tar.gz kdepimpi-93d1be2c6eead07300e7f90f3b417fcef0f109d3.tar.bz2 |
icons added
-rw-r--r-- | korganizer/koagendaview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index b9c7dec..8001c8f 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -114,48 +114,50 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
114 | // redrawn, not the area of the widget. unfortunately, this | 114 | // redrawn, not the area of the widget. unfortunately, this |
115 | // code assumes the latter... | 115 | // code assumes the latter... |
116 | 116 | ||
117 | // now, for a workaround... | 117 | // now, for a workaround... |
118 | // these two assignments fix the weird redraw bug | 118 | // these two assignments fix the weird redraw bug |
119 | cx = contentsX() + 2; | 119 | cx = contentsX() + 2; |
120 | cw = contentsWidth() - 2; | 120 | cw = contentsWidth() - 2; |
121 | // end of workaround | 121 | // end of workaround |
122 | 122 | ||
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 = 2; | 132 | int borderWidth = 2; |
133 | QFont nFont = p->font(); | 133 | QFont nFont = p->font(); |
134 | QFont sFont = nFont; | 134 | QFont sFont = nFont; |
135 | sFont.setPointSize( sFont.pointSize()/2+2 ); | 135 | sFont.setPointSize( sFont.pointSize()/2+2 ); |
136 | if (!KGlobal::locale()->use12Clock()) | 136 | if (!KGlobal::locale()->use12Clock()) |
137 | suffix = "00"; | 137 | suffix = "00"; |
138 | else | ||
139 | borderWidth = 0; | ||
138 | QFontMetrics fmS( sFont ); | 140 | QFontMetrics fmS( sFont ); |
139 | int sHei = fmS.height(); | 141 | int sHei = fmS.height(); |
140 | if ( timeHeight > mCellHeight ) { | 142 | if ( timeHeight > mCellHeight ) { |
141 | timeHeight = mCellHeight-1; | 143 | timeHeight = mCellHeight-1; |
142 | sHei -= 2; | 144 | sHei -= 2; |
143 | } | 145 | } |
144 | 146 | ||
145 | while (y < cy + ch) { | 147 | while (y < cy + ch) { |
146 | p->drawLine(cx,y,cx+tW,y); | 148 | p->drawLine(cx,y,cx+tW,y); |
147 | hour.setNum(cell); | 149 | hour.setNum(cell); |
148 | 150 | ||
149 | // handle 24h and am/pm time formats | 151 | // handle 24h and am/pm time formats |
150 | if (KGlobal::locale()->use12Clock()) { | 152 | if (KGlobal::locale()->use12Clock()) { |
151 | if (cell > 11) suffix = "pm"; | 153 | if (cell > 11) suffix = "pm"; |
152 | else | 154 | else |
153 | suffix = "am"; | 155 | suffix = "am"; |
154 | if (cell == 0) hour.setNum(12); | 156 | if (cell == 0) hour.setNum(12); |
155 | if (cell > 12) hour.setNum(cell - 12); | 157 | if (cell > 12) hour.setNum(cell - 12); |
156 | } | 158 | } |
157 | 159 | ||
158 | // create string in format of "XX:XX" or "XXpm/am" | 160 | // create string in format of "XX:XX" or "XXpm/am" |
159 | fullTime = hour;// + suffix; | 161 | fullTime = hour;// + suffix; |
160 | 162 | ||
161 | // center and draw the time label | 163 | // center and draw the time label |