add StyledExt::refine_style to utils

This commit is contained in:
2026-11-01 10:33:51 +07:00
parent 78d7e857f1
commit ac4a0f2add
6 changed files with 36 additions and 31 deletions
+7 -5
View File
@@ -1,11 +1,13 @@
use gpui::prelude::FluentBuilder as _;
use gpui::{
App, Bounds, DispatchPhase, ElementId, InteractiveElement as _, IntoElement, MouseDownEvent,
MouseMoveEvent, ParentElement, Pixels, Refineable as _, RenderOnce, ScrollHandle, SharedString,
MouseMoveEvent, ParentElement, Pixels, RenderOnce, ScrollHandle, SharedString,
StatefulInteractiveElement as _, Styled, Window, canvas, div, fill, point,
};
use gpui_native_theme::ActiveTheme as _;
use crate::common::StyledExt;
/// Which directions the content scrolls in.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum ScrollAxes {
@@ -116,13 +118,13 @@ impl RenderOnce for ScrollArea {
.on_scroll(|_, _, cx| {
// Keep wheel events from scrolling an outer scroll area too.
cx.stop_propagation();
});
})
.refine_style(&self.style);
pane.style().refine(&self.style);
// Extend with children
pane.extend(self.children);
let mut wrapper = div().relative();
wrapper.style().refine(&self.style);
let mut wrapper = div().relative().refine_style(&self.style);
wrapper.extend(std::iter::once(pane.into_any_element()));
if let Some(handle) = self.handle {