* @brief Returns the bounding rectangle for a window control button. */
| 379 | * @brief Returns the bounding rectangle for a window control button. |
| 380 | */ |
| 381 | QRectF Titlebar::buttonRect(Button button) const |
| 382 | { |
| 383 | const QRectF bgRect = buttonBackgroundRect(button); |
| 384 | const qreal iconSize = CSD::ButtonSize * 0.5; |
| 385 | |
| 386 | return { |
| 387 | bgRect.center().x() - iconSize / 2, bgRect.center().y() - iconSize / 2, iconSize, iconSize}; |
| 388 | } |
| 389 | |
| 390 | /** |
| 391 | * @brief Returns the button (if any) at the given position. |