-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve UI Indication for Unsaved Changes in Tabs #1632
base: master
Are you sure you want to change the base?
Improve UI Indication for Unsaved Changes in Tabs #1632
Conversation
Tabs render dirty parts by showing a `*` in front of the tab name (e.g., in front of the file name. This information is hard to see by developers. This change introduces a graphical indicator on the close button to highlight dirty (unsaved) changes.
Hi, I have opened this PR as draft, because I want to get your opinion on this change. The code can be improved at several places and current implementation has some shortcomings that need to be improved as soon as this approach shall be taken up. Existing gaps (as of now):
|
Looks awesome to me, thanks. The * is outside Eclipse not well understood as "I need saving". By modifying the close button in case of an editor which need saving we clearly indicate that close is not different. Other editors like VScode use the same approach. |
Test Results80 files - 403 80 suites - 403 2s ⏱️ - 8m 37s Results for commit ff3d557. ± Comparison against base commit 2ce8542. This pull request removes 4061 tests.
♻️ This comment has been updated with latest results. |
Could you attach some screenshots from "other" editors? I haven't seen yet something like proposed here. |
@@ -877,44 +877,58 @@ void drawBody(GC gc, Rectangle bounds, int state) { | |||
} | |||
} | |||
|
|||
void drawClose(GC gc, Rectangle closeRect, int closeImageState) { | |||
void drawClose(GC gc, Rectangle closeRect, int closeImageState, boolean showDirtyIndicator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this code, and, in general, tab presentation (font style, color, text decoration, borders, close icon) could be delegated to a new callback interface that, if the callback is not set, would by default use current SWT implementation, and if set, would give the callback full control of the tab visuals.
This way SWT could keep its code independent of the application needs and application (like workbench renderers) could implement whatever possible.
I personally would like to see dirty tabs in bold red font and I don't want to see close buttons at all to save space. I've had that in my Extended VS Presentation plugin for Eclipse 3.x many years ago before e4 killed Presentation API.
That's of course much more as proposal here, but it shouldbe doable and it would allow 3rd parties to decide whether they want close buttons turned into circles or disappear completely or just stay "old good" black crosses etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about tabs of multi-page editors as e.g. the plugin.xml editor? |
In my IDE, the tabs of multi-page editors (e.g. @BeckerWdf I believe you know the |
I think this is maybe a biased opinion, at least on Debian / Gnome this is common and "well understood" (at least by me) Notepad++ (windows) uses a red icon So as always there is not the one-and-only truth ;-)
I think one should be able to change this via CSS styling. |
Yes, but I don't also like native widgets to be additionally styled by e4 css for multiple reasons. |
|
But the rest of the UI is, and you can't have only tabs styled as of today. |
what I like with the proposed change is that the black circle is much bigger then the little tiny "*" we use today. |
Thank you for the feedback so far. I've noticed some positive responses, but I’m uncertain about the rest. Should I proceed with improving this PR, or do we need more input from the community first? I can work on it when I find some time alongside my other tasks. |
@HannesWell and @akurtakov please bring this to the PMC and decide if this is desired |
We have discussed this topic in the open dev-call on Thursday: In general the feedback was that avoiding resizing is nice, but the exact 'dirty' symbol might not be liked by everyone and maybe alternatives could be considered. Furthermore the old and new behavior would ideally be configurable in a preference. |
For that particular part, just using another character such as
I also find it interesting. However it is un Another possibility that would fit both could be an overlay on the editor icon of the tab, but it might be more complex to implement. |
@HannesWell Thanks for the update. Next step: I will add a preference so that users can enable the new behavior. |
Actually, using an emoji was my first attempt. Unfortunately this changed the size of the tab much more than the |
@mickaelistria I guess there is something missing in your comment, isn't it? |
Before this change: If a part is dirty (has unsaved changes), this will be indicated by an
*
in front of a tab's name.With this change, the
*
is removed and dirty parts are indicated by a bullet at the location of closing a tab. As soon as, the bullet is hovered, the "button" to close the tab is shown.Furthermore, the rendering of the close button of tabs is lightly changed.
Examples
Tabs unchanged:
Tabs unchanged (hovered):
Tab "Test.java" (dirty; selected):
Tab "Test.java" (dirty; not selected):
Tab "Test.java" (dirty; hovered)
Complete flow:
To enable this behavior, changes in PR eclipse-platform/eclipse.platform.ui#2568 are required, too. However, this change can be merged first.