Revert "ui: Account for padding of parent container during scrollbar layout (#27402)" (#30544)

This reverts commit 82a7aca5a6.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-05-12 11:47:04 +02:00 committed by GitHub
parent 907b2f0521
commit f0f0a52793
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 203 additions and 125 deletions

View file

@ -3,9 +3,9 @@ use std::{
rc::Rc,
};
use gpui::{Bounds, Point, Size, size};
use gpui::{Bounds, Point, size};
use terminal::Terminal;
use ui::{Pixels, ScrollableHandle, px};
use ui::{ContentSize, Pixels, ScrollableHandle, px};
#[derive(Debug)]
struct ScrollHandleState {
@ -46,9 +46,12 @@ impl TerminalScrollHandle {
}
impl ScrollableHandle for TerminalScrollHandle {
fn content_size(&self) -> Size<Pixels> {
fn content_size(&self) -> Option<ContentSize> {
let state = self.state.borrow();
size(Pixels::ZERO, state.total_lines as f32 * state.line_height)
Some(ContentSize {
size: size(px(0.), px(state.total_lines as f32 * state.line_height.0)),
scroll_adjustment: Some(Point::new(px(0.), px(0.))),
})
}
fn offset(&self) -> Point<Pixels> {