From 09eb7b3e5746fa8a6c7784fe556d35b8df6489ac Mon Sep 17 00:00:00 2001 From: DuanRay Date: Wed, 18 Oct 2023 13:28:05 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=97=A0=E6=B3=95=E6=8B=96=E5=8A=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0006-fix-loginfo-dialog-moveable.patch | 61 ++++++++++++++++++++++++++ nfs-screen-recorder.spec | 7 ++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 0006-fix-loginfo-dialog-moveable.patch diff --git a/0006-fix-loginfo-dialog-moveable.patch b/0006-fix-loginfo-dialog-moveable.patch new file mode 100644 index 0000000..d52391f --- /dev/null +++ b/0006-fix-loginfo-dialog-moveable.patch @@ -0,0 +1,61 @@ +diff --git a/nfs-screen-recorder-0.4.2/src/page/LogInfo.cpp b/nfs-screen-recorder-0.4.2/src/page/LogInfo.cpp +index 654580d..5da4ed2 100644 +--- a/nfs-screen-recorder-0.4.2/src/page/LogInfo.cpp ++++ b/nfs-screen-recorder-0.4.2/src/page/LogInfo.cpp +@@ -13,6 +13,9 @@ LogInfo::LogInfo(QWidget *parent) : + Logger::LogInfo("log"); + //日志功能集成 + connect(Logger::GetInstance(),SIGNAL(NewLine(Logger::enum_type,QString)),this,SLOT(OnNewLogLine(Logger::enum_type,QString)),Qt::QueuedConnection); ++ ++ ui->label->installEventFilter(this); ++ m_pressed = false; + } + + LogInfo::~LogInfo() +@@ -20,6 +23,26 @@ LogInfo::~LogInfo() + delete ui; + } + ++bool LogInfo::eventFilter(QObject *o, QEvent *e) ++{ ++ if(o == ui->label) ++ { ++ 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 LogInfo::OnNewLogLine(Logger::enum_type type, QString string) { + //Logger::LogInfo("OnNewLogLine"); + //Logger::LogInfo(string); +diff --git a/nfs-screen-recorder-0.4.2/src/page/LogInfo.h b/nfs-screen-recorder-0.4.2/src/page/LogInfo.h +index c02a29d..7c70643 100644 +--- a/nfs-screen-recorder-0.4.2/src/page/LogInfo.h ++++ b/nfs-screen-recorder-0.4.2/src/page/LogInfo.h +@@ -15,10 +15,15 @@ class LogInfo : public QDialog + public: + explicit LogInfo(QWidget *parent = 0); + ~LogInfo(); ++protected: ++ bool eventFilter(QObject *o, QEvent *e); + + private: + Ui::LogInfo *ui; + ++ QPoint m_movePos; ++ bool m_pressed; ++ + private slots: + void OnNewLogLine(Logger::enum_type type, QString string); + }; diff --git a/nfs-screen-recorder.spec b/nfs-screen-recorder.spec index 8ac9283..4b7aff3 100644 --- a/nfs-screen-recorder.spec +++ b/nfs-screen-recorder.spec @@ -5,7 +5,7 @@ Name: nfs-screen-recorder Version: 0.4.2 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv3+ Summary: Powerful yet simple to use screenshot software Source0: %{name}-%{version}.tar.gz @@ -14,6 +14,7 @@ Patch1: 0002-hide-maxBtn.patch 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 BuildRequires: cmake >= 3.13.0 BuildRequires: gcc-c++ >= 7 @@ -117,5 +118,9 @@ make %changelog + +* Wed Oct 18 2023 ruizhe - 0.4.2-7 +- Fix fix loginfo dialog cannot move + * Wed Oct 18 2023 ruizhe - 0.4.2-6 - fix about dialog moveable -- Gitee