author | zautrix <zautrix> | 2005-02-04 23:11:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-04 23:11:42 (UTC) |
commit | 3a822a4c4867acb28dc1b3b9557918d0971f732c (patch) (unidiff) | |
tree | 31e5c2627cf739feb944bda079935fa9b2b9df6b | |
parent | c6dceabcb41f6300ca97e69872fc801451944a32 (diff) | |
download | kdepimpi-3a822a4c4867acb28dc1b3b9557918d0971f732c.zip kdepimpi-3a822a4c4867acb28dc1b3b9557918d0971f732c.tar.gz kdepimpi-3a822a4c4867acb28dc1b3b9557918d0971f732c.tar.bz2 |
nochn fixxx
-rw-r--r-- | korganizer/komonthview.cpp | 2 |
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 | |||
@@ -190,129 +190,129 @@ void KNoScrollListBox::mousePressEvent(QMouseEvent *e) | |||
190 | MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) | 190 | MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) |
191 | : QListBoxItem() | 191 | : QListBoxItem() |
192 | { | 192 | { |
193 | setText( s ); | 193 | setText( s ); |
194 | 194 | ||
195 | mIncidence = incidence; | 195 | mIncidence = incidence; |
196 | mDate = qd; | 196 | mDate = qd; |
197 | // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); | 197 | // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); |
198 | mRecur = false; | 198 | mRecur = false; |
199 | mAlarm = false; | 199 | mAlarm = false; |
200 | mReply = false; | 200 | mReply = false; |
201 | mInfo = false; | 201 | mInfo = false; |
202 | } | 202 | } |
203 | 203 | ||
204 | void MonthViewItem::paint(QPainter *p) | 204 | void MonthViewItem::paint(QPainter *p) |
205 | { | 205 | { |
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 | ||
259 | int MonthViewItem::height(const QListBox *lb) const | 259 | int MonthViewItem::height(const QListBox *lb) const |
260 | { | 260 | { |
261 | return lb->fontMetrics().lineSpacing()+1; | 261 | return lb->fontMetrics().lineSpacing()+1; |
262 | } | 262 | } |
263 | 263 | ||
264 | int MonthViewItem::width(const QListBox *lb) const | 264 | int 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 | ||
287 | MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | 287 | MonthViewCell::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 ); |
303 | mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain ); | 303 | mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain ); |
304 | mItemList->setLineWidth( 1 ); | 304 | mItemList->setLineWidth( 1 ); |
305 | topLayout->addWidget( mItemList ); | 305 | topLayout->addWidget( mItemList ); |
306 | mLabel->raise(); | 306 | mLabel->raise(); |
307 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) | 307 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) |
308 | mStandardPalette = palette(); | 308 | mStandardPalette = palette(); |
309 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); | 309 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); |
310 | 310 | ||
311 | enableScrollBars( false ); | 311 | enableScrollBars( false ); |
312 | updateConfig(); | 312 | updateConfig(); |
313 | //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); | 313 | //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); |
314 | connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); | 314 | connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); |
315 | connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ), | 315 | connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ), |
316 | SLOT( defaultAction( QListBoxItem * ) ) ); | 316 | SLOT( defaultAction( QListBoxItem * ) ) ); |
317 | connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *, | 317 | connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *, |
318 | const QPoint &) ), | 318 | const QPoint &) ), |