mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 19:44:59 +00:00
parent
e10bfde6b4
commit
7b1822bcec
2 changed files with 7 additions and 18 deletions
|
@ -166,7 +166,7 @@ void VideoForm::updateShowSize(const QSize &newSize)
|
|||
}
|
||||
|
||||
if (!m_skin) {
|
||||
// 减去标题栏高度 (mark:已经没有标题栏了)
|
||||
// 减去标题栏高度
|
||||
int titleBarHeight = style()->pixelMetric(QStyle::PM_TitleBarHeight);
|
||||
showSize.setHeight(showSize.height() - titleBarHeight);
|
||||
}
|
||||
|
|
|
@ -184,23 +184,12 @@ void MagneticWidget::moveEvent(QMoveEvent *event)
|
|||
|
||||
void MagneticWidget::getGeometry(QRect &relativeWidgetRect, QRect &targetWidgetRect)
|
||||
{
|
||||
QRect parentRect = m_adsorbWidget->geometry();
|
||||
QRect targetRect = geometry();
|
||||
relativeWidgetRect.setTopLeft(m_adsorbWidget->pos());
|
||||
relativeWidgetRect.setWidth(m_adsorbWidget->width());
|
||||
relativeWidgetRect.setHeight(m_adsorbWidget->height());
|
||||
|
||||
if (!m_adsorbWidget->windowFlags().testFlag(Qt::FramelessWindowHint)) {
|
||||
// title bar height
|
||||
int titleBarHeight = m_adsorbWidget->style()->pixelMetric(QStyle::PM_TitleBarHeight);
|
||||
parentRect.translate(0, -titleBarHeight);
|
||||
parentRect.setHeight(parentRect.height() + titleBarHeight);
|
||||
}
|
||||
|
||||
if (!windowFlags().testFlag(Qt::FramelessWindowHint)) {
|
||||
// title bar height
|
||||
int titleBarHeight = style()->pixelMetric(QStyle::PM_TitleBarHeight);
|
||||
targetRect.translate(0, -titleBarHeight);
|
||||
targetRect.setHeight(targetRect.height() + titleBarHeight);
|
||||
}
|
||||
relativeWidgetRect = parentRect;
|
||||
targetWidgetRect = targetRect;
|
||||
targetWidgetRect.setTopLeft(pos());
|
||||
targetWidgetRect.setWidth(width());
|
||||
targetWidgetRect.setHeight(height());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue