Mercurial > hg > easyhg
comparison uncommitteditem.cpp @ 131:2550aaa09240
* Add connecting line to uncommitted item; turn Revert icon blue; cut down menus to things that actually work (well, mostly)
author | Chris Cannam |
---|---|
date | Tue, 30 Nov 2010 11:17:30 +0000 |
parents | 4986642800f0 |
children | e6c6b88d19b9 |
comparison
equal
deleted
inserted
replaced
130:9ae4cc0055e8 | 131:2550aaa09240 |
---|---|
32 } | 32 } |
33 | 33 |
34 QRectF | 34 QRectF |
35 UncommittedItem::boundingRect() const | 35 UncommittedItem::boundingRect() const |
36 { | 36 { |
37 //!!! this stuff is gross, refactor with changesetitem | 37 //!!! this stuff is gross, refactor with changesetitem and connectionitem |
38 int w = 100; | 38 int w = 100; |
39 if (m_wide) w = 180; | 39 if (m_wide) w = 180; |
40 return QRectF(-((w-50)/2 - 1), -30, w - 3, 79); | 40 return QRectF(-((w-50)/2 - 1), -30, w - 3, 79 + 40); |
41 } | 41 } |
42 | 42 |
43 void | 43 void |
44 UncommittedItem::paint(QPainter *paint, const QStyleOptionGraphicsItem *option, | 44 UncommittedItem::paint(QPainter *paint, const QStyleOptionGraphicsItem *option, |
45 QWidget *w) | 45 QWidget *w) |
75 | 75 |
76 int height = 49; | 76 int height = 49; |
77 QRectF r(x0, 0, width - 3, height); | 77 QRectF r(x0, 0, width - 3, height); |
78 paint->drawRect(r); | 78 paint->drawRect(r); |
79 | 79 |
80 paint->drawLine(x0 + width/2, height, x0 + width/2, height + 40); | |
81 | |
80 QString label = tr("Uncommitted changes"); | 82 QString label = tr("Uncommitted changes"); |
81 paint->drawText(-(fm.width(label) - 50)/2, 25 - fm.height()/2 + fm.ascent(), label); | 83 paint->drawText(-(fm.width(label) - 50)/2, 25 - fm.height()/2 + fm.ascent(), label); |
82 | 84 |
83 paint->restore(); | 85 paint->restore(); |
84 return; | 86 return; |