Skip to content

Commit

Permalink
Merge pull request #1071 from barry-ran/dev
Browse files Browse the repository at this point in the history
sync dev
  • Loading branch information
barry-ran authored Dec 6, 2024
2 parents ae1851a + 723b4ef commit 0a98712
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 55 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
build:
name: Build
runs-on: macos-11
runs-on: macos-14
strategy:
matrix:
qt-ver: [5.15.2]
Expand All @@ -26,12 +26,12 @@ jobs:
steps:
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }}
- name: Install Qt
uses: jurplel/install-qt-action@v2.13.0
uses: jurplel/install-qt-action@v4.1.1
with:
version: ${{ matrix.qt-ver }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
mv ci/build/QtScrcpy.app ci/build/${{ env.publish_name }}.app
mv ci/build/QtScrcpy.dmg ci/build/${{ env.publish_name }}.dmg
echo "::set-output name=package-name::${{ env.publish_name }}"
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.package.outputs.package-name }}.zip
path: ci/build/${{ steps.package.outputs.package-name }}.dmg
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
plantform-des: ubuntu
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v2.13.0
uses: jurplel/install-qt-action@v4.1.1
with:
version: ${{ matrix.qt-ver }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Cache Qt
id: cache-qt
uses: actions/cache@v3.0.6
uses: actions/cache@v4
with:
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }}
Expand All @@ -50,7 +50,7 @@ jobs:
run: |
ci/linux/build_for_linux.sh "RelWithDebInfo"
- name: Upload RelWithDebInfo
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}-RelWithDebInfo
path: output/x64/RelWithDebInfo/*
Expand All @@ -60,7 +60,7 @@ jobs:
run: |
ci/linux/build_for_linux.sh "Release"
- name: Upload Release
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}-Release
path: output/x64/Release/*
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ jobs:
steps:
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch }}
# 安装Qt
- name: Install Qt
# 使用外部action。这个action专门用来安装Qt
uses: jurplel/install-qt-action@v2.13.0
uses: jurplel/install-qt-action@v4.1.1
with:
# Version of Qt to install
version: ${{ matrix.qt-ver }}
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
echo "::set-output name=package-name::${{ env.publish_name }}"
# 上传artifacts
# https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.package.outputs.package-name }}.zip
path: ci\build\${{ steps.package.outputs.package-name }}
Expand Down
Binary file modified QtScrcpy/res/i18n/en_US.qm
Binary file not shown.
12 changes: 8 additions & 4 deletions QtScrcpy/res/i18n/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@
<source>Start Config</source>
<translation>Start Config</translation>
</message>
<message>
<source>record save path:</source>
<translation>record save path:</translation>
</message>
<message>
<source>select path</source>
<translation>select path</translation>
Expand Down Expand Up @@ -297,5 +293,13 @@
<source>auto update</source>
<translation>auto update</translation>
</message>
<message>
<source>show toolbar</source>
<translation>show toolbar</translation>
</message>
<message>
<source>record save path:</source>
<translation>record save path:</translation>
</message>
</context>
</TS>
Binary file modified QtScrcpy/res/i18n/zh_CN.qm
Binary file not shown.
12 changes: 8 additions & 4 deletions QtScrcpy/res/i18n/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@
<source>Start Config</source>
<translation>启动配置</translation>
</message>
<message>
<source>record save path:</source>
<translation>录像保存路径:</translation>
</message>
<message>
<source>select path</source>
<translation>选择路径</translation>
Expand Down Expand Up @@ -297,5 +293,13 @@
<source>auto update</source>
<translation>自动刷新</translation>
</message>
<message>
<source>show toolbar</source>
<translation>显示工具栏</translation>
</message>
<message>
<source>record save path:</source>
<translation>录像保存路径</translation>
</message>
</context>
</TS>
13 changes: 10 additions & 3 deletions QtScrcpy/ui/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}
Expand Down Expand Up @@ -308,7 +311,10 @@ void Dialog::on_startServerBtn_clicked()
params.useReverse = ui->useReverseCheck->isChecked();
params.display = !ui->notDisplayCheck->isChecked();
params.renderExpiredFrames = Config::getInstance().getRenderExpiredFrames();
params.lockVideoOrientation = ui->lockOrientationBox->currentIndex() - 1;
if (ui->lockOrientationBox->currentIndex() > 0) {
params.captureOrientationLock = 1;
params.captureOrientation = (ui->lockOrientationBox->currentIndex() - 1) * 90;
}
params.stayAwake = ui->stayAwakeCheck->isChecked();
params.recordFile = ui->recordScreenCheck->isChecked();
params.recordPath = ui->recordPathEdt->text().trimmed();
Expand Down Expand Up @@ -447,14 +453,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<void*>(videoForm));
qsc::IDeviceManage::getInstance().getDevice(serial)->registerDeviceObserver(videoForm);


videoForm->showFPS(ui->fpsCheck->isChecked());

if (ui->alwaysTopCheck->isChecked()) {
videoForm->staysOnTop();
}
Expand Down
56 changes: 33 additions & 23 deletions QtScrcpy/ui/dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1293</width>
<height>454</height>
<height>502</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -255,7 +255,7 @@
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
<enum>Qt::NoFocus</enum>
</property>
<property name="documentTitle">
<string/>
Expand Down Expand Up @@ -626,29 +626,32 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="1" column="1">
<widget class="QCheckBox" name="closeScreenCheck">
<item row="0" column="4">
<widget class="QCheckBox" name="fpsCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>screen-off</string>
<string>show fps</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="framelessCheck">
<item row="0" column="1">
<widget class="QCheckBox" name="notDisplayCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>frameless</string>
<string>background record</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
Expand All @@ -668,19 +671,16 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="notDisplayCheck">
<item row="0" column="0">
<widget class="QCheckBox" name="recordScreenCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>background record</string>
</property>
<property name="checkable">
<bool>false</bool>
<string>record screen</string>
</property>
</widget>
</item>
Expand All @@ -700,29 +700,29 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="recordScreenCheck">
<item row="1" column="1">
<widget class="QCheckBox" name="closeScreenCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>record screen</string>
<string>screen-off</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QCheckBox" name="fpsCheck">
<item row="1" column="3">
<widget class="QCheckBox" name="framelessCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>show fps</string>
<string>frameless</string>
</property>
</widget>
</item>
Expand All @@ -739,6 +739,13 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="showToolbar">
<property name="text">
<string>show toolbar</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -1140,18 +1147,21 @@
<item>
<spacer name="verticalSpacer">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
Expand Down
9 changes: 5 additions & 4 deletions QtScrcpy/ui/videoform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -479,7 +480,7 @@ void VideoForm::switchFullScreen()
if (m_skin) {
updateStyleSheet(m_frameSize.height() > m_frameSize.width());
}
showToolForm(true);
showToolForm(this->show_toolbar);
#ifdef Q_OS_WIN32
::SetThreadExecutionState(ES_CONTINUOUS);
#endif
Expand Down Expand Up @@ -721,9 +722,9 @@ void VideoForm::paintEvent(QPaintEvent *paint)
void VideoForm::showEvent(QShowEvent *event)
{
Q_UNUSED(event)
if (!isFullScreen()) {
if (!isFullScreen() && this->show_toolbar) {
QTimer::singleShot(500, this, [this](){
showToolForm();
showToolForm(this->show_toolbar);
});
}
}
Expand Down
Loading

0 comments on commit 0a98712

Please sign in to comment.