mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-04 14:48:37 +00:00
fix: stays on top
This commit is contained in:
parent
285fb030a6
commit
906f49b451
3 changed files with 20 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "devicemanage.h"
|
#include "devicemanage.h"
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
|
#include "videoform.h"
|
||||||
|
|
||||||
#define DM_MAX_DEVICES_NUM 16
|
#define DM_MAX_DEVICES_NUM 16
|
||||||
|
|
||||||
|
@ -62,6 +63,21 @@ void DeviceManage::updateScript(QString script)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DeviceManage::staysOnTop(const QString &serial)
|
||||||
|
{
|
||||||
|
if (!serial.isEmpty() && m_devices.contains(serial)) {
|
||||||
|
auto it = m_devices.find(serial);
|
||||||
|
if (!it->data()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!it->data()->getVideoForm()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
it->data()->getVideoForm()->staysOnTop();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool DeviceManage::disconnectDevice(const QString &serial)
|
bool DeviceManage::disconnectDevice(const QString &serial)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
|
@ -15,6 +15,7 @@ public:
|
||||||
|
|
||||||
bool connectDevice(Device::DeviceParams params);
|
bool connectDevice(Device::DeviceParams params);
|
||||||
void updateScript(QString script);
|
void updateScript(QString script);
|
||||||
|
bool staysOnTop(const QString &serial);
|
||||||
|
|
||||||
bool disconnectDevice(const QString &serial);
|
bool disconnectDevice(const QString &serial);
|
||||||
void disconnectAllDevice();
|
void disconnectAllDevice();
|
||||||
|
|
|
@ -166,11 +166,9 @@ void Dialog::on_startServerBtn_clicked()
|
||||||
|
|
||||||
m_deviceManage.connectDevice(params);
|
m_deviceManage.connectDevice(params);
|
||||||
|
|
||||||
/*
|
if (ui->alwaysTopCheck->isChecked()) {
|
||||||
if (ui->alwaysTopCheck->isChecked() && m_device->getVideoForm()) {
|
m_deviceManage.staysOnTop(params.serial);
|
||||||
m_device->getVideoForm()->staysOnTop();
|
}
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::on_stopServerBtn_clicked()
|
void Dialog::on_stopServerBtn_clicked()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue