Skip to content

Commit 0a98712

Browse files
authored
Merge pull request #1071 from barry-ran/dev
sync dev
2 parents ae1851a + 723b4ef commit 0a98712

17 files changed

+97
-55
lines changed

.github/workflows/macos.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
build:
1515
name: Build
16-
runs-on: macos-11
16+
runs-on: macos-14
1717
strategy:
1818
matrix:
1919
qt-ver: [5.15.2]
@@ -26,12 +26,12 @@ jobs:
2626
steps:
2727
- name: Cache Qt
2828
id: cache-qt
29-
uses: actions/cache@v1
29+
uses: actions/cache@v4
3030
with:
3131
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
3232
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }}
3333
- name: Install Qt
34-
uses: jurplel/install-qt-action@v2.13.0
34+
uses: jurplel/install-qt-action@v4.1.1
3535
with:
3636
version: ${{ matrix.qt-ver }}
3737
cached: ${{ steps.cache-qt.outputs.cache-hit }}
@@ -65,7 +65,7 @@ jobs:
6565
mv ci/build/QtScrcpy.app ci/build/${{ env.publish_name }}.app
6666
mv ci/build/QtScrcpy.dmg ci/build/${{ env.publish_name }}.dmg
6767
echo "::set-output name=package-name::${{ env.publish_name }}"
68-
- uses: actions/upload-artifact@v1
68+
- uses: actions/upload-artifact@v4
6969
with:
7070
name: ${{ steps.package.outputs.package-name }}.zip
7171
path: ci/build/${{ steps.package.outputs.package-name }}.dmg

