mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 05:12:04 +08:00
fix: 修复下载按钮点击/双击/拖动时,主窗口动作与下载管理对话框动作同时触发问题
下载按钮未屏蔽双击事件,导致触发主窗口最大化动作,同时下载对话框显示在原始位置;拖动时触发下载对话框显示,移动时又隐藏下载对话框,造成闪烁现象;重复点击下载按钮,对话框闪烁 Log: 修改下载按钮和下载对话框焦点策略对象,保证对话框焦点状态与下载按钮同步;对话框显示操作移入下载按钮鼠标事件中处理,隐藏操作移入主窗口事件循环中判断,当主窗口/下载对话框均不是活动窗口时隐藏对话框 * 可能修复 ISSUE #I6FNOW,目前修改后,连续点击下载按钮,对话框将按顺序显示/隐藏
This commit is contained in:
@@ -51,9 +51,6 @@ Application::Application(int &argc, char **argv)
|
||||
// 获取版本特性信息
|
||||
m_featuresJsonObj = Utils::parseFeatureJsonFile();
|
||||
m_version = m_featuresJsonObj.value("version").toString(); // 获取版本号
|
||||
#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 4, 0))
|
||||
initFeatureDisplayDialog(); // 初始化版本特性对话框
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::handleAboutAction()
|
||||
@@ -64,9 +61,21 @@ void Application::handleAboutAction()
|
||||
}
|
||||
|
||||
initAboutDialog();
|
||||
#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 4, 0))
|
||||
initFeatureDisplayDialog(); // 初始化版本特性对话框
|
||||
#endif
|
||||
DApplication::handleAboutAction();
|
||||
}
|
||||
|
||||
bool Application::notify(QObject *receiver, QEvent *event)
|
||||
{
|
||||
if (m_mainWindow) {
|
||||
m_mainWindow->notify(receiver, event);
|
||||
}
|
||||
|
||||
return DApplication::notify(receiver, event);
|
||||
}
|
||||
|
||||
void Application::checkAppConfigLocation()
|
||||
{
|
||||
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation));
|
||||
@@ -99,6 +108,12 @@ void Application::setMainWindow(MainWindow *window)
|
||||
{
|
||||
initAboutDialog();
|
||||
}
|
||||
#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 4, 0))
|
||||
if (featureDisplayDialog() == nullptr || featureDisplayDialog()->parent() != m_mainWindow)
|
||||
{
|
||||
initFeatureDisplayDialog(); // 初始化版本特性对话框
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::initAboutDialog()
|
||||
@@ -134,11 +149,6 @@ void Application::initAboutDialog()
|
||||
connect(aboutDialog(), &DAboutDialog::destroyed, this, [=]() {
|
||||
setAboutDialog(nullptr);
|
||||
});
|
||||
#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 4, 0))
|
||||
connect(aboutDialog(), &DAboutDialog::featureActivated, this, [=]() {
|
||||
featureDisplayDialog()->show();
|
||||
});
|
||||
#endif
|
||||
|
||||
dialog->hide();
|
||||
}
|
||||
@@ -194,6 +204,11 @@ void Application::initFeatureDisplayDialog()
|
||||
connect(featureDisplayDialog(), &DFeatureDisplayDialog::destroyed, this, [=]() {
|
||||
setFeatureDisplayDialog(nullptr);
|
||||
});
|
||||
#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 4, 0))
|
||||
connect(aboutDialog(), &DAboutDialog::featureActivated, this, [=]() {
|
||||
featureDisplayDialog()->show();
|
||||
});
|
||||
#endif
|
||||
|
||||
dialog->hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user