Add bullet-style dirty indicator for CTabFolder tabs#3141
Open
vogella wants to merge 3 commits intoeclipse-platform:masterfrom
Open
Add bullet-style dirty indicator for CTabFolder tabs#3141vogella wants to merge 3 commits intoeclipse-platform:masterfrom
vogella wants to merge 3 commits intoeclipse-platform:masterfrom
Conversation
72bae05 to
418ac9a
Compare
Contributor
Contributor
Author
|
@schneidermic0 is this fine for you? |
Contributor
Author
060d5cc to
171dceb
Compare
Contributor
Author
Contributor
Author
|
folder.setDirtyIndicatorCloseStyle feels a little bit to long, will update PR with a shorter API name |
20f4177 to
4a06216
Compare
I am happy you took over the changes and continue to work on this. Thank you. I saw it some days back and gave a thumbs up on your initial comment of this PR. :) |
f4443e8 to
fd0d529
Compare
When enabled via CTabFolder.setDirtyIndicatorCloseStyle(true), dirty tabs show a filled circle at the close button location instead of the traditional '*' prefix. The bullet transforms into the close button on hover, matching the behavior of VS Code and similar editors. This is opt-in (disabled by default) to preserve backward compatibility. The feature adds: - CTabFolder.setDirtyIndicatorCloseStyle(boolean) / getDirtyIndicatorCloseStyle() - CTabItem.setShowDirty(boolean) / getShowDirty() - Rendering via fillOval for cross-platform consistency - Snippet391 demonstrating the feature Based on the approach from PR eclipse-platform#1632 by schneidermic0, with fixes for the copy-paste bug, preference toggle support per PMC request, and fillOval rendering instead of drawString for pixel-perfect results. See: eclipse-platform#1632 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…st EOF - Remove spurious y+1/-1 offset in drawDirtyIndicator; the oval is already centered from closeRect bounds, unlike the X drawing which needs the nudge due to its Math.max(1,...) coordinate logic - Extend Snippet393 with a dark/light theme toggle button to demonstrate that the dirty bullet color adapts to the tab foreground color - Add missing newline at end of Test_org_eclipse_swt_custom_CTabItem.java Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
"CloseStyle" leaks the implementation detail that the bullet occupies the close button area. The shorter name describes the feature, not the mechanism. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fd0d529 to
c2ddea0
Compare
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.


Summary
*prefix approachCTabFolder.setDirtyIndicatorCloseStyle(true)and mark items dirty viaCTabItem.setShowDirty(true)New API
CTabFolder:
setDirtyIndicatorCloseStyle(boolean)— enables/disables the bullet-on-close-button stylegetDirtyIndicatorCloseStyle()— returns current settingCTabItem:
setShowDirty(boolean)— marks an item as having unsaved changesgetShowDirty()— returns the dirty stateDesign Decisions
falseby default) to preserve backward compatibility, per PMC feedback from the Dec 2024 dev callfillOvalrendering instead ofdrawString("●")for pixel-perfect cross-platform consistencycloseRectas the close button, keeping space allocation consistent and naturally enabling hover-to-reveal-close interactionContext
This continues the work started in #1632 by @schneidermic0 (who is unable to continue). Key improvements over that draft:
return showClose→return showDirty)fillOvalinstead ofdrawStringfor renderingA companion change in
eclipse.platform.uiis needed to wire this up to the workbench editor tabs (the UI side would callsetDirtyIndicatorCloseStyle(true)on the CTabFolder andsetShowDirty(true/false)on items, and stop prepending*when the new style is active).Test plan
mvn compilepasses forbundles/org.eclipse.swtTest_org_eclipse_swt_custom_CTabItemforsetShowDirty/getShowDirtyandsetDirtyIndicatorCloseStyle/getDirtyIndicatorCloseStyledirtyIndicatorCloseStyleisfalse🤖 Generated with Claude Code