Add bullet-style dirty indicator for CTabFolder tabs#3141
Draft
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
Draft
Add bullet-style dirty indicator for CTabFolder tabs#3141vogella wants to merge 1 commit intoeclipse-platform:masterfrom
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
511a1a2 to
72bae05
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>
72bae05 to
418ac9a
Compare
Contributor
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