mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-02 21:58:42 +00:00
update:mac异形窗口+全屏解决
This commit is contained in:
parent
1d54d9b385
commit
618e6a099b
1 changed files with 11 additions and 4 deletions
|
@ -79,13 +79,12 @@ void VideoForm::initUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
// TODO mac: Qt::FramelessWindowHit full screen is abnormal
|
|
||||||
#ifndef Q_OS_OSX
|
|
||||||
// 去掉标题栏
|
// 去掉标题栏
|
||||||
setWindowFlags(Qt::FramelessWindowHint);
|
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
|
||||||
// 根据图片构造异形窗口
|
// 根据图片构造异形窗口
|
||||||
setAttribute(Qt::WA_TranslucentBackground);
|
setAttribute(Qt::WA_TranslucentBackground);
|
||||||
#endif
|
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
ui->loadingWidget->setAttribute(Qt::WA_DeleteOnClose);
|
ui->loadingWidget->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
ui->videoWidget->setMouseTracking(true);
|
ui->videoWidget->setMouseTracking(true);
|
||||||
|
@ -258,12 +257,20 @@ void VideoForm::switchFullScreen()
|
||||||
{
|
{
|
||||||
if (isFullScreen()) {
|
if (isFullScreen()) {
|
||||||
showNormal();
|
showNormal();
|
||||||
|
#ifdef Q_OS_OSX
|
||||||
|
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
|
||||||
|
show();
|
||||||
|
#endif
|
||||||
updateStyleSheet(height() > width());
|
updateStyleSheet(height() > width());
|
||||||
showToolFrom(true);
|
showToolFrom(true);
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
::SetThreadExecutionState(ES_CONTINUOUS);
|
::SetThreadExecutionState(ES_CONTINUOUS);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
// mac fullscreen must show title bar
|
||||||
|
#ifdef Q_OS_OSX
|
||||||
|
setWindowFlags(windowFlags() & ~Qt::FramelessWindowHint);
|
||||||
|
#endif
|
||||||
showToolFrom(false);
|
showToolFrom(false);
|
||||||
layout()->setContentsMargins(0, 0, 0, 0);
|
layout()->setContentsMargins(0, 0, 0, 0);
|
||||||
showFullScreen();
|
showFullScreen();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue