summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-04 23:11:42 (UTC)
committer zautrix <zautrix>2005-02-04 23:11:42 (UTC)
commit3a822a4c4867acb28dc1b3b9557918d0971f732c (patch) (unidiff)
tree31e5c2627cf739feb944bda079935fa9b2b9df6b
parentc6dceabcb41f6300ca97e69872fc801451944a32 (diff)
downloadkdepimpi-3a822a4c4867acb28dc1b3b9557918d0971f732c.zip
kdepimpi-3a822a4c4867acb28dc1b3b9557918d0971f732c.tar.gz
kdepimpi-3a822a4c4867acb28dc1b3b9557918d0971f732c.tar.bz2
nochn fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index df5e060..31c5659 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -206,97 +206,97 @@ void MonthViewItem::paint(QPainter *p)
206#if QT_VERSION >= 0x030000 206#if QT_VERSION >= 0x030000
207 bool sel = isSelected(); 207 bool sel = isSelected();
208#else 208#else
209 bool sel = selected(); 209 bool sel = selected();
210#endif 210#endif
211 211
212 212
213 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) 213 if (KOPrefs::instance()->mMonthViewUsesCategoryColor)
214 { 214 {
215 p->setBackgroundColor( palette().color( QPalette::Normal, \ 215 p->setBackgroundColor( palette().color( QPalette::Normal, \
216 sel ? QColorGroup::Highlight : QColorGroup::Background ) ); 216 sel ? QColorGroup::Highlight : QColorGroup::Background ) );
217 p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); 217 p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) );
218 } 218 }
219 int x = 1; 219 int x = 1;
220 int y = 3;//(height() - mRecurPixmap.height()) /2; 220 int y = 3;//(height() - mRecurPixmap.height()) /2;
221 int size = PIXMAP_SIZE; 221 int size = PIXMAP_SIZE;
222 if ( QApplication::desktop()->width() < 300 ) 222 if ( QApplication::desktop()->width() < 300 )
223 size = 3; 223 size = 3;
224 if ( KOPrefs::instance()->mMonthShowIcons ) { 224 if ( KOPrefs::instance()->mMonthShowIcons ) {
225 if ( mInfo ) { 225 if ( mInfo ) {
226 p->fillRect ( x, y,size,size, Qt::darkGreen ); 226 p->fillRect ( x, y,size,size, Qt::darkGreen );
227 x += size + 1; 227 x += size + 1;
228 } 228 }
229 if ( mRecur ) { 229 if ( mRecur ) {
230 p->fillRect ( x, y,size,size, Qt::blue ); 230 p->fillRect ( x, y,size,size, Qt::blue );
231 x += size + 1; 231 x += size + 1;
232 } 232 }
233 if ( mAlarm ) { 233 if ( mAlarm ) {
234 p->fillRect ( x, y,size,size, Qt::red ); 234 p->fillRect ( x, y,size,size, Qt::red );
235 x += size + 1; 235 x += size + 1;
236 } 236 }
237 if ( mReply ) { 237 if ( mReply ) {
238 p->fillRect ( x, y,size,size, Qt::yellow ); 238 p->fillRect ( x, y,size,size, Qt::yellow );
239 x += size + 1; 239 x += size + 1;
240 } 240 }
241 } 241 }
242 QFontMetrics fm = p->fontMetrics(); 242 QFontMetrics fm = p->fontMetrics();
243 int yPos; 243 int yPos;
244 int pmheight = size; 244 int pmheight = size;
245 if( pmheight < fm.height() ) 245 if( pmheight < fm.height() )
246 yPos = fm.ascent() + fm.leading()/2; 246 yPos = fm.ascent() + fm.leading()/2;
247 else 247 else
248 yPos = pmheight/2 - fm.height()/2 + fm.ascent(); 248 yPos = pmheight/2 - fm.height()/2 + fm.ascent();
249 p->setPen( palette().color( QPalette::Normal, sel ? \ 249 p->setPen( palette().color( QPalette::Normal, sel ? \
250 QColorGroup::HighlightedText : QColorGroup::Foreground ) ); 250 QColorGroup::HighlightedText : QColorGroup::Foreground ) );
251 p->drawText( x, yPos, text() ); 251 p->drawText( x, yPos, text() );
252 if ( mIncidence->cancelled() ) { 252 if ( mIncidence->cancelled() ) {
253 int wid = fm.width( text() ); 253 int wid = fm.width( text() );
254 p->drawLine( x, yPos- fm.height()/2+2,x+wid, yPos- fm.height()/2 +2); 254 p->drawLine( x, yPos- fm.height()/2+3,x+wid, yPos- fm.height()/2 +3);
255 } 255 }
256 256
257} 257}
258 258
259int MonthViewItem::height(const QListBox *lb) const 259int MonthViewItem::height(const QListBox *lb) const
260{ 260{
261 return lb->fontMetrics().lineSpacing()+1; 261 return lb->fontMetrics().lineSpacing()+1;
262} 262}
263 263
264int MonthViewItem::width(const QListBox *lb) const 264int MonthViewItem::width(const QListBox *lb) const
265{ 265{
266 int size = PIXMAP_SIZE; 266 int size = PIXMAP_SIZE;
267 if ( QApplication::desktop()->width() < 300 ) 267 if ( QApplication::desktop()->width() < 300 )
268 size = 3; 268 size = 3;
269 int x = 1; 269 int x = 1;
270 if ( mInfo ) { 270 if ( mInfo ) {
271 x += size + 1; 271 x += size + 1;
272 } 272 }
273 if( mRecur ) { 273 if( mRecur ) {
274 x += size+1; 274 x += size+1;
275 } 275 }
276 if( mAlarm ) { 276 if( mAlarm ) {
277 x += size+1; 277 x += size+1;
278 } 278 }
279 if( mReply ) { 279 if( mReply ) {
280 x += size+1; 280 x += size+1;
281 } 281 }
282 282
283 return( x + lb->fontMetrics().width( text() ) + 1 ); 283 return( x + lb->fontMetrics().width( text() ) + 1 );
284} 284}
285 285
286 286
287MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) 287MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
288 : QWidget( par ), 288 : QWidget( par ),
289 mMonthView( parent ) 289 mMonthView( parent )
290{ 290{
291 291
292 QVBoxLayout *topLayout = new QVBoxLayout( this ); 292 QVBoxLayout *topLayout = new QVBoxLayout( this );
293 293
294 // mLabel = new QLabel( this );QPushButton 294 // mLabel = new QLabel( this );QPushButton
295 mLabel = new QPushButton( this ); 295 mLabel = new QPushButton( this );
296 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); 296 //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain );
297 //mLabel->setLineWidth( 1 ); 297 //mLabel->setLineWidth( 1 );
298 //mLabel->setAlignment( AlignCenter ); 298 //mLabel->setAlignment( AlignCenter );
299 mLabel->setFlat( true ); 299 mLabel->setFlat( true );
300 mLabel->setFocusPolicy(NoFocus); 300 mLabel->setFocusPolicy(NoFocus);
301 mItemList = new KNoScrollListBox( this ); 301 mItemList = new KNoScrollListBox( this );
302 mItemList->setMinimumSize( 10, 10 ); 302 mItemList->setMinimumSize( 10, 10 );