Fix more gutter close button alignment issues (#15233)

Follow-up of https://github.com/zed-industries/zed/pull/15178

* shows proper cursor on hovering a block that's over a git hunk
* show gutter buttons better when git hunks are on the same line
* show deleted hunks' gutter buttons better when git blame info is shown
in the gutter

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-07-26 01:42:25 +03:00 committed by GitHub
parent 1da6a12bb4
commit 10c9e337cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 8 deletions

View file

@ -13,8 +13,8 @@ use multi_buffer::{
use settings::SettingsStore;
use text::{BufferId, Point};
use ui::{
div, h_flex, v_flex, ActiveTheme, Context as _, ContextMenu, InteractiveElement, IntoElement,
ParentElement, Pixels, Styled, ViewContext, VisualContext,
div, h_flex, rems, v_flex, ActiveTheme, Context as _, ContextMenu, InteractiveElement,
IntoElement, ParentElement, Pixels, Styled, ViewContext, VisualContext,
};
use util::{debug_panic, RangeExt};
@ -484,7 +484,10 @@ impl Editor {
.child(
h_flex()
.id("gutter hunk")
.pl(hunk_bounds.origin.x)
.pl(gutter_dimensions.margin
+ gutter_dimensions
.git_blame_entries_width
.unwrap_or_default())
.max_w(hunk_bounds.size.width)
.min_w(hunk_bounds.size.width)
.size_full()
@ -512,7 +515,7 @@ impl Editor {
.child(
v_flex()
.size_full()
.pt(ui::rems(0.25))
.pt(rems(0.25))
.justify_start()
.child(close_button),
),