fix(tabbar): disable scroll buttons in tab bar - #556
Conversation
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| setMovable(true); | ||
| setTabsClosable(true); | ||
| setVisibleAddButton(true); | ||
| setUsesScrollButtons(false); |
There was a problem hiding this comment.
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.
| setUsesScrollButtons(false); | |
| setUsesScrollButtons(true); |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
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: