mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 19:44:59 +00:00
fix:保持视频窗口和实际视频分辨率比例一致
This commit is contained in:
parent
dc3645c61a
commit
67ed9d9bd5
1 changed files with 6 additions and 0 deletions
|
@ -137,6 +137,12 @@ void VideoForm::updateShowSize(const QSize &newSize)
|
|||
if (isFullScreen()) {
|
||||
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());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue