press the down key to move to the end of the line (#52)

This commit is contained in:
reya
2025-05-30 12:14:51 +07:00
committed by GitHub
parent 63191c16bd
commit 7cc512331b
6 changed files with 52 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
use gpui::{
px, relative, App, Axis, BorderStyle, Bounds, ContentMask, Corners, Edges, Element, ElementId,
EntityId, GlobalElementId, Hitbox, Hsla, IntoElement, IsZero as _, LayoutId, PaintQuad, Pixels,
Point, Position, ScrollHandle, ScrollWheelEvent, Size, Style, Window,
EntityId, GlobalElementId, Hitbox, HitboxBehavior, Hsla, IntoElement, IsZero as _, LayoutId,
PaintQuad, Pixels, Point, Position, ScrollHandle, ScrollWheelEvent, Size, Style, Window,
};
use crate::AxisExt;
@@ -96,7 +96,7 @@ impl Element for ScrollableMask {
size: bounds.size,
};
window.insert_hitbox(cover_bounds, false)
window.insert_hitbox(cover_bounds, HitboxBehavior::Normal)
}
fn paint(

View File

@@ -6,8 +6,9 @@ use std::{
use gpui::{
fill, point, px, relative, App, BorderStyle, Bounds, ContentMask, CursorStyle, Edges, Element,
EntityId, Hitbox, Hsla, IntoElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, PaintQuad,
Pixels, Point, Position, ScrollHandle, ScrollWheelEvent, UniformListScrollHandle, Window,
EntityId, Hitbox, HitboxBehavior, Hsla, IntoElement, MouseDownEvent, MouseMoveEvent,
MouseUpEvent, PaintQuad, Pixels, Point, Position, ScrollHandle, ScrollWheelEvent,
UniformListScrollHandle, Window,
};
use theme::ActiveTheme;
@@ -431,7 +432,7 @@ impl Element for Scrollbar {
cx: &mut App,
) -> Self::PrepaintState {
let hitbox = window.with_content_mask(Some(ContentMask { bounds }), |window| {
window.insert_hitbox(bounds, false)
window.insert_hitbox(bounds, HitboxBehavior::Normal)
});
let mut states = vec![];
@@ -569,7 +570,7 @@ impl Element for Scrollbar {
};
let bar_hitbox = window.with_content_mask(Some(ContentMask { bounds }), |window| {
window.insert_hitbox(bounds, false)
window.insert_hitbox(bounds, HitboxBehavior::Normal)
});
states.push(AxisPrepaintState {