@@ -42,13 +42,17 @@ namespace DiffViews
42
42
void SeqViewHunkHeader::paint ( QPainter* p, const QStyleOptionGraphicsItem*, QWidget* )
43
43
{
44
44
SeqViewInfo* i = info ();
45
+ QPen pen (i->clrSeparator );
46
+ pen.setWidth (0 );
47
+
45
48
QFontMetricsF fm ( i->mFixed );
46
49
47
- p->setPen ( i-> clrSeparator );
50
+ p->setPen (pen );
48
51
p->setBrush ( i->clrDeltaFirst );
49
52
p->drawRect ( 10 ., 0 ., width () - 20 ., height () );
50
53
51
- p->setPen ( i->clrText );
54
+ pen.setColor (i->clrText );
55
+ p->setPen (pen);
52
56
p->setFont ( i->mFixed );
53
57
p->drawText ( QRectF ( 12 , 1 - fm.leading () / 2 ., width () - 24 , height () - 2 ),
54
58
Qt::AlignLeft | Qt::AlignTop | Qt::TextWrapAnywhere, mText );
@@ -150,30 +154,31 @@ namespace DiffViews
150
154
SeqViewInfo* ifo = info ();
151
155
152
156
QFontMetricsF fm ( ifo->mFixed );
157
+ QRectF outline (10 , 0 , width () - 20 , height ());
153
158
QRectF r = fm.boundingRect ( QLatin1String ( " X" ) );
154
159
qreal lh = r.height () + 1 ;
155
- qreal top = 1 .;
156
-
157
- p->setPen ( ifo->clrSeparator );
158
- p->setBrush ( ifo->clrDeltaFirst );
159
- p->drawRect ( 10 , 0 , width () - 20 , height () - 1 );
160
+ qreal top = 0 ;
160
161
161
162
qreal left = 12 + mSpaceLeft + mSpaceRight + 6 ;
162
163
qreal wide = width () - 12 - left;
163
164
165
+ p->fillRect (outline , ifo->clrDeltaFirst );
164
166
p->setFont ( ifo->mFixed );
165
167
168
+ QPen pen (ifo->clrText );
169
+ pen.setWidth (0 );
170
+ p->setPen (pen);
171
+
166
172
for ( int i = 0 ; i < mLines .count (); ++i )
167
173
{
168
174
if ( !mLines [ i ].rightNr )
169
175
{
170
- p->fillRect ( QRectF ( 11 , top, width () - 21 , lh ), ifo->clrRemoved );
176
+ p->fillRect ( QRectF ( 10 , top, width () - 20 , lh ), ifo->clrRemoved );
171
177
}
172
178
else if ( !mLines [ i ].leftNr )
173
179
{
174
- p->fillRect ( QRectF ( 11 , top, width () - 21 , lh ), ifo->clrAdded );
180
+ p->fillRect ( QRectF ( 10 , top, width () - 20 , lh ), ifo->clrAdded );
175
181
}
176
- p->setPen ( ifo->clrText );
177
182
178
183
qreal top2 = top - fm.leading () / 2 .;
179
184
if ( mLines [ i ].leftNr )
@@ -197,12 +202,14 @@ namespace DiffViews
197
202
top += lh;
198
203
}
199
204
200
- p->setPen ( ifo->clrSeparator );
205
+ pen.setColor (ifo->clrSeparator );
206
+ p->setPen (pen);
207
+ p->drawRect (outline );
201
208
p->drawLine ( 12 + mSpaceLeft + 1 , 0 ,
202
- 12 + mSpaceLeft + 1 , height () - 1 );
209
+ 12 + mSpaceLeft + 1 , height () );
203
210
204
211
p->drawLine ( 12 + mSpaceLeft + mSpaceRight + 2 , 0 ,
205
- 12 + mSpaceLeft + mSpaceRight + 2 , height () - 1 );
212
+ 12 + mSpaceLeft + mSpaceRight + 2 , height () );
206
213
}
207
214
208
215
}
0 commit comments