mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-05 06:58:40 +00:00
feat: add show touch switch
This commit is contained in:
parent
3a970ff07f
commit
5d111e3dda
10 changed files with 73 additions and 21 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include "iconhelper.h"
|
#include "iconhelper.h"
|
||||||
#include "videoform.h"
|
#include "videoform.h"
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
|
#include "adbprocess.h"
|
||||||
|
|
||||||
ToolForm::ToolForm(QWidget* adsorbWidget, AdsorbPositions adsorbPos)
|
ToolForm::ToolForm(QWidget* adsorbWidget, AdsorbPositions adsorbPos)
|
||||||
: MagneticWidget(adsorbWidget, adsorbPos)
|
: MagneticWidget(adsorbWidget, adsorbPos)
|
||||||
|
@ -41,6 +42,7 @@ void ToolForm::initStyle()
|
||||||
IconHelper::Instance()->SetIcon(ui->powerBtn, QChar(0xf011), 15);
|
IconHelper::Instance()->SetIcon(ui->powerBtn, QChar(0xf011), 15);
|
||||||
IconHelper::Instance()->SetIcon(ui->expandNotifyBtn, QChar(0xf103), 15);
|
IconHelper::Instance()->SetIcon(ui->expandNotifyBtn, QChar(0xf103), 15);
|
||||||
IconHelper::Instance()->SetIcon(ui->screenShotBtn, QChar(0xf0c4), 15);
|
IconHelper::Instance()->SetIcon(ui->screenShotBtn, QChar(0xf0c4), 15);
|
||||||
|
IconHelper::Instance()->SetIcon(ui->touchBtn, QChar(0xf111), 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolForm::mousePressEvent(QMouseEvent *event)
|
void ToolForm::mousePressEvent(QMouseEvent *event)
|
||||||
|
@ -150,3 +152,25 @@ void ToolForm::on_expandNotifyBtn_clicked()
|
||||||
m_videoForm->getController()->expandNotificationPanel();
|
m_videoForm->getController()->expandNotificationPanel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToolForm::on_touchBtn_clicked()
|
||||||
|
{
|
||||||
|
if (!m_videoForm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_showTouch = !m_showTouch;
|
||||||
|
|
||||||
|
AdbProcess* adb = new AdbProcess();
|
||||||
|
if (!adb) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
connect(adb, &AdbProcess::adbProcessResult, this, [this](AdbProcess::ADB_EXEC_RESULT processResult){
|
||||||
|
if (AdbProcess::AER_SUCCESS_START != processResult) {
|
||||||
|
sender()->deleteLater();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
adb->setShowTouchesEnabled(m_videoForm->getSerial(), m_showTouch);
|
||||||
|
|
||||||
|
qInfo() << "show touch " << (m_showTouch ? "enable" : "disable");
|
||||||
|
}
|
||||||
|
|
|
@ -53,6 +53,8 @@ private slots:
|
||||||
|
|
||||||
void on_expandNotifyBtn_clicked();
|
void on_expandNotifyBtn_clicked();
|
||||||
|
|
||||||
|
void on_touchBtn_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initStyle();
|
void initStyle();
|
||||||
|
|
||||||
|
@ -60,6 +62,7 @@ private:
|
||||||
Ui::ToolForm *ui;
|
Ui::ToolForm *ui;
|
||||||
QPoint m_dragPosition;
|
QPoint m_dragPosition;
|
||||||
QPointer<VideoForm> m_videoForm;
|
QPointer<VideoForm> m_videoForm;
|
||||||
|
bool m_showTouch = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TOOLFORM_H
|
#endif // TOOLFORM_H
|
||||||
|
|
|
@ -53,6 +53,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="touchBtn">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>touch switch</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="closeScreenBtn">
|
<widget class="QPushButton" name="closeScreenBtn">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|
|
@ -247,6 +247,11 @@ void VideoForm::setSerial(const QString &serial)
|
||||||
m_serial = serial;
|
m_serial = serial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString &VideoForm::getSerial()
|
||||||
|
{
|
||||||
|
return m_serial;
|
||||||
|
}
|
||||||
|
|
||||||
void VideoForm::setController(Controller *controller)
|
void VideoForm::setController(Controller *controller)
|
||||||
{
|
{
|
||||||
m_controller = controller;
|
m_controller = controller;
|
||||||
|
|
|
@ -28,6 +28,7 @@ public:
|
||||||
Controller* getController();
|
Controller* getController();
|
||||||
void setFileHandler(FileHandler *fileHandler);
|
void setFileHandler(FileHandler *fileHandler);
|
||||||
void setSerial(const QString &serial);
|
void setSerial(const QString &serial);
|
||||||
|
const QString& getSerial();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void screenshot();
|
void screenshot();
|
||||||
|
|
Binary file not shown.
|
@ -75,7 +75,7 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../dialog.ui" line="144"/>
|
<location filename="../../dialog.ui" line="144"/>
|
||||||
<location filename="../../dialog.cpp" line="294"/>
|
<location filename="../../dialog.cpp" line="293"/>
|
||||||
<source>select path</source>
|
<source>select path</source>
|
||||||
<translation>select path</translation>
|
<translation>select path</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -225,46 +225,51 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="59"/>
|
<location filename="../../device/ui/toolform.ui" line="59"/>
|
||||||
|
<source>touch switch</source>
|
||||||
|
<translation>touch switch</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../device/ui/toolform.ui" line="69"/>
|
||||||
<source>close screen</source>
|
<source>close screen</source>
|
||||||
<translation>close screen</translation>
|
<translation>close screen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="69"/>
|
<location filename="../../device/ui/toolform.ui" line="79"/>
|
||||||
<source>power</source>
|
<source>power</source>
|
||||||
<translation>power</translation>
|
<translation>power</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="79"/>
|
<location filename="../../device/ui/toolform.ui" line="89"/>
|
||||||
<source>volume up</source>
|
<source>volume up</source>
|
||||||
<translation>volume up</translation>
|
<translation>volume up</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="89"/>
|
<location filename="../../device/ui/toolform.ui" line="99"/>
|
||||||
<source>volume down</source>
|
<source>volume down</source>
|
||||||
<translation>volume down</translation>
|
<translation>volume down</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="99"/>
|
<location filename="../../device/ui/toolform.ui" line="109"/>
|
||||||
<source>app switch</source>
|
<source>app switch</source>
|
||||||
<translation>app switch</translation>
|
<translation>app switch</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="109"/>
|
<location filename="../../device/ui/toolform.ui" line="119"/>
|
||||||
<source>menu</source>
|
<source>menu</source>
|
||||||
<translation>menu</translation>
|
<translation>menu</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="119"/>
|
<location filename="../../device/ui/toolform.ui" line="129"/>
|
||||||
<source>home</source>
|
<source>home</source>
|
||||||
<translation>home</translation>
|
<translation>home</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="129"/>
|
<location filename="../../device/ui/toolform.ui" line="139"/>
|
||||||
<source>return</source>
|
<source>return</source>
|
||||||
<translation>return</translation>
|
<translation>return</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="139"/>
|
<location filename="../../device/ui/toolform.ui" line="149"/>
|
||||||
<source>screen shot</source>
|
<source>screen shot</source>
|
||||||
<translation>screen shot</translation>
|
<translation>screen shot</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -284,7 +289,7 @@
|
||||||
<translation type="vanished">file transfer failed</translation>
|
<translation type="vanished">file transfer failed</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/videoform.cpp" line="408"/>
|
<location filename="../../device/ui/videoform.cpp" line="413"/>
|
||||||
<source>file does not exist</source>
|
<source>file does not exist</source>
|
||||||
<translation>file does not exist</translation>
|
<translation>file does not exist</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Binary file not shown.
|
@ -75,7 +75,7 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../dialog.ui" line="144"/>
|
<location filename="../../dialog.ui" line="144"/>
|
||||||
<location filename="../../dialog.cpp" line="294"/>
|
<location filename="../../dialog.cpp" line="293"/>
|
||||||
<source>select path</source>
|
<source>select path</source>
|
||||||
<translation>选择路径</translation>
|
<translation>选择路径</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -225,46 +225,51 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="59"/>
|
<location filename="../../device/ui/toolform.ui" line="59"/>
|
||||||
|
<source>touch switch</source>
|
||||||
|
<translation>触摸显示开关</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../device/ui/toolform.ui" line="69"/>
|
||||||
<source>close screen</source>
|
<source>close screen</source>
|
||||||
<translation>关闭屏幕</translation>
|
<translation>关闭屏幕</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="69"/>
|
<location filename="../../device/ui/toolform.ui" line="79"/>
|
||||||
<source>power</source>
|
<source>power</source>
|
||||||
<translation>电源</translation>
|
<translation>电源</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="79"/>
|
<location filename="../../device/ui/toolform.ui" line="89"/>
|
||||||
<source>volume up</source>
|
<source>volume up</source>
|
||||||
<translation>音量加</translation>
|
<translation>音量加</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="89"/>
|
<location filename="../../device/ui/toolform.ui" line="99"/>
|
||||||
<source>volume down</source>
|
<source>volume down</source>
|
||||||
<translation>音量减</translation>
|
<translation>音量减</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="99"/>
|
<location filename="../../device/ui/toolform.ui" line="109"/>
|
||||||
<source>app switch</source>
|
<source>app switch</source>
|
||||||
<translation>切换应用</translation>
|
<translation>切换应用</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="109"/>
|
<location filename="../../device/ui/toolform.ui" line="119"/>
|
||||||
<source>menu</source>
|
<source>menu</source>
|
||||||
<translation>菜单</translation>
|
<translation>菜单</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="119"/>
|
<location filename="../../device/ui/toolform.ui" line="129"/>
|
||||||
<source>home</source>
|
<source>home</source>
|
||||||
<translation>主界面</translation>
|
<translation>主界面</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="129"/>
|
<location filename="../../device/ui/toolform.ui" line="139"/>
|
||||||
<source>return</source>
|
<source>return</source>
|
||||||
<translation>返回</translation>
|
<translation>返回</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/toolform.ui" line="139"/>
|
<location filename="../../device/ui/toolform.ui" line="149"/>
|
||||||
<source>screen shot</source>
|
<source>screen shot</source>
|
||||||
<translation>截图</translation>
|
<translation>截图</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -284,7 +289,7 @@
|
||||||
<translation type="vanished">文件传输失败</translation>
|
<translation type="vanished">文件传输失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../device/ui/videoform.cpp" line="408"/>
|
<location filename="../../device/ui/videoform.cpp" line="413"/>
|
||||||
<source>file does not exist</source>
|
<source>file does not exist</source>
|
||||||
<translation>文件不存在</translation>
|
<translation>文件不存在</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
- 中文输入(server需要改为apk,作为一个输入法,暂不实现)(或者有其他方式案件注入方式,例如搜狗手机输入法可以监听当前注入?)
|
- 中文输入(server需要改为apk,作为一个输入法,暂不实现)(或者有其他方式案件注入方式,例如搜狗手机输入法可以监听当前注入?)
|
||||||
- [单独线程统计帧率](https://github.com/Genymobile/scrcpy/commit/e2a272bf99ecf48fcb050177113f903b3fb323c4)
|
- [单独线程统计帧率](https://github.com/Genymobile/scrcpy/commit/e2a272bf99ecf48fcb050177113f903b3fb323c4)
|
||||||
- text转换 https://github.com/Genymobile/scrcpy/commit/c916af0984f72a60301d13fa8ef9a85112f54202?tdsourcetag=s_pctim_aiomsg
|
- text转换 https://github.com/Genymobile/scrcpy/commit/c916af0984f72a60301d13fa8ef9a85112f54202?tdsourcetag=s_pctim_aiomsg
|
||||||
- ui提供show touch设置
|
|
||||||
|
|
||||||
## 中优先级
|
## 中优先级
|
||||||
- 自动打包脚本
|
- 自动打包脚本
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue