Skip to content

Commit 40ebad7

Browse files
committed
fix: [pin_screenshots] fix typo and handle window flags for save dialog
- Fix typo: '锁房比例' -> '缩放比例' in comment - Properly handle Qt::BypassWindowManagerHint when showing file save dialog - Remove BypassWindowManagerHint before showing dialog and restore after Closes: https://pms.uniontech.com/bug-view-336643.html
1 parent 91de0fb commit 40ebad7

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/pin_screenshots/mainwindow.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright (C) 2019 ~ 2019 Deepin Technology Co., Ltd.
2-
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
1+
// Copyright (C) 2019 ~ 2026 Deepin Technology Co., Ltd.
2+
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
33
//
44
// SPDX-License-Identifier: GPL-3.0-or-later
55

@@ -53,7 +53,7 @@ void MainWindow::initMainWindow()
5353
setMouseTracking(true);
5454
isLeftPressDown = false;
5555
dir = UP;
56-
//获取屏幕的锁房比例
56+
//获取屏幕的缩放比例
5757
m_pixelRatio = qApp->primaryScreen()->devicePixelRatio();
5858

5959
m_menuController = new MenuController();
@@ -168,6 +168,9 @@ void MainWindow::saveImg()
168168
} else if (m_saveInfo.first == SubToolWidget::FOLDER_CHANGE) {
169169
m_toolBar->setHiden();
170170
qDebug() << "保存到指定位置";
171+
Qt::WindowFlags flags = windowFlags();
172+
setWindowFlags(flags & ~Qt::BypassWindowManagerHint);
173+
show();
171174
QString saveFileName;
172175
QString imgName = Settings::instance()->getSavePath();
173176
if (!imgName.isEmpty()) {
@@ -186,6 +189,8 @@ void MainWindow::saveImg()
186189
saveFileName = QFileDialog::getSaveFileName(this, tr("Save"), imgName,
187190
tr("BMP (*.bmp);;JPEG (*.jpg *.jpeg);;PNG (*.png)"));
188191
}
192+
setWindowFlags(flags);
193+
show();
189194
if (saveFileName.isEmpty()) {
190195
qWarning() << "指定路径为空!";
191196
onExit();

0 commit comments

Comments
 (0)