.github/workflows/ubuntu.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
plantform-des: ubuntu
2828
steps:
2929
- name: Install Qt
30-
uses: jurplel/install-qt-action@v2.13.0
30+
uses: jurplel/install-qt-action@v4.1.1
3131
with:
3232
version: ${{ matrix.qt-ver }}
3333
cached: ${{ steps.cache-qt.outputs.cache-hit }}
3434
- name: Cache Qt
3535
id: cache-qt
36-
uses: actions/cache@v3.0.6
36+
uses: actions/cache@v4
3737
with:
3838
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
3939
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }}
@@ -50,7 +50,7 @@ jobs:
5050
run: |
5151
ci/linux/build_for_linux.sh "RelWithDebInfo"
5252
- name: Upload RelWithDebInfo
53-
uses: actions/upload-artifact@v3.1.0
53+
uses: actions/upload-artifact@v4
5454
with:
5555
name: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}-RelWithDebInfo
5656
path: output/x64/RelWithDebInfo/*
@@ -60,7 +60,7 @@ jobs:
6060
run: |
6161
ci/linux/build_for_linux.sh "Release"
6262
- name: Upload Release
63-
uses: actions/upload-artifact@v3.1.0
63+
uses: actions/upload-artifact@v4
6464
with:
6565
name: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}-Release
6666
path: output/x64/Release/*

.github/workflows/windows.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ jobs:
4747
steps:
4848
- name: Cache Qt
4949
id: cache-qt
50-
uses: actions/cache@v1
50+
uses: actions/cache@v4
5151
with:
5252
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
5353
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch }}
5454
# 安装Qt
5555
- name: Install Qt
5656
# 使用外部action。这个action专门用来安装Qt
57-
uses: jurplel/install-qt-action@v2.13.0
57+
uses: jurplel/install-qt-action@v4.1.1
5858
with:
5959
# Version of Qt to install
6060
version: ${{ matrix.qt-ver }}
@@ -100,7 +100,7 @@ jobs:
100100
echo "::set-output name=package-name::${{ env.publish_name }}"
101101
# 上传artifacts
102102
# https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts
103-
- uses: actions/upload-artifact@v1
103+
- uses: actions/upload-artifact@v4
104104
with:
105105
name: ${{ steps.package.outputs.package-name }}.zip
106106
path: ci\build\${{ steps.package.outputs.package-name }}

QtScrcpy/res/i18n/en_US.qm

71 Bytes
Binary file not shown.

QtScrcpy/res/i18n/en_US.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@
135135
<source>Start Config</source>
136136
<translation>Start Config</translation>
137137
</message>
138-
<message>
139-
<source>record save path:</source>
140-
<translation>record save path:</translation>
141-
</message>
142138
<message>
143139
<source>select path</source>
144140
<translation>select path</translation>
@@ -297,5 +293,13 @@
297293
<source>auto update</source>
298294
<translation>auto update</translation>
299295
</message>
296+
<message>
297+
<source>show toolbar</source>
298+
<translation>show toolbar</translation>
299+
</message>
300+
<message>
301+
<source>record save path:</source>
302+
<translation>record save path:</translation>
303+
</message>
300304
</context>
301305
</TS>

QtScrcpy/res/i18n/zh_CN.qm

55 Bytes
Binary file not shown.

QtScrcpy/res/i18n/zh_CN.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@
135135
<source>Start Config</source>
136136
<translation>启动配置</translation>
137137
</message>
138-
<message>
139-
<source>record save path:</source>
140-
<translation>录像保存路径:</translation>
141-
</message>
142138
<message>
143139
<source>select path</source>
144140
<translation>选择路径</translation>
@@ -297,5 +293,13 @@
297293
<source>auto update</source>
298294
<translation>自动刷新</translation>
299295
</message>
296+
<message>
297+
<source>show toolbar</source>
298+
<translation>显示工具栏</translation>
299+
</message>
300+
<message>
301+
<source>record save path:</source>
302+
<translation>录像保存路径</translation>
303+
</message>
300304
</context>
301305
</TS>

QtScrcpy/ui/dialog.cpp

+10-3
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ void Dialog::updateBootConfig(bool toView)
195195
ui->stayAwakeCheck->setChecked(config.keepAlive);
196196
ui->useSingleModeCheck->setChecked(config.simpleMode);
197197
ui->autoUpdatecheckBox->setChecked(config.autoUpdateDevice);
198+
ui->showToolbar->setChecked(config.showToolbar);
198199
} else {
199200
UserBootConfig config;
200201

@@ -213,6 +214,8 @@ void Dialog::updateBootConfig(bool toView)
213214
config.keepAlive = ui->stayAwakeCheck->isChecked();
214215
config.simpleMode = ui->useSingleModeCheck->isChecked();
215216
config.autoUpdateDevice = ui->autoUpdatecheckBox->isChecked();
217+
config.showToolbar = ui->showToolbar->isChecked();
218+
216219
Config::getInstance().setUserBootConfig(config);
217220
}
218221
}
@@ -308,7 +311,10 @@ void Dialog::on_startServerBtn_clicked()
308311
params.useReverse = ui->useReverseCheck->isChecked();
309312
params.display = !ui->notDisplayCheck->isChecked();
310313
params.renderExpiredFrames = Config::getInstance().getRenderExpiredFrames();
311-
params.lockVideoOrientation = ui->lockOrientationBox->currentIndex() - 1;
314+
if (ui->lockOrientationBox->currentIndex() > 0) {
315+
params.captureOrientationLock = 1;
316+
params.captureOrientation = (ui->lockOrientationBox->currentIndex() - 1) * 90;
317+
}
312318
params.stayAwake = ui->stayAwakeCheck->isChecked();
313319
params.recordFile = ui->recordScreenCheck->isChecked();
314320
params.recordPath = ui->recordPathEdt->text().trimmed();
@@ -447,14 +453,15 @@ void Dialog::onDeviceConnected(bool success, const QString &serial, const QStrin
447453
if (!success) {
448454
return;
449455
}
450-
451-
auto videoForm = new VideoForm(ui->framelessCheck->isChecked(), Config::getInstance().getSkin());
456+
auto videoForm = new VideoForm(ui->framelessCheck->isChecked(), Config::getInstance().getSkin(), ui->showToolbar->isChecked());
452457
videoForm->setSerial(serial);
453458

454459
qsc::IDeviceManage::getInstance().getDevice(serial)->setUserData(static_cast<void*>(videoForm));
455460
qsc::IDeviceManage::getInstance().getDevice(serial)->registerDeviceObserver(videoForm);
456461

462+
457463
videoForm->showFPS(ui->fpsCheck->isChecked());
464+
458465
if (ui->alwaysTopCheck->isChecked()) {
459466
videoForm->staysOnTop();
460467
}

QtScrcpy/ui/dialog.ui

+33-23
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>1293</width>
10-
<height>454</height>
10+
<height>502</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -255,7 +255,7 @@
255255
</sizepolicy>
256256
</property>
257257
<property name="focusPolicy">
258-
<enum>Qt::ClickFocus</enum>
258+
<enum>Qt::NoFocus</enum>
259259
</property>
260260
<property name="documentTitle">
261261
<string/>
@@ -626,29 +626,32 @@
626626
<property name="bottomMargin">
627627
<number>0</number>
628628
</property>
629-
<item row="1" column="1">
630-
<widget class="QCheckBox" name="closeScreenCheck">
629+
<item row="0" column="4">
630+
<widget class="QCheckBox" name="fpsCheck">
631631
<property name="sizePolicy">
632632
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
633633
<horstretch>0</horstretch>
634634
<verstretch>0</verstretch>
635635
</sizepolicy>
636636
</property>
637637
<property name="text">
638-
<string>screen-off</string>
638+
<string>show fps</string>
639639
</property>
640640
</widget>
641641
</item>
642-
<item row="1" column="3">
643-
<widget class="QCheckBox" name="framelessCheck">
642+
<item row="0" column="1">
643+
<widget class="QCheckBox" name="notDisplayCheck">
644644
<property name="sizePolicy">
645645
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
646646
<horstretch>0</horstretch>
647647
<verstretch>0</verstretch>
648648
</sizepolicy>
649649
</property>
650650
<property name="text">
651-
<string>frameless</string>
651+
<string>background record</string>
652+
</property>
653+
<property name="checkable">
654+
<bool>false</bool>
652655
</property>
653656
</widget>
654657
</item>
@@ -668,19 +671,16 @@
668671
</property>
669672
</widget>
670673
</item>
671-
<item row="0" column="1">
672-
<widget class="QCheckBox" name="notDisplayCheck">
674+
<item row="0" column="0">
675+
<widget class="QCheckBox" name="recordScreenCheck">
673676
<property name="sizePolicy">
674677
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
675678
<horstretch>0</horstretch>
676679
<verstretch>0</verstretch>
677680
</sizepolicy>
678681
</property>
679682
<property name="text">
680-
<string>background record</string>
681-
</property>
682-
<property name="checkable">
683-
<bool>false</bool>
683+
<string>record screen</string>
684684
</property>
685685
</widget>
686686
</item>
@@ -700,29 +700,29 @@
700700
</property>
701701
</widget>
702702
</item>
703-
<item row="0" column="0">
704-
<widget class="QCheckBox" name="recordScreenCheck">
703+
<item row="1" column="1">
704+
<widget class="QCheckBox" name="closeScreenCheck">
705705
<property name="sizePolicy">
706706
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
707707
<horstretch>0</horstretch>
708708
<verstretch>0</verstretch>
709709
</sizepolicy>
710710
</property>
711711
<property name="text">
712-
<string>record screen</string>
712+
<string>screen-off</string>
713713
</property>
714714
</widget>
715715
</item>
716-
<item row="0" column="4">
717-
<widget class="QCheckBox" name="fpsCheck">
716+
<item row="1" column="3">
717+
<widget class="QCheckBox" name="framelessCheck">
718718
<property name="sizePolicy">
719719
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
720720
<horstretch>0</horstretch>
721721
<verstretch>0</verstretch>
722722
</sizepolicy>
723723
</property>
724724
<property name="text">
725-
<string>show fps</string>
725+
<string>frameless</string>
726726
</property>
727727
</widget>
728728
</item>
@@ -739,6 +739,13 @@
739739
</property>
740740
</widget>
741741
</item>
742+
<item row="2" column="0">
743+
<widget class="QCheckBox" name="showToolbar">
744+
<property name="text">
745+
<string>show toolbar</string>
746+
</property>
747+
</widget>
748+
</item>
742749
</layout>
743750
</widget>
744751
</item>
@@ -1140,18 +1147,21 @@
11401147
<item>
11411148
<spacer name="verticalSpacer">
11421149
<property name="sizePolicy">
1143-
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1150+
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
11441151
<horstretch>0</horstretch>
11451152
<verstretch>0</verstretch>
11461153
</sizepolicy>
11471154
</property>
11481155
<property name="orientation">
11491156
<enum>Qt::Vertical</enum>
11501157
</property>
1158+
<property name="sizeType">
1159+
<enum>QSizePolicy::Expanding</enum>
1160+
</property>
11511161
<property name="sizeHint" stdset="0">
11521162
<size>
1153-
<width>20</width>
1154-
<height>40</height>
1163+
<width>40</width>
1164+
<height>20</height>
11551165
</size>
11561166
</property>
11571167
</spacer>

QtScrcpy/ui/videoform.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
#include "ui_videoform.h"
2222
#include "videoform.h"
2323

24-
VideoForm::VideoForm(bool framelessWindow, bool skin, QWidget *parent) : QWidget(parent), ui(new Ui::videoForm), m_skin(skin)
24+
VideoForm::VideoForm(bool framelessWindow, bool skin, bool showToolbar, QWidget *parent) : QWidget(parent), ui(new Ui::videoForm), m_skin(skin)
2525
{
2626
ui->setupUi(this);
2727
initUI();
2828
installShortcut();
2929
updateShowSize(size());
3030
bool vertical = size().height() > size().width();
31+
this->show_toolbar = showToolbar;
3132
if (m_skin) {
3233
updateStyleSheet(vertical);
3334
}
@@ -479,7 +480,7 @@ void VideoForm::switchFullScreen()
479480
if (m_skin) {
480481
updateStyleSheet(m_frameSize.height() > m_frameSize.width());
481482
}
482-
showToolForm(true);
483+
showToolForm(this->show_toolbar);
483484
#ifdef Q_OS_WIN32
484485
::SetThreadExecutionState(ES_CONTINUOUS);
485486
#endif
@@ -721,9 +722,9 @@ void VideoForm::paintEvent(QPaintEvent *paint)
721722
void VideoForm::showEvent(QShowEvent *event)
722723
{
723724
Q_UNUSED(event)
724-
if (!isFullScreen()) {
725+
if (!isFullScreen() && this->show_toolbar) {
725726
QTimer::singleShot(500, this, [this](){
726-
showToolForm();
727+
showToolForm(this->show_toolbar);
727728
});
728729
}
729730
}

0 commit comments

Comments
 (0)