-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
fix: fix editor progress position when enabled pinnedTabsOnSeparateRow #195314
fix: fix editor progress position when enabled pinnedTabsOnSeparateRow #195314
Conversation
/assign @benibenj |
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.
Thanks for submitting the bug and creating a PR! I left some comments to your changes
@@ -404,12 +404,13 @@ export abstract class EditorTabsControl extends Themable implements IEditorTabsC | |||
|
|||
protected updateTabHeight(): void { | |||
this.parent.style.setProperty('--editor-group-tab-height', `${this.tabHeight}px`); | |||
this.parent.parentElement?.style.setProperty('--editor-group-tab-total-height', `${this.tabHeight * (this.groupsView.partOptions.pinnedTabsOnSeparateRow ? 2 : 1)}px`); |
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.
This probably won't work. Even though the pinnedTabsOnSeparateRow
setting might be activated, this doesn't mean that two tab rows are actually visible. If all tabs are pinned or if there is no pinned tab then there will only be one tab row and so the height of the progress bar has to be change in these cases.
We handle the number of tab rows here.
@benibenj You are right. The first commit won't work. Even
|
src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css
Outdated
Show resolved
Hide resolved
I think we should still set the progress bar from the top as we did before. Your approach causes it to be placed underneath the breadcrumbs which did not used to be the case, and so we don't want to change that. This is my recommendation: We already know the height of the editor title control. It can be accessed in editorTitleControl.ts. Like in your first approach, you can introduce a CSS variable, and overwrite the absolute top position of the progress bar in editorgroupview.css (This is where the progress bar lives). The variable could be called The last thing to do now is update the value when there are changes to the layout, these could be:
The last two are specific to having some settings turned on, however, we can start off by updating the height every time as it is not an expensive operation and future proof. But we might change this in the future. |
Got it. Let me submit a change. |
@harbin1053020115 The change looks great! Thanks very much. |
Great~Moving to layout to reset css variable is a better way. |
microsoft#195314) * fix: fix editor progress position when enabled pinnedTabsOnSeparateRow * fix: fix editor progress position * fix: fix editor progress position * fix: add commit to editor title progress style * Revert "fix: add commit to editor title progress style" This reverts commit 302ec88. * Revert "fix: fix editor progress position" This reverts commit ec445b6. * Revert "fix: fix editor progress position" This reverts commit cea64be. * Revert "fix: fix editor progress position when enabled pinnedTabsOnSeparateRow" This reverts commit 8f2c0e7. * feat: add --editor-group-tabs-height css variable to set progress bar position * update height in lyout * Remove setting redraws as already done elsewhere * Remove 2px for progress bit height --------- Co-authored-by: ermin.zem <ermin.zem@alibaba-inc.com> Co-authored-by: BeniBenj <besimmonds@microsoft.com>
To #195313