diff --git a/0006-fix-loginfo-dialog-moveable.patch b/0006-fix-loginfo-dialog-moveable.patch new file mode 100644 index 0000000000000000000000000000000000000000..d52391f852730048074b6470801ed946e612f5ed --- /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 8ac92831c2491f1cbe711e6a93c9228323673ea8..4b7aff3e12905e9c68cf58ad57269b4b7c530bc2 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