Mercurial > hg > easyhg
comparison grapher.cpp @ 250:be483734bde5
* Make it possible for changeset items to take two or three lines of description, depending on how much there is
* Some other small improvements to how changeset items are drawn (e.g. give them opaque white backgrounds)
author | Chris Cannam |
---|---|
date | Tue, 11 Jan 2011 17:58:14 +0000 |
parents | 8fd71f570884 |
children | b8ded5213d16 |
comparison
equal
deleted
inserted
replaced
249:123e06d5d9af | 250:be483734bde5 |
---|---|
425 m_changesets[id] = cs; | 425 m_changesets[id] = cs; |
426 | 426 |
427 ChangesetItem *item = new ChangesetItem(cs); | 427 ChangesetItem *item = new ChangesetItem(cs); |
428 item->setX(0); | 428 item->setX(0); |
429 item->setY(0); | 429 item->setY(0); |
430 item->setZValue(0); | |
430 m_items[id] = item; | 431 m_items[id] = item; |
431 m_scene->addChangesetItem(item); | 432 m_scene->addChangesetItem(item); |
432 } | 433 } |
433 | 434 |
434 // Add the connecting lines | 435 // Add the connecting lines |
443 parent->addChild(id); | 444 parent->addChild(id); |
444 ConnectionItem *conn = new ConnectionItem(); | 445 ConnectionItem *conn = new ConnectionItem(); |
445 if (merge) conn->setConnectionType(ConnectionItem::Merge); | 446 if (merge) conn->setConnectionType(ConnectionItem::Merge); |
446 conn->setChild(item); | 447 conn->setChild(item); |
447 conn->setParent(m_items[parentId]); | 448 conn->setParent(m_items[parentId]); |
449 conn->setZValue(-1); | |
448 m_scene->addItem(conn); | 450 m_scene->addItem(conn); |
449 } | 451 } |
450 } | 452 } |
451 | 453 |
452 // Add uncommitted item and connecting line as necessary | 454 // Add uncommitted item and connecting line as necessary |
453 | 455 |
454 if (!m_uncommittedParents.empty()) { | 456 if (!m_uncommittedParents.empty()) { |
455 m_uncommitted = new UncommittedItem(); | 457 m_uncommitted = new UncommittedItem(); |
456 m_uncommitted->setBranch(uncommittedBranch); | 458 m_uncommitted->setBranch(uncommittedBranch); |
459 m_uncommitted->setZValue(10); | |
457 m_scene->addUncommittedItem(m_uncommitted); | 460 m_scene->addUncommittedItem(m_uncommitted); |
458 foreach (QString p, m_uncommittedParents) { | 461 foreach (QString p, m_uncommittedParents) { |
459 ConnectionItem *conn = new ConnectionItem(); | 462 ConnectionItem *conn = new ConnectionItem(); |
460 conn->setConnectionType(ConnectionItem::Merge); | 463 conn->setConnectionType(ConnectionItem::Merge); |
461 conn->setParent(m_items[p]); | 464 conn->setParent(m_items[p]); |
462 conn->setChild(m_uncommitted); | 465 conn->setChild(m_uncommitted); |
466 conn->setZValue(0); | |
463 m_scene->addItem(conn); | 467 m_scene->addItem(conn); |
464 } | 468 } |
465 } | 469 } |
466 | 470 |
467 // Add the branch labels | 471 // Add the branch labels |
581 DateItem *item = new DateItem(); | 585 DateItem *item = new DateItem(); |
582 item->setDateString(prevDate); | 586 item->setDateString(prevDate); |
583 item->setCols(datemincol, datemaxcol - datemincol + 1); | 587 item->setCols(datemincol, datemaxcol - datemincol + 1); |
584 item->setRows(changeRow, n); | 588 item->setRows(changeRow, n); |
585 item->setEven(even); | 589 item->setEven(even); |
586 item->setZValue(-1); | 590 item->setZValue(-2); |
587 m_scene->addDateItem(item); | 591 m_scene->addDateItem(item); |
588 even = !even; | 592 even = !even; |
589 } | 593 } |
590 prevDate = date; | 594 prevDate = date; |
591 changeRow = row; | 595 changeRow = row; |
597 DateItem *item = new DateItem(); | 601 DateItem *item = new DateItem(); |
598 item->setDateString(prevDate); | 602 item->setDateString(prevDate); |
599 item->setCols(datemincol, datemaxcol - datemincol + 1); | 603 item->setCols(datemincol, datemaxcol - datemincol + 1); |
600 item->setRows(changeRow, n+1); | 604 item->setRows(changeRow, n+1); |
601 item->setEven(even); | 605 item->setEven(even); |
602 item->setZValue(-1); | 606 item->setZValue(-2); |
603 m_scene->addDateItem(item); | 607 m_scene->addDateItem(item); |
604 even = !even; | 608 even = !even; |
605 } | 609 } |
606 } | 610 } |
607 | 611 |