mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-02 21:58:42 +00:00
fix:保持视频窗口和实际视频分辨率比例一致
This commit is contained in:
parent
69f435fdec
commit
93d84b44a2
1 changed files with 6 additions and 0 deletions
|
@ -137,6 +137,12 @@ void VideoForm::updateShowSize(const QSize &newSize)
|
||||||
if (isFullScreen()) {
|
if (isFullScreen()) {
|
||||||
switchFullScreen();
|
switchFullScreen();
|
||||||
}
|
}
|
||||||
|
if (layout()) {
|
||||||
|
QMargins m = layout()->contentsMargins();
|
||||||
|
showSize.setWidth(showSize.width() + m.left() + m.right());
|
||||||
|
showSize.setHeight(showSize.height() + m.top() + m.bottom());
|
||||||
|
}
|
||||||
|
|
||||||
// 窗口居中
|
// 窗口居中
|
||||||
move(screenRect.center() - QRect(0, 0, showSize.width(), showSize.height()).center());
|
move(screenRect.center() - QRect(0, 0, showSize.width(), showSize.height()).center());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue