Skip to content

Commit b8054be

Browse files
fix(shot): include sidebar in background clip region for blur effect
In recording/scrollshot modes, the background is only drawn within the toolbar clip area to avoid blocking mouse passthrough. When the AI assistant panel (sidebar) is shown, it falls outside the toolbar clip rect, so its blur backdrop has no background pixels to sample from. Extend the clip region to also cover the sidebar geometry when it is visible, using QRegion to combine both rects. bug: https://pms.uniontech.com/bug-view-356057.html
1 parent 634835b commit b8054be

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/main_window.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4802,12 +4802,20 @@ void MainWindow::paintEvent(QPaintEvent *event)
48024802
// 录屏/滚动截图模式:只在工具栏区域绘制背景
48034803
// 不全屏绘制,避免影响鼠标穿透
48044804
if (m_toolBar && m_toolBar->isVisible()) {
4805+
QRegion clipRegion;
48054806
QRect toolBarRect = m_toolBar->geometry();
48064807
toolBarRect.adjust(-20, -20, 20, 20);
4807-
4808+
clipRegion += toolBarRect;
4809+
// 二级工具栏(如AI助手面板)也需要背景模糊效果
4810+
if (m_sideBar && m_sideBar->isVisible()) {
4811+
QRect sideBarRect = m_sideBar->geometry();
4812+
sideBarRect.adjust(-20, -20, 20, 20);
4813+
clipRegion += sideBarRect;
4814+
}
4815+
48084816
painter.setRenderHint(QPainter::Antialiasing, true);
48094817
m_backgroundPixmap.setDevicePixelRatio(m_pixelRatio);
4810-
painter.setClipRect(toolBarRect);
4818+
painter.setClipRegion(clipRegion);
48114819
painter.drawPixmap(backgroundRect, m_backgroundPixmap);
48124820
painter.setClipping(false);
48134821
}

0 commit comments

Comments
 (0)