From fd1d8157eda21e51bc5b679bbf018352c0d43d13 Mon Sep 17 00:00:00 2001 From: DuanRay Date: Wed, 18 Oct 2023 14:40:53 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=AA=97=E4=BD=93=E7=A7=BB=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0007-fix-setting-dialog-moveable.patch | 59 ++++++++++++++++++++++++++ nfs-screen-recorder.spec | 6 ++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 0007-fix-setting-dialog-moveable.patch diff --git a/0007-fix-setting-dialog-moveable.patch b/0007-fix-setting-dialog-moveable.patch new file mode 100644 index 0000000..e24470a --- /dev/null +++ b/0007-fix-setting-dialog-moveable.patch @@ -0,0 +1,59 @@ +diff --git a/nfs-screen-recorder-0.4.2/src/page/SettingMenu.cpp b/nfs-screen-recorder-0.4.2/src/page/SettingMenu.cpp +index 8781ec3..b9e4b21 100644 +--- a/nfs-screen-recorder-0.4.2/src/page/SettingMenu.cpp ++++ b/nfs-screen-recorder-0.4.2/src/page/SettingMenu.cpp +@@ -204,7 +204,8 @@ SettingMenu::SettingMenu(MainPage *parent) : + + //通用配置信号槽函数 + // m_main_window = new MainPage(this); +- ++ this->installEventFilter(this); ++ m_pressed = false; + } + + +@@ -582,6 +583,26 @@ int SettingMenu::GetAudioCodecIndex() { + return audioindex; + } + ++bool SettingMenu::eventFilter(QObject *o, QEvent *e) ++{ ++ if(o == this) ++ { ++ QMouseEvent *mEvent = (QMouseEvent *)e; ++ if(e->type() == QEvent::MouseButtonPress) ++ { ++ m_pressed = true; ++ m_movePos = mEvent->globalPos(); ++ } ++ else if((e->type() == QEvent::MouseMove) && m_pressed) ++ { ++ QPoint offset = mEvent->globalPos() - m_movePos; ++ move(this->x() + offset.x(), this->y() + offset.y()); ++ m_movePos = mEvent->globalPos(); ++ } ++ } ++ ++} ++ + //void SettingMenu::UpdateSysTray() { + // if(m_systray_icon == NULL) + // return; +diff --git a/nfs-screen-recorder-0.4.2/src/page/SettingMenu.h b/nfs-screen-recorder-0.4.2/src/page/SettingMenu.h +index f297947..335123f 100644 +--- a/nfs-screen-recorder-0.4.2/src/page/SettingMenu.h ++++ b/nfs-screen-recorder-0.4.2/src/page/SettingMenu.h +@@ -147,6 +147,13 @@ public: + HotkeyCallback m_hotkey_start_pause; + int GetVideoCodecIndex(); + int GetAudioCodecIndex(); ++ ++protected: ++ bool eventFilter(QObject *o, QEvent *e); ++private: ++ QPoint m_movePos; ++ bool m_pressed; ++ + private: + MainPage *m_main_window; + static void LoadProfileSettingsCallback(QSettings* settings, void* userdata); diff --git a/nfs-screen-recorder.spec b/nfs-screen-recorder.spec index 4b7aff3..ac2d1d1 100644 --- a/nfs-screen-recorder.spec +++ b/nfs-screen-recorder.spec @@ -5,7 +5,7 @@ Name: nfs-screen-recorder Version: 0.4.2 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv3+ Summary: Powerful yet simple to use screenshot software Source0: %{name}-%{version}.tar.gz @@ -15,6 +15,7 @@ Patch2: 0003-shift-app-name-via-system-language.patch Patch3: 0004-update-readme.patch Patch4: 0005-fix-about-dialog-moveable.patch Patch5: 0006-fix-loginfo-dialog-moveable.patch +Patch6: 0007-fix-setting-dialog-moveable.patch BuildRequires: cmake >= 3.13.0 BuildRequires: gcc-c++ >= 7 @@ -119,6 +120,9 @@ make %changelog +* Wed Oct 18 2023 ruizhe - 0.4.2-8 +- Fix fix about dialog cannot move + * Wed Oct 18 2023 ruizhe - 0.4.2-7 - Fix fix loginfo dialog cannot move -- Gitee