* @brief Toggles the window maximized state on double-click. */
| 718 | * @brief Toggles the window maximized state on double-click. |
| 719 | */ |
| 720 | void Titlebar::mouseDoubleClickEvent(QMouseEvent* event) |
| 721 | { |
| 722 | if (buttonAt(event->position()) == Button::None && window()) { |
| 723 | m_dragging = false; |
| 724 | m_pressedButton = Button::None; |
| 725 | m_hoveredButton = Button::None; |
| 726 | |
| 727 | if (shouldShowButton(Button::Maximize)) { |
| 728 | if (isMaximized()) |
| 729 | window()->showNormal(); |
| 730 | else |
| 731 | window()->showMaximized(); |
| 732 | |
| 733 | update(); |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | event->accept(); |
| 738 | } |
| 739 | |
| 740 | /** |
| 741 | * @brief Handles hover move events to update button hover states. |