diff --git a/QtScrcpy/res/i18n/en_US.qm b/QtScrcpy/res/i18n/en_US.qm
index b73a839..a8f465e 100644
Binary files a/QtScrcpy/res/i18n/en_US.qm and b/QtScrcpy/res/i18n/en_US.qm differ
diff --git a/QtScrcpy/res/i18n/en_US.ts b/QtScrcpy/res/i18n/en_US.ts
index 5a5dcdd..793171b 100644
--- a/QtScrcpy/res/i18n/en_US.ts
+++ b/QtScrcpy/res/i18n/en_US.ts
@@ -135,10 +135,6 @@
Start Config
Start Config
-
- record save path:
- record save path:
-
select path
select path
@@ -297,5 +293,13 @@
auto update
auto update
+
+ show toolbar
+ show toolbar
+
+
+ record save path:
+ record save path:
+
diff --git a/QtScrcpy/res/i18n/zh_CN.qm b/QtScrcpy/res/i18n/zh_CN.qm
index 3664aea..4794f80 100644
Binary files a/QtScrcpy/res/i18n/zh_CN.qm and b/QtScrcpy/res/i18n/zh_CN.qm differ
diff --git a/QtScrcpy/res/i18n/zh_CN.ts b/QtScrcpy/res/i18n/zh_CN.ts
index 6a71c1b..4cd66c4 100644
--- a/QtScrcpy/res/i18n/zh_CN.ts
+++ b/QtScrcpy/res/i18n/zh_CN.ts
@@ -135,10 +135,6 @@
Start Config
启动配置
-
- record save path:
- 录像保存路径:
-
select path
选择路径
@@ -297,5 +293,13 @@
auto update
自动刷新
+
+ show toolbar
+ 显示工具栏
+
+
+ record save path:
+ 录像保存路径
+
diff --git a/QtScrcpy/ui/dialog.cpp b/QtScrcpy/ui/dialog.cpp
index 756837b..dfedcfb 100644
--- a/QtScrcpy/ui/dialog.cpp
+++ b/QtScrcpy/ui/dialog.cpp
@@ -195,6 +195,7 @@ void Dialog::updateBootConfig(bool toView)
ui->stayAwakeCheck->setChecked(config.keepAlive);
ui->useSingleModeCheck->setChecked(config.simpleMode);
ui->autoUpdatecheckBox->setChecked(config.autoUpdateDevice);
+ ui->showToolbar->setChecked(config.showToolbar);
} else {
UserBootConfig config;
@@ -213,6 +214,8 @@ void Dialog::updateBootConfig(bool toView)
config.keepAlive = ui->stayAwakeCheck->isChecked();
config.simpleMode = ui->useSingleModeCheck->isChecked();
config.autoUpdateDevice = ui->autoUpdatecheckBox->isChecked();
+ config.showToolbar = ui->showToolbar->isChecked();
+
Config::getInstance().setUserBootConfig(config);
}
}
@@ -447,14 +450,15 @@ void Dialog::onDeviceConnected(bool success, const QString &serial, const QStrin
if (!success) {
return;
}
-
- auto videoForm = new VideoForm(ui->framelessCheck->isChecked(), Config::getInstance().getSkin());
+ auto videoForm = new VideoForm(ui->framelessCheck->isChecked(), Config::getInstance().getSkin(), ui->showToolbar->isChecked());
videoForm->setSerial(serial);
qsc::IDeviceManage::getInstance().getDevice(serial)->setUserData(static_cast(videoForm));
qsc::IDeviceManage::getInstance().getDevice(serial)->registerDeviceObserver(videoForm);
+
videoForm->showFPS(ui->fpsCheck->isChecked());
+
if (ui->alwaysTopCheck->isChecked()) {
videoForm->staysOnTop();
}
diff --git a/QtScrcpy/ui/dialog.ui b/QtScrcpy/ui/dialog.ui
index 81860e6..630c0de 100644
--- a/QtScrcpy/ui/dialog.ui
+++ b/QtScrcpy/ui/dialog.ui
@@ -7,7 +7,7 @@
0
0
1293
- 454
+ 502
@@ -255,7 +255,7 @@
- Qt::ClickFocus
+ Qt::FocusPolicy::ClickFocus
@@ -626,6 +626,80 @@
0
+ -
+
+
+
+ 0
+ 0
+
+
+
+ show fps
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ background record
+
+
+ false
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ always on top
+
+
+ false
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ record screen
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ reverse connection
+
+
+ true
+
+
+
-
@@ -652,80 +726,6 @@
- -
-
-
-
- 0
- 0
-
-
-
- always on top
-
-
- false
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- background record
-
-
- false
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- reverse connection
-
-
- true
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- record screen
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- show fps
-
-
-
-
@@ -739,6 +739,13 @@
+ -
+
+
+ show toolbar
+
+
+
@@ -1146,7 +1153,7 @@
- Qt::Vertical
+ Qt::Orientation::Vertical
diff --git a/QtScrcpy/ui/videoform.cpp b/QtScrcpy/ui/videoform.cpp
index bbed173..d5b43b0 100644
--- a/QtScrcpy/ui/videoform.cpp
+++ b/QtScrcpy/ui/videoform.cpp
@@ -21,13 +21,14 @@
#include "ui_videoform.h"
#include "videoform.h"
-VideoForm::VideoForm(bool framelessWindow, bool skin, QWidget *parent) : QWidget(parent), ui(new Ui::videoForm), m_skin(skin)
+VideoForm::VideoForm(bool framelessWindow, bool skin, bool showToolbar,QWidget *parent) : QWidget(parent), ui(new Ui::videoForm), m_skin(skin)
{
ui->setupUi(this);
initUI();
installShortcut();
updateShowSize(size());
bool vertical = size().height() > size().width();
+ this->show_toolbar = showToolbar;
if (m_skin) {
updateStyleSheet(vertical);
}
@@ -723,7 +724,7 @@ void VideoForm::showEvent(QShowEvent *event)
Q_UNUSED(event)
if (!isFullScreen()) {
QTimer::singleShot(500, this, [this](){
- showToolForm();
+ showToolForm(this->show_toolbar);
});
}
}
diff --git a/QtScrcpy/ui/videoform.h b/QtScrcpy/ui/videoform.h
index acda4e6..08d73d8 100644
--- a/QtScrcpy/ui/videoform.h
+++ b/QtScrcpy/ui/videoform.h
@@ -19,7 +19,7 @@ class VideoForm : public QWidget, public qsc::DeviceObserver
{
Q_OBJECT
public:
- explicit VideoForm(bool framelessWindow = false, bool skin = true, QWidget *parent = 0);
+ explicit VideoForm(bool framelessWindow = false, bool skin = true, bool showToolBar = false,QWidget *parent = 0);
~VideoForm();
void staysOnTop(bool top = true);
@@ -32,7 +32,6 @@ public:
void removeBlackRect();
void showFPS(bool show);
void switchFullScreen();
-
bool isHost();
private:
@@ -85,6 +84,9 @@ private:
bool m_skin = true;
QPoint m_fullScreenBeforePos;
QString m_serial;
+
+ //Whether to display the toolbar when connecting a device.
+ bool show_toolbar = true;
};
#endif // VIDEOFORM_H
diff --git a/QtScrcpy/util/config.cpp b/QtScrcpy/util/config.cpp
index b75f0f7..6885324 100644
--- a/QtScrcpy/util/config.cpp
+++ b/QtScrcpy/util/config.cpp
@@ -96,6 +96,9 @@
#define COMMON_TRAY_MESSAGE_SHOWN_KEY "TrayMessageShown"
#define COMMON_TRAY_MESSAGE_SHOWN_DEF false
+#define COMMON_SHOW_TOOLBAR_KEY "showToolbar"
+#define COMMON_SHOW_TOOLBAR_DEF true
+
// device config
#define SERIAL_WINDOW_RECT_KEY_X "WindowRectX"
#define SERIAL_WINDOW_RECT_KEY_Y "WindowRectY"
@@ -163,6 +166,7 @@ void Config::setUserBootConfig(const UserBootConfig &config)
m_userData->setValue(COMMON_KEEP_ALIVE_KEY, config.keepAlive);
m_userData->setValue(COMMON_SIMPLE_MODE_KEY, config.simpleMode);
m_userData->setValue(COMMON_AUTO_UPDATE_DEVICE_KEY, config.autoUpdateDevice);
+ m_userData->setValue(COMMON_SHOW_TOOLBAR_KEY,config.showToolbar);
m_userData->endGroup();
m_userData->sync();
}
@@ -186,6 +190,7 @@ UserBootConfig Config::getUserBootConfig()
config.keepAlive = m_userData->value(COMMON_KEEP_ALIVE_KEY, COMMON_KEEP_ALIVE_DEF).toBool();
config.simpleMode = m_userData->value(COMMON_SIMPLE_MODE_KEY, COMMON_SIMPLE_MODE_DEF).toBool();
config.autoUpdateDevice = m_userData->value(COMMON_AUTO_UPDATE_DEVICE_KEY, COMMON_AUTO_UPDATE_DEVICE_DEF).toBool();
+ config.showToolbar =m_userData->value(COMMON_SHOW_TOOLBAR_KEY,COMMON_SHOW_TOOLBAR_DEF).toBool();
m_userData->endGroup();
return config;
}
diff --git a/QtScrcpy/util/config.h b/QtScrcpy/util/config.h
index 1f55126..6f3c1d9 100644
--- a/QtScrcpy/util/config.h
+++ b/QtScrcpy/util/config.h
@@ -22,6 +22,7 @@ struct UserBootConfig
bool keepAlive = false;
bool simpleMode = false;
bool autoUpdateDevice = true;
+ bool showToolbar = true;
};
class QSettings;