mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-31 12:58:39 +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 "videoform.h"
|
||||
#include "controller.h"
|
||||
#include "adbprocess.h"
|
||||
|
||||
ToolForm::ToolForm(QWidget* adsorbWidget, AdsorbPositions adsorbPos)
|
||||
: MagneticWidget(adsorbWidget, adsorbPos)
|
||||
|
@ -41,6 +42,7 @@ void ToolForm::initStyle()
|
|||
IconHelper::Instance()->SetIcon(ui->powerBtn, QChar(0xf011), 15);
|
||||
IconHelper::Instance()->SetIcon(ui->expandNotifyBtn, QChar(0xf103), 15);
|
||||
IconHelper::Instance()->SetIcon(ui->screenShotBtn, QChar(0xf0c4), 15);
|
||||
IconHelper::Instance()->SetIcon(ui->touchBtn, QChar(0xf111), 15);
|
||||
}
|
||||
|
||||
void ToolForm::mousePressEvent(QMouseEvent *event)
|
||||
|
@ -150,3 +152,25 @@ void ToolForm::on_expandNotifyBtn_clicked()
|
|||
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_touchBtn_clicked();
|
||||
|
||||
private:
|
||||
void initStyle();
|
||||
|
||||
|
@ -60,6 +62,7 @@ private:
|
|||
Ui::ToolForm *ui;
|
||||
QPoint m_dragPosition;
|
||||
QPointer<VideoForm> m_videoForm;
|
||||
bool m_showTouch = false;
|
||||
};
|
||||
|
||||
#endif // TOOLFORM_H
|
||||
|
|
|
@ -53,6 +53,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="touchBtn">
|
||||
<property name="toolTip">
|
||||
<string>touch switch</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="closeScreenBtn">
|
||||
<property name="toolTip">
|
||||
|
|
|
@ -247,6 +247,11 @@ void VideoForm::setSerial(const QString &serial)
|
|||
m_serial = serial;
|
||||
}
|
||||
|
||||
const QString &VideoForm::getSerial()
|
||||
{
|
||||
return m_serial;
|
||||
}
|
||||
|
||||
void VideoForm::setController(Controller *controller)
|
||||
{
|
||||
m_controller = controller;
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
Controller* getController();
|
||||
void setFileHandler(FileHandler *fileHandler);
|
||||
void setSerial(const QString &serial);
|
||||
const QString& getSerial();
|
||||
|
||||
signals:
|
||||
void screenshot();
|
||||
|
|
Binary file not shown.
|
@ -75,7 +75,7 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../dialog.ui" line="144"/>
|
||||
<location filename="../../dialog.cpp" line="294"/>
|
||||
<location filename="../../dialog.cpp" line="293"/>
|
||||
<source>select path</source>
|
||||
<translation>select path</translation>
|
||||
</message>
|
||||
|
@ -225,46 +225,51 @@
|
|||
</message>
|
||||
<message>
|
||||
<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>
|
||||
<translation>close screen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="69"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="79"/>
|
||||
<source>power</source>
|
||||
<translation>power</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="79"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="89"/>
|
||||
<source>volume up</source>
|
||||
<translation>volume up</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="89"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="99"/>
|
||||
<source>volume down</source>
|
||||
<translation>volume down</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="99"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="109"/>
|
||||
<source>app switch</source>
|
||||
<translation>app switch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="109"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="119"/>
|
||||
<source>menu</source>
|
||||
<translation>menu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="119"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="129"/>
|
||||
<source>home</source>
|
||||
<translation>home</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="129"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="139"/>
|
||||
<source>return</source>
|
||||
<translation>return</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="139"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="149"/>
|
||||
<source>screen shot</source>
|
||||
<translation>screen shot</translation>
|
||||
</message>
|
||||
|
@ -284,7 +289,7 @@
|
|||
<translation type="vanished">file transfer failed</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/videoform.cpp" line="408"/>
|
||||
<location filename="../../device/ui/videoform.cpp" line="413"/>
|
||||
<source>file does not exist</source>
|
||||
<translation>file does not exist</translation>
|
||||
</message>
|
||||
|
|
Binary file not shown.
|
@ -75,7 +75,7 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../dialog.ui" line="144"/>
|
||||
<location filename="../../dialog.cpp" line="294"/>
|
||||
<location filename="../../dialog.cpp" line="293"/>
|
||||
<source>select path</source>
|
||||
<translation>选择路径</translation>
|
||||
</message>
|
||||
|
@ -225,46 +225,51 @@
|
|||
</message>
|
||||
<message>
|
||||
<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>
|
||||
<translation>关闭屏幕</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="69"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="79"/>
|
||||
<source>power</source>
|
||||
<translation>电源</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="79"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="89"/>
|
||||
<source>volume up</source>
|
||||
<translation>音量加</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="89"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="99"/>
|
||||
<source>volume down</source>
|
||||
<translation>音量减</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="99"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="109"/>
|
||||
<source>app switch</source>
|
||||
<translation>切换应用</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="109"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="119"/>
|
||||
<source>menu</source>
|
||||
<translation>菜单</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="119"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="129"/>
|
||||
<source>home</source>
|
||||
<translation>主界面</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="129"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="139"/>
|
||||
<source>return</source>
|
||||
<translation>返回</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/toolform.ui" line="139"/>
|
||||
<location filename="../../device/ui/toolform.ui" line="149"/>
|
||||
<source>screen shot</source>
|
||||
<translation>截图</translation>
|
||||
</message>
|
||||
|
@ -284,7 +289,7 @@
|
|||
<translation type="vanished">文件传输失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../device/ui/videoform.cpp" line="408"/>
|
||||
<location filename="../../device/ui/videoform.cpp" line="413"/>
|
||||
<source>file does not exist</source>
|
||||
<translation>文件不存在</translation>
|
||||
</message>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
- 中文输入(server需要改为apk,作为一个输入法,暂不实现)(或者有其他方式案件注入方式,例如搜狗手机输入法可以监听当前注入?)
|
||||
- [单独线程统计帧率](https://github.com/Genymobile/scrcpy/commit/e2a272bf99ecf48fcb050177113f903b3fb323c4)
|
||||
- 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