mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-02 21:58:42 +00:00
feat: hor fullscreen disable keep width/height ratio
This commit is contained in:
parent
d9800da5f9
commit
c1f31351f9
1 changed files with 10 additions and 0 deletions
|
@ -193,6 +193,11 @@ void VideoForm::updateShowSize(const QSize &newSize)
|
||||||
void VideoForm::switchFullScreen()
|
void VideoForm::switchFullScreen()
|
||||||
{
|
{
|
||||||
if (isFullScreen()) {
|
if (isFullScreen()) {
|
||||||
|
// 横屏全屏铺满全屏,恢复时,恢复保持宽高比
|
||||||
|
if (m_widthHeightRatio > 1.0f) {
|
||||||
|
ui->keepRadioWidget->setWidthHeightRadio(m_widthHeightRatio);
|
||||||
|
}
|
||||||
|
|
||||||
showNormal();
|
showNormal();
|
||||||
// fullscreen window will move (0,0). qt bug?
|
// fullscreen window will move (0,0). qt bug?
|
||||||
move(m_fullScreenBeforePos);
|
move(m_fullScreenBeforePos);
|
||||||
|
@ -209,6 +214,11 @@ void VideoForm::switchFullScreen()
|
||||||
::SetThreadExecutionState(ES_CONTINUOUS);
|
::SetThreadExecutionState(ES_CONTINUOUS);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
// 横屏全屏铺满全屏,不保持宽高比
|
||||||
|
if (m_widthHeightRatio > 1.0f) {
|
||||||
|
ui->keepRadioWidget->setWidthHeightRadio(-1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
m_fullScreenBeforePos = pos();
|
m_fullScreenBeforePos = pos();
|
||||||
// 这种临时增加标题栏再全屏的方案会导致收不到mousemove事件,导致setmousetrack失效
|
// 这种临时增加标题栏再全屏的方案会导致收不到mousemove事件,导致setmousetrack失效
|
||||||
// mac fullscreen must show title bar
|
// mac fullscreen must show title bar
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue