Skip to content
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 scrollbar not always being on top #20665

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TOULR
Copy link

@TOULR TOULR commented Nov 14, 2024

Set the elevation of the scrollbar to 1 borderless, so that the blue outline is no longer above the scrollbar.

Closes #19875

Release Notes:

  • N/A

…outline is no longer above the scrollbar.

This should fix zed-industries#19875
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 14, 2024
@@ -2982,8 +2982,9 @@ impl ProjectPanel {
.right_1()
.top_1()
.bottom_1()
.w(px(12.))
Copy link
Contributor

@osiewicz osiewicz Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an unnecessary drive-by change? /cc @iamnbutler

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the width because otherwise there would be a gap between the right side of the scroll handle and where the blue border continues:
grafik
In my opinion it looks better like this:
grafik
but i think it's a matter of taste

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be solved in a different way, but i don't know how, this is my first contribution to this project

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, this definitely looks better, though I think we should find out where that background originates from and trim that instead. :P

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please post the screenshots of the state before and after.

@maxdeviant maxdeviant changed the title Fixed issue with Scrollbar Fix scrollbar not always being on top Nov 14, 2024
@osiewicz
Copy link
Contributor

osiewicz commented Nov 14, 2024

It looks like this change causes the background of scrollbar show up unconditionally. We probably need render_vertical_scrollbar to return None if Scrollbar::vertical returns None as well.
image

The blend function is used to blend the scrollbar color (scrollbar_thumb_background) on top of the background color (surface background). This way the color of the scrollbar stays the same, but it is no longer transparent, so that the blue border of selected files can't shine through and appear as if it was above the scrollbar.
@TOULR
Copy link
Author

TOULR commented Nov 15, 2024

I now found a possibly better solution to the problem with the blue border appearing on top of the scrollbar:
the blue border was appearing to be on top of the scrollbar because the color of the scrollbar has some transparency, but when i use the blend function to blend the scrollbar color on top of the background color, the color stays the same but the blue border of selected files no longer shines through
It now looks like this:
grafik

And now the background of the scrollbar doesn't appear when there is no scrollbar:
grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scroll bar should be upmost in project pane
3 participants