summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index f287216..957ac52 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -119,34 +119,37 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
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 if ( timeHeight > mCellHeight ) 131 timeHeight -= (timeHeight/4-2);
132 timeHeight = mCellHeight-1;
133 int borderWidth = 5; 132 int borderWidth = 5;
134 QFont nFont = p->font(); 133 QFont nFont = p->font();
135 QFont sFont = nFont; 134 QFont sFont = nFont;
136 sFont.setPointSize( sFont.pointSize()/2+2 ); 135 sFont.setPointSize( sFont.pointSize()/2+2 );
137 if (!KGlobal::locale()->use12Clock()) 136 if (!KGlobal::locale()->use12Clock())
138 suffix = "00"; 137 suffix = "00";
139 QFontMetrics fmS( sFont ); 138 QFontMetrics fmS( sFont );
140 int sHei = fmS.height(); 139 int sHei = fmS.height();
140 if ( timeHeight > mCellHeight ) {
141 timeHeight = mCellHeight-1;
142 sHei -= 2;
143 }
141 144
142 while (y < cy + ch) { 145 while (y < cy + ch) {
143 p->drawLine(cx,y,cx+tW,y); 146 p->drawLine(cx,y,cx+tW,y);
144 hour.setNum(cell); 147 hour.setNum(cell);
145 148
146 // handle 24h and am/pm time formats 149 // handle 24h and am/pm time formats
147 if (KGlobal::locale()->use12Clock()) { 150 if (KGlobal::locale()->use12Clock()) {
148 if (cell > 11) suffix = "pm"; 151 if (cell > 11) suffix = "pm";
149 else 152 else
150 suffix = "am"; 153 suffix = "am";
151 if (cell == 0) hour.setNum(12); 154 if (cell == 0) hour.setNum(12);
152 if (cell > 12) hour.setNum(cell - 12); 155 if (cell > 12) hour.setNum(cell - 12);