Mercurial > hg > easyhg
comparison src/changesetitem.cpp @ 393:0c826f07929f item_appearance_adjustments
Show whole of "new" item in yellow, not just border -- and omit yellow border except for current item
author | Chris Cannam |
---|---|
date | Tue, 24 May 2011 17:46:59 +0100 |
parents | cf18694f64a3 |
children | 27757ce9c76c |
comparison
equal
deleted
inserted
replaced
392:cf18694f64a3 | 393:0c826f07929f |
---|---|
322 int height = (lineCount + 1) * fh + 2; | 322 int height = (lineCount + 1) * fh + 2; |
323 QRectF r(x0, 0, width - 3, height); | 323 QRectF r(x0, 0, width - 3, height); |
324 | 324 |
325 if (showProperLines) { | 325 if (showProperLines) { |
326 | 326 |
327 paint->setBrush(Qt::white); | 327 if (m_new) { |
328 paint->setBrush(QColor(255, 255, 156)); | |
329 } else { | |
330 paint->setBrush(Qt::white); | |
331 } | |
328 | 332 |
329 if (m_current) { | 333 if (m_current) { |
330 paint->drawRoundedRect(QRectF(x0 - 4, -4, width + 5, height + 8), | 334 paint->drawRoundedRect(QRectF(x0 - 4, -4, width + 5, height + 8), |
331 10, 10); | 335 10, 10); |
332 } | 336 if (m_new) { |
333 | 337 paint->save(); |
334 if (m_new) { | 338 paint->setPen(Qt::yellow); |
335 paint->save(); | 339 paint->setBrush(Qt::NoBrush); |
336 paint->setPen(Qt::yellow); | 340 paint->drawRoundedRect(QRectF(x0 - 2, -2, width + 1, height + 4), |
337 paint->setBrush(Qt::NoBrush); | 341 10, 10); |
338 paint->drawRoundedRect(QRectF(x0 - 2, -2, width + 1, height + 4), | 342 paint->restore(); |
339 10, 10); | 343 } |
340 paint->restore(); | |
341 } | 344 } |
342 } | 345 } |
343 | 346 |
344 if (!showText) { | 347 if (!showText) { |
345 paint->drawRoundedRect(r, 7, 7); | 348 paint->drawRoundedRect(r, 7, 7); |
453 QFontMetrics fm(f); | 456 QFontMetrics fm(f); |
454 int fh = fm.height(); | 457 int fh = fm.height(); |
455 int size = fh * 2; | 458 int size = fh * 2; |
456 int x0 = -size/2 + 25; | 459 int x0 = -size/2 + 25; |
457 | 460 |
458 paint->setBrush(Qt::white); | 461 if (m_new) { |
462 paint->setBrush(QColor(255, 255, 156)); | |
463 } else { | |
464 paint->setBrush(Qt::white); | |
465 } | |
459 | 466 |
460 if (showProperLines) { | 467 if (showProperLines) { |
461 | 468 |
462 if (m_current) { | 469 if (m_current) { |
463 paint->drawEllipse(QRectF(x0 - 4, fh - 4, size + 8, size + 8)); | 470 paint->drawEllipse(QRectF(x0 - 4, fh - 4, size + 8, size + 8)); |
464 } | 471 |
465 | 472 if (m_new) { |
466 if (m_new) { | 473 paint->save(); |
467 paint->save(); | 474 paint->setPen(Qt::yellow); |
468 paint->setPen(Qt::yellow); | 475 paint->setBrush(Qt::NoBrush); |
469 paint->setBrush(Qt::NoBrush); | 476 paint->drawEllipse(QRectF(x0 - 2, fh - 2, size + 4, size + 4)); |
470 paint->drawEllipse(QRectF(x0 - 2, fh - 2, size + 4, size + 4)); | 477 paint->restore(); |
471 paint->restore(); | 478 } |
472 } | 479 } |
473 } | 480 } |
474 | 481 |
475 paint->drawEllipse(QRectF(x0, fh, size, size)); | 482 paint->drawEllipse(QRectF(x0, fh, size, size)); |
476 | 483 |