Skip to content

fix(tabbar): disable scroll buttons in tab bar - #556

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
GongHeng2017:202608311727-master-fix
Sep 1, 2026
Merged

fix(tabbar): disable scroll buttons in tab bar#556
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
GongHeng2017:202608311727-master-fix

Conversation

@GongHeng2017

@GongHeng2017 GongHeng2017 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The tab bar currently shows the built-in left/right scroll buttons when tabs overflow. This introduces extra navigation controls that are not needed for the editor UI.

Disable the DTabBar scroll buttons while keeping the add-tab action available, so the tab strip keeps a cleaner and more consistent layout.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-375693.html

Summary by Sourcery

Bug Fixes:

  • Disable the tab bar’s built-in scroll buttons to remove unnecessary overflow navigation controls while preserving tab addition.

The tab bar currently shows the built-in left/right scroll buttons when
tabs overflow. This introduces extra navigation controls that are not
needed for the editor UI.

Disable the DTabBar scroll buttons while keeping the add-tab action
available, so the tab strip keeps a cleaner and more consistent layout.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-375693.html
@sourcery-ai

sourcery-ai Bot commented Sep 1, 2026

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

Reviewer's Guide

The tab bar constructor now disables built-in scroll buttons for overflowing tabs, resulting in a cleaner editor tab layout while retaining the add-tab action and other existing tab interactions.

File-Level Changes

Change Details Files
Disable the tab bar’s built-in overflow scroll controls while preserving existing tab management actions.
  • Configure DTabBar to not use left/right scroll buttons.
  • Keep movable, closable, add-tab, drag, and drop behavior unchanged.
src/controls/tabbar.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 found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/controls/tabbar.cpp" line_range="70" />
<code_context>
     setMovable(true);
     setTabsClosable(true);
     setVisibleAddButton(true);
+    setUsesScrollButtons(false);
     setDragable(true);
     setAcceptDrops(true);
</code_context>
<issue_to_address>
**issue (broader_impact):** When the tab count exceeds the available width, `Tabbar::tabSizeHint` enforces a minimum tab width of 110 pixels, so all tabs cannot fit. Disabling scroll buttons removes DTabBar's overflow navigation, causing tabs beyond the viewport to be clipped and impossible to select by clicking.

**Triggers:** When enough tabs are open that their combined minimum width exceeds the tab bar width.

**Suggested fix:** Keep an overflow navigation mechanism, such as the scroll buttons or an overflow menu, or revise the tab sizing/layout so every tab remains reachable without scrolling.

```suggestion
    setUsesScrollButtons(true);
```
</issue_to_address>

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.

Comment thread src/controls/tabbar.cpp
setMovable(true);
setTabsClosable(true);
setVisibleAddButton(true);
setUsesScrollButtons(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (broader_impact): When the tab count exceeds the available width, Tabbar::tabSizeHint enforces a minimum tab width of 110 pixels, so all tabs cannot fit. Disabling scroll buttons removes DTabBar's overflow navigation, causing tabs beyond the viewport to be clipped and impossible to select by clicking.

Triggers: When enough tabs are open that their combined minimum width exceeds the tab bar width.

Suggested fix: Keep an overflow navigation mechanism, such as the scroll buttons or an overflow menu, or revise the tab sizing/layout so every tab remains reachable without scrolling.

Suggested change
setUsesScrollButtons(false);
setUsesScrollButtons(true);

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@GongHeng2017

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit 9159ab0 into linuxdeepin:master Sep 1, 2026
16 of 17 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