Skip to content

fix(exposureslider): always set focus after slider animation#498

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:fix-350117-always-set-focus-after-slider-animation
Jul 20, 2026
Merged

fix(exposureslider): always set focus after slider animation#498
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:fix-350117-always-set-focus-after-slider-animation

Conversation

@add-uos

@add-uos add-uos commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Remove the isShortCut condition check so the exposure slider always gains keyboard focus after fade-in animation completes.

移除isShortCut条件判断,使曝光滑块在淡入动画结束后
始终获得键盘焦点。

Log: 修复曝光滑块动画结束后无法获得焦点的问题
PMS: BUG-350117
Influence: 修复后曝光滑块在所有触发方式下均可正确获取焦点,用户可通过方向键调整曝光值。

Summary by Sourcery

Ensure the exposure slider always receives keyboard focus after its fade-in animation completes, regardless of how it was triggered.

Bug Fixes:

  • Fix missing keyboard focus on the exposure slider after animation when triggered by non-shortcut interactions.

Enhancements:

  • Update copyright and SPDX metadata years for the exposure slider implementation.

Remove the isShortCut condition check so the exposure slider
always gains keyboard focus after fade-in animation completes.

移除isShortCut条件判断,使曝光滑块在淡入动画结束后
始终获得键盘焦点。

Log: 修复曝光滑块动画结束后无法获得焦点的问题
PMS: BUG-350117
Influence: 修复后曝光滑块在所有触发方式下均可正确获取焦点,用户可通过方向键调整曝光值。
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码修复了焦点处理逻辑不一致的问题,简化了条件判断并更新了版权信息
逻辑正确且无安全漏洞,代码质量良好,无需扣分

■ 【详细分析】

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

ExposureSlider::showContent 函数中,移除了 if (isShortCut) 的条件判断,直接在动画结束后调用 m_slider->slider()->setFocus(),确保了无论何种触发方式均能正确获取焦点,修复了原有的逻辑缺陷
潜在问题:无
建议:无需额外修改

  • 2.代码质量(良好)✓

代码去除了冗余的条件分支和调试日志输出,使得代码更加简洁易读;同时更新了版权年份信息,符合规范
潜在问题:无
建议:保持当前简洁的编码风格

  • 3.代码性能(无性能问题)✓

移除条件判断略微减少了执行开销,且未引入任何新的性能消耗
潜在问题:无
建议:无

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

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及焦点设置和版权信息更新,不涉及外部输入处理或敏感操作,不存在安全风险

  • 建议:无需进行安全修复

■ 【改进建议代码示例】

// 当前代码已完全符合规范,无需进一步修复,保持原样即可:
connect(pGroup, &QParallelAnimationGroup::finished, this, [=](){
    qDebug() << "Animation finished, handling cleanup";
    m_slider->slider()->setFocus();
    pGroup->deleteLater();
});

@sourcery-ai

sourcery-ai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR ensures the exposure slider always requests keyboard focus after its fade-in animation completes, regardless of how it was triggered, and updates copyright/SPDX years accordingly.

Sequence diagram for exposure slider focus after animation

sequenceDiagram
    actor User
    participant ExposureSlider
    participant QParallelAnimationGroup as AnimationGroup
    participant Slider

    User->>ExposureSlider: showContent(show, isShortCut)
    ExposureSlider->>AnimationGroup: start()
    AnimationGroup-->>ExposureSlider: finished
    ExposureSlider->>Slider: setFocus()
Loading

File-Level Changes

Change Details Files
Always set focus to the exposure slider after the animation finishes, removing the shortcut-only condition.
  • Keep the animation finished lambda but remove the isShortCut conditional around focus handling
  • Always call setFocus() on the slider when the QParallelAnimationGroup finishes
  • Retain cleanup of the animation group via deleteLater()
src/src/exposureslider.cpp
Update copyright and SPDX-FileCopyrightText year ranges to include 2026.
  • Change the Uniontech copyright range from 2020 ~ 2021 to 2020 - 2026
  • Change the SPDX-FileCopyrightText year from 2023 to 2023 - 2026
src/src/exposureslider.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

@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.

Hey - I've left some high level feedback:

  • The isShortCut parameter to showContent is now unused; consider removing it from the function signature and call sites to avoid confusion about its purpose.
  • Update the inline comment //键盘触发,需在此处理焦点 and any related debug text to reflect that focus is now always set after the animation, regardless of trigger type.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `isShortCut` parameter to `showContent` is now unused; consider removing it from the function signature and call sites to avoid confusion about its purpose.
- Update the inline comment `//键盘触发,需在此处理焦点` and any related debug text to reflect that focus is now always set after the animation, regardless of trigger type.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos, 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

@add-uos

add-uos commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit 4f04c62 into linuxdeepin:master Jul 20, 2026
21 of 23 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