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