Repository navigation
fix(viewer): keep last thumbnail visible on context menu - #185
Merged
deepin-bot[bot] merged 1 commit intoNov 24, 2026
Merged
Conversation
Reviewer's GuideImplementationReplace the thumbnail strip’s hard-coded movement lower bound with one based on the widget’s actual width, keeping the final thumbnail visible while preserving behavior when the content fits; remove the obsolete movement constant.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Resurgamz
force-pushed
the
feature/fix-BUG247309
branch
from
November 20, 2026 09:54
027d858 to
6deff6c
Compare
The thumbnail reset animation clamped the strip with a hard-coded 375px visible width, pushing the last thumbnail out of view when the window was narrower. Use the real widget width as the lower bound instead. 缩略图复位动画用硬编码 375px 可视宽度做边界钳制,窗口较窄时会把 最后一张缩略图挤出可视区。改用控件真实宽度作为下界。 Log: 修复切到最后一张时右键菜单导致缩略图前滚 PMS: BUG-247309 Influence: 缩略图栏定位正确,右键菜单不再使最后一张缩略图移出可视区。
Resurgamz
force-pushed
the
feature/fix-BUG247309
branch
from
November 20, 2026 10:26
6deff6c to
ab9fa32
Compare
max-lvs
approved these changes
Nov 24, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: max-lvs, Resurgamz The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
看图打开较多图片后切换到最后一张,在主图区域唤起右键菜单时,底部缩略图栏会自动向左滚动,导致最后一张缩略图被挤出可视区,不再显示当前正在查看的图片。
PMS:https://pms.uniontech.com/bug-view-247309.html
根因
缩略图栏由
MyImageListWidget管理,位置通过移动子控件LibImgViewListView的 x 坐标实现。LibCommonService::eventFilter(service/commonservice.cpp:82)对任意右键都emit sigRightMousePress();MyImageListWidget收到该信号后无条件调用animationStart(true, 0, 400)复位缩略图栏(viewpanel/contents/imgviewwidget.cpp);animationStart复位时,位置被"拖动边界"钳制,其下界为:隐含假设缩略图可视宽度恒为 375px。
当真实可视宽度
width < 375px时,最后一张的正确位置width - rowWidth小于该下界,被抬升到375 - rowWidth,列表整体右移,末张缩略图被挤出可视区右侧。故障机日志(
deepin-image-viewer 5.9.20.9,窗口 770px)按工具栏固定布局推算缩略图可视宽度 ≈ 227px < 375px,命中缺陷;全屏/宽窗口不易复现。修复
将
animationStart与eventFilter两处"拖动边界"的下界,由"375px 魔数"统一改为真实可视宽度,并用qMin(0, ...)保证内容不足一屏时不强制右移(保持原有左对齐/居中行为):同时移除因此不再使用的
RIGHT_LISTVIEW_MOVE_UPDATE宏,并更新 SPDX 年份范围。回归影响面
375-rowWidth→width-rowWidth,右对齐最后一张时不再被抬升;拖动到末尾也可完整显示末张。qMin(0, width-rowWidth)=0,下界仍为 0,原有左对齐/居中行为不变。animationStart(复位)与eventFilter(拖动)两处边界现已一致。本地验证
develop/eagle最新代码(e586bf4)应用,imageviewer目标编译通过(无告警)。imgviewwidget相关 8 个用例(含animationStart、animationStart_400、moveCenterWidget、thumbnailIsMoving、sigRightMousePress)全部通过。复现/回归步骤