Skip to content

fix(ui): fix frozen separator lines in filter thumbnail column - #517

Merged
lzwind merged 1 commit into
linuxdeepin:masterfrom
F-windy:fix/filter-preview-transparent-gap
Aug 17, 2026
Merged

fix(ui): fix frozen separator lines in filter thumbnail column#517
lzwind merged 1 commit into
linuxdeepin:masterfrom
F-windy:fix/filter-preview-transparent-gap

Conversation

@F-windy

@F-windy F-windy commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
  1. Set WA_TranslucentBackground on filterPreviewButton and disable autoFillBackground so the 5px margin blends with the video layer
  2. Propagate transparency through this, m_scrollArea, viewport and m_scrollAreaWidget in initButtons to reach the video render layer
  3. Call m_scrollAreaWidget->update() per frame in onUpdateFilterImage to re-composite the transparent layer over the latest video frame

Log: Fix frozen separator lines/bands between filter thumbnails by completing the transparency chain to the video layer and re-compositing per frame Influence: Eliminates frozen separator lines without adding background

fix(ui): 修复滤镜缩略图列冻结分割线/边带

  1. 滤镜按钮设 WA_TranslucentBackground 并关闭 autoFillBackground, 使 5px 边距透出视频
  2. initButtons 中沿 this、m_scrollArea、viewport、m_scrollAreaWidget 整链设透明并关自动填充,贯通到视频渲染层
  3. onUpdateFilterImage 每帧主动 update m_scrollAreaWidget,在最新 视频帧上重新合成透明层,消除冻结分割线

Log: 贯通透明链到视频层并每帧重合成,修复滤镜缩略图间冻结分割线
PMS: BUG-169219
Influence: 消除冻结分割线且不引入底色

Summary by Sourcery

Resolve visual freezing of separator lines between filter thumbnails by making the thumbnail column truly transparent over the video and re-compositing it every frame.

Bug Fixes:

  • Eliminate frozen separator lines/bands between filter thumbnails in the take photo settings UI.

Enhancements:

  • Ensure the filter thumbnail scroll area and its children use a fully transparent background chain down to the video render layer.
  • Make filter preview buttons treat their margin area as transparent so underlying video shows through consistently.

1. Set WA_TranslucentBackground on filterPreviewButton and disable
   autoFillBackground so the 5px margin blends with the video layer
2. Propagate transparency through this, m_scrollArea, viewport and
   m_scrollAreaWidget in initButtons to reach the video render layer
3. Call m_scrollAreaWidget->update() per frame in onUpdateFilterImage
   to re-composite the transparent layer over the latest video frame

Log: Fix frozen separator lines/bands between filter thumbnails by
completing the transparency chain to the video layer and re-compositing per frame
Influence: Eliminates frozen separator lines without adding background

fix(ui): 修复滤镜缩略图列冻结分割线/边带

1. 滤镜按钮设 WA_TranslucentBackground 并关闭 autoFillBackground,
   使 5px 边距透出视频
2. initButtons 中沿 this、m_scrollArea、viewport、m_scrollAreaWidget
   整链设透明并关自动填充,贯通到视频渲染层
3. onUpdateFilterImage 每帧主动 update m_scrollAreaWidget,在最新
   视频帧上重新合成透明层,消除冻结分割线

Log: 贯通透明链到视频层并每帧重合成,修复滤镜缩略图间冻结分割线
PMS: BUG-169219
Influence: 消除冻结分割线且不引入底色

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @F-windy, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

Makes the filter thumbnail column truly transparent all the way to the video layer and forces it to re-composite each frame, eliminating frozen separator lines between thumbnails without introducing a background color.

Sequence diagram for per-frame recompositing of transparent filter thumbnails

sequenceDiagram
    participant VideoRenderer
    participant takePhotoSettingAreaWidget
    participant m_scrollArea
    participant m_scrollAreaWidget
    participant filterPreviewButton

    VideoRenderer->>takePhotoSettingAreaWidget: onUpdateFilterImage(QImage *img)
    takePhotoSettingAreaWidget->>filterPreviewButton: setImage(QImage *tmp)
    takePhotoSettingAreaWidget->>m_scrollArea: isVisible()
    alt [m_scrollArea is visible]
        takePhotoSettingAreaWidget->>m_scrollAreaWidget: update()
        m_scrollAreaWidget->>VideoRenderer: recompose transparent filter column over latest frame
    end
Loading

File-Level Changes

