| | |
| | | // Copyright (C) 2023-2024 Stdware Collections |
| | | // Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware) |
| | | // Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao) |
| | | // SPDX-License-Identifier: Apache-2.0 |
| | | |
| | | #include "qtwindowcontext_p.h" |
| | |
| | | auto window = m_context->window(); |
| | | auto delegate = m_context->delegate(); |
| | | auto me = static_cast<const QMouseEvent *>(event); |
| | | bool fixedSize = delegate->isHostSizeFixed(host); |
| | | bool fixedSize = m_context->isHostSizeFixed(); |
| | | |
| | | QPoint scenePos = getMouseEventScenePos(me); |
| | | QPoint globalPos = getMouseEventGlobalPos(me); |
| | |
| | | |
| | | case QEvent::MouseButtonDblClick: { |
| | | if (me->button() == Qt::LeftButton && inTitleBar && !fixedSize) { |
| | | Qt::WindowFlags windowFlags = delegate->getWindowFlags(host); |
| | | Qt::WindowStates windowState = delegate->getWindowState(host); |
| | | if (!(windowState & Qt::WindowFullScreen)) { |
| | | if ((windowFlags & Qt::WindowMaximizeButtonHint) && |
| | | !(windowState & Qt::WindowFullScreen)) { |
| | | if (windowState & Qt::WindowMaximized) { |
| | | delegate->setWindowState(host, windowState & ~Qt::WindowMaximized); |
| | | } else { |
| | |
| | | AbstractWindowContext::virtual_hook(id, data); |
| | | } |
| | | |
| | | void QtWindowContext::winIdChanged() { |
| | | void QtWindowContext::winIdChanged(WId winId, WId oldWinId) { |
| | | if (!m_windowHandle) { |
| | | m_delegate->setWindowFlags(m_host, m_delegate->getWindowFlags(m_host) & |
| | | ~Qt::FramelessWindowHint); |