268{
269 const int CORNER_RADIUS = 4;
270 const int PEN_WIDTH = 5;
271 const QColor BACKGROUND_COLOR = Qt::darkGray;
272 const QColor OUTLINE_COLOR(60, 60, 60, 80);
273 const QColor DOT_COLOR = Qt::lightGray;
274 const int DOT_SIZE = 4;
275 const int DOT_SPACING = 5;
276 const QPoint DRAG_HANDLE_RECT_DOTS_OFFSET(10, 10);
277
278 QRectF actionBarRect(
d->m_dragHandle->position, QSize(
d->m_actionBarWidth,
BUTTON_SIZE));
279 QPainterPath bgPath;
280 bgPath.addRoundedRect(actionBarRect, CORNER_RADIUS, CORNER_RADIUS);
281 painter.fillPath(bgPath, BACKGROUND_COLOR);
282
283 QPen pen(OUTLINE_COLOR);
284 pen.setWidth(PEN_WIDTH);
285 painter.setPen(pen);
286 painter.drawPath(bgPath);
287
288 QRectF dragHandleRect(
289 QPoint(
d->m_dragHandle->position.x() +
d->m_actionBarWidth -
BUTTON_SIZE,
d->m_dragHandle->position.y()),
291 QPainterPath dragHandlePath;
292 dragHandlePath.addRect(dragHandleRect);
293 painter.fillPath(dragHandlePath, BACKGROUND_COLOR);
294
295 const std::list<std::pair<int, int>> DOT_OFFSETS = {{0, 0},
296 {DOT_SPACING, 0},
297 {-DOT_SPACING, 0},
298 {0, DOT_SPACING},
299 {0, -DOT_SPACING},
300 {DOT_SPACING, DOT_SPACING},
301 {DOT_SPACING, -DOT_SPACING},
302 {-DOT_SPACING, DOT_SPACING},
303 {-DOT_SPACING, -DOT_SPACING}};
304
305 QPainterPath dragHandleRectDots;
306 for (const std::pair<int, int> &offset : DOT_OFFSETS) {
307 dragHandleRectDots.addEllipse(offset.first, offset.second, DOT_SIZE, DOT_SIZE);
308 };
309
310 dragHandleRectDots.translate(dragHandleRect.topLeft() + DRAG_HANDLE_RECT_DOTS_OFFSET);
311 painter.fillPath(dragHandleRectDots, DOT_COLOR);
312}