Change Details Files
Ensure the filter thumbnail column and scroll area chain are fully transparent so gaps and margins show the live video instead of a frozen background.
  • Set the main takePhotoSettingAreaWidget to use WA_TranslucentBackground so its background is transparent over the video layer.
  • Configured m_scrollArea and its viewport with WA_TranslucentBackground and disabled autoFillBackground to avoid painting an opaque palette-based background.
  • Kept m_scrollAreaWidget transparent and attached it to the scroll area, ensuring the entire widget chain from the filter panel to the video is translucent.
src/src/takephotosettingareawidget.cpp
Re-composite the transparent filter column over the video on every frame so separator gaps update with the video instead of staying stuck on the first frame.
  • In onUpdateFilterImage, after updating all filter preview buttons, call update() on m_scrollAreaWidget when the scroll area is visible.
  • Documented in comments how Qt’s compositing across sibling subtrees causes the transparent gaps to otherwise freeze on the first frame, and why per-frame updates are necessary.
src/src/takephotosettingareawidget.cpp
Make individual filter preview buttons themselves transparent so their margins correctly reveal the video beneath.
  • In filterPreviewButton’s constructor, enabled WA_TranslucentBackground and disabled autoFillBackground to treat the button as translucent.
  • Documented in comments that only the central image and border are painted and that margins must remain transparent to avoid frozen edge bands.
src/src/filterpreviewbutton.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码精准修复了Qt跨子树透明合成导致的视频冻结伪影问题,逻辑严密且无副作用
注释详尽透彻,完全符合规范且无性能与安全问题,满分通过

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

代码在filterpreviewbutton.cpp构造函数和takephotosettingareawidget.cpp的initButtons()中正确打通了从顶层控件到viewport的WA_TranslucentBackground透明链,并在onUpdateFilterImage()中准确捕捉到Qt不会自动跨兄弟子树重新混合透明区域的机制缺陷,通过主动调用update()触发重绘,逻辑闭环完美,无任何语法或逻辑错误
建议:保持现有逻辑即可

  • 2.代码质量(优秀)✓

注释质量极高,不仅说明了“做了什么”,更深入剖析了“为什么这样做”,包括详细解释了Wayland与X11渲染路径差异、Qt默认viewport不透明填充机制、以及首帧残留的形成原理,对后续维护者极其友好,完全符合高标准的代码规范
建议:保持现有注释风格

  • 3.代码性能(高效)✓

在视频帧回调onUpdateFilterImage()中追加的update()调用仅标记重绘脏区域,不涉及昂贵的像素拷贝或阻塞渲染,且仅当m_scrollArea可见时才触发,开销几乎可以忽略不计,是解决此类Qt合成问题的标准且唯一的正确做法
建议:无需优化

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改纯粹涉及Qt图形视图框架的UI渲染属性设置与重绘控制,不包含任何网络通信、文件IO、命令执行、用户输入解析或权限提升相关逻辑,攻击面为零
建议:无需额外安全措施

■ 【改进建议代码示例】

// 当前代码已为最优解,无需修改,此处展示其核心逻辑的精简等效形式以供参考
// filterpreviewbutton.cpp
filterPreviewButton::filterPreviewButton(QWidget *parent, efilterType filter) :
    QPushButton(parent), m_filter(filter)
{
    m_disableSelect = false;
    setWindowOpacity(0.1);
    setAttribute(Qt::WA_TranslucentBackground, true);
    setAutoFillBackground(false);
    resize(BUTTON_SIZE, BUTTON_SIZE);
}

// takephotosettingareawidget.cpp
void takePhotoSettingAreaWidget::initButtons()
{
    // ...前置代码...
    setAttribute(Qt::WA_TranslucentBackground, true);
    m_scrollAreaWidget = new QWidget(this);
    m_scrollAreaWidget->setAttribute(Qt::WA_TranslucentBackground, true);
    // ...布局代码...
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setFrameShape(QFrame::NoFrame);
    m_scrollArea->setAttribute(Qt::WA_TranslucentBackground, true);
    m_scrollArea->setAutoFillBackground(false);
    m_scrollArea->setWidget(m_scrollAreaWidget);
    m_scrollArea->viewport()->setAutoFillBackground(false);
    m_scrollArea->viewport()->setAttribute(Qt::WA_TranslucentBackground, true);
    // ...后续代码...
}

void takePhotoSettingAreaWidget::onUpdateFilterImage(QImage *img)
{
    // ...缩略图更新逻辑...
    if (m_scrollArea && m_scrollArea->isVisible()) {
        m_scrollAreaWidget->update();
    }
}

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: F-windy, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lzwind
lzwind merged commit 83702d8 into linuxdeepin:master Aug 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants