comparison view/Overview.cpp @ 935:1c529a22a6a7 tonioni

changed rectangle in Overview: colour and roundedness
author matthiasm
date Mon, 30 Mar 2015 14:14:33 +0100
parents 26da827e8fb5
children 73b0dc7d6ec1
comparison
equal deleted inserted replaced
934:325a7aa69055 935:1c529a22a6a7
233 } 233 }
234 234
235 int x0 = getXForFrame(f0); 235 int x0 = getXForFrame(f0);
236 int x1 = getXForFrame(f1); 236 int x1 = getXForFrame(f1);
237 237
238
238 if (x1 <= x0) x1 = x0 + 1; 239 if (x1 <= x0) x1 = x0 + 1;
239 240
240 std::pair<int, int> extent(x0, x1); 241 std::pair<int, int> extent(x0, x1);
241 242
242 if (extents.find(extent) == extents.end()) { 243 if (extents.find(extent) == extents.end()) {
243 244
244 y += height() / 10 + 1; 245 y += height() / 10 + 1;
245 extents.insert(extent); 246 extents.insert(extent);
246 247
247 QRect vr(x0, y, x1 - x0, height() - 2 * y); 248 QRect vr(x0, y, x1 - x0, height() - 2 * y);
248 rects.push_back(vr); 249 rects.push_back(vr);
249 primary = vr; //!!! for now 250 primary = vr; //!!! for now
250 } 251 }
251 } 252 }
252 253
253 QPainterPath without; 254 QPainterPath without;
254 without.addRoundedRect(primary, 8, 8); 255 without.addRoundedRect(primary, 4, 4);
255 without.addRect(rect()); 256 without.addRect(rect());
256 paint.setPen(Qt::NoPen); 257 paint.setPen(Qt::NoPen);
257 paint.setBrush(getFillWithout()); 258 paint.setBrush(getFillWithout());
258 paint.drawPath(without); 259 paint.drawPath(without);
259 260
260 paint.setBrush(getFillWithin()); 261 paint.setBrush(getFillWithin());
261 paint.drawRoundedRect(primary, 8, 8); 262 paint.drawRoundedRect(primary, 4, 4);
262 263
263 foreach (QRect vr, rects) { 264 foreach (QRect vr, rects) {
264 paint.setBrush(Qt::NoBrush); 265 paint.setBrush(Qt::NoBrush);
265 paint.setPen(QPen(getForeground(), 2)); 266 paint.setPen(QPen(Qt::gray, 2));
266 paint.drawRoundedRect(vr, 8, 8); 267 paint.drawRoundedRect(vr, 4, 4);
267 } 268 }
268 269
269 paint.end(); 270 paint.end();
270 } 271 }
271 272