mirror of https://github.com/linebender/xilem
More fmt changes (#839)
This commit is contained in:
parent
066d4319e8
commit
0b4e10c003
|
@ -6,12 +6,10 @@ use tracing::{debug, info_span, trace};
|
|||
use tree_arena::ArenaMut;
|
||||
use vello::kurbo::Rect;
|
||||
|
||||
use crate::passes::recurse_on_children;
|
||||
use crate::passes::{enter_span_if, recurse_on_children};
|
||||
use crate::render_root::{RenderRoot, RenderRootState};
|
||||
use crate::{AccessCtx, Widget, WidgetState};
|
||||
|
||||
use super::enter_span_if;
|
||||
|
||||
// --- MARK: BUILD TREE ---
|
||||
fn build_accessibility_tree(
|
||||
global_state: &mut RenderRootState,
|
||||
|
|
|
@ -11,14 +11,12 @@ use vello::Scene;
|
|||
use crate::kurbo::Size;
|
||||
use crate::paint_scene_helpers::{fill_lin_gradient, stroke, UnitPoint};
|
||||
use crate::text::ArcStr;
|
||||
use crate::widget::WidgetMut;
|
||||
use crate::widget::{Label, LineBreaking, WidgetMut, WidgetPod};
|
||||
use crate::{
|
||||
theme, AccessCtx, AccessEvent, BoxConstraints, EventCtx, LayoutCtx, PaintCtx, Point,
|
||||
PointerEvent, QueryCtx, RegisterCtx, TextEvent, Update, UpdateCtx, Widget, WidgetId,
|
||||
};
|
||||
|
||||
use super::{Label, LineBreaking, WidgetPod};
|
||||
|
||||
/// A progress bar.
|
||||
pub struct ProgressBar {
|
||||
/// A value in the range `[0, 1]` inclusive, where 0 is 0% and 1 is 100% complete.
|
||||
|
|
|
@ -9,14 +9,12 @@ use tracing::{trace_span, Span};
|
|||
use vello::kurbo::{Point, Rect, Size};
|
||||
use vello::Scene;
|
||||
|
||||
use crate::widget::WidgetMut;
|
||||
use crate::widget::{Padding, TextArea, WidgetMut, WidgetPod};
|
||||
use crate::{
|
||||
AccessCtx, AccessEvent, BoxConstraints, EventCtx, LayoutCtx, PaintCtx, PointerEvent, QueryCtx,
|
||||
RegisterCtx, TextEvent, Update, UpdateCtx, Widget, WidgetId,
|
||||
};
|
||||
|
||||
use super::{Padding, TextArea, WidgetPod};
|
||||
|
||||
/// Added padding between each horizontal edge of the widget
|
||||
/// and the text in logical pixels.
|
||||
///
|
||||
|
@ -161,15 +159,14 @@ impl Widget for Prose {
|
|||
// TODO - Add more tests
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use parley::{layout::Alignment, StyleProperty};
|
||||
use parley::layout::Alignment;
|
||||
use parley::StyleProperty;
|
||||
use vello::kurbo::Size;
|
||||
|
||||
use super::*;
|
||||
use crate::{
|
||||
assert_render_snapshot,
|
||||
testing::TestHarness,
|
||||
widget::{CrossAxisAlignment, Flex, SizedBox, TextArea},
|
||||
};
|
||||
use crate::assert_render_snapshot;
|
||||
use crate::testing::TestHarness;
|
||||
use crate::widget::{CrossAxisAlignment, Flex, SizedBox, TextArea};
|
||||
|
||||
#[test]
|
||||
/// A wrapping prose's alignment should be respected, regardless of
|
||||
|
|
|
@ -6,20 +6,18 @@
|
|||
use std::mem::Discriminant;
|
||||
use std::time::Instant;
|
||||
|
||||
use crate::kurbo::{Affine, Point, Size};
|
||||
use crate::text::{default_styles, render_text};
|
||||
use accesskit::{Node, NodeId, Role};
|
||||
use parley::editor::{Generation, SplitString};
|
||||
use parley::layout::Alignment;
|
||||
use parley::PlainEditor;
|
||||
use smallvec::SmallVec;
|
||||
use tracing::{trace_span, Span};
|
||||
use vello::kurbo::{Rect, Vec2};
|
||||
use vello::kurbo::{Affine, Point, Rect, Size, Vec2};
|
||||
use vello::peniko::{Brush, Fill};
|
||||
use vello::Scene;
|
||||
use winit::keyboard::{Key, NamedKey};
|
||||
|
||||
use crate::text::{BrushIndex, StyleProperty};
|
||||
use crate::text::{default_styles, render_text, BrushIndex, StyleProperty};
|
||||
use crate::widget::{Padding, WidgetMut};
|
||||
use crate::{
|
||||
palette, theme, AccessCtx, AccessEvent, BoxConstraints, CursorIcon, EventCtx, LayoutCtx,
|
||||
|
|
|
@ -9,14 +9,12 @@ use tracing::{trace_span, Span};
|
|||
use vello::kurbo::{Affine, Insets, Point, Rect, Size, Stroke};
|
||||
use vello::Scene;
|
||||
|
||||
use crate::widget::WidgetMut;
|
||||
use crate::widget::{Padding, TextArea, WidgetMut, WidgetPod};
|
||||
use crate::{
|
||||
AccessCtx, AccessEvent, BoxConstraints, Color, EventCtx, LayoutCtx, PaintCtx, PointerEvent,
|
||||
QueryCtx, RegisterCtx, TextEvent, Update, UpdateCtx, Widget, WidgetId,
|
||||
};
|
||||
|
||||
use super::{Padding, TextArea, WidgetPod};
|
||||
|
||||
/// Added padding between each horizontal edge of the widget
|
||||
/// and the text in logical pixels.
|
||||
///
|
||||
|
@ -180,9 +178,10 @@ mod tests {
|
|||
use vello::kurbo::Size;
|
||||
|
||||
use super::*;
|
||||
use crate::{
|
||||
assert_render_snapshot, testing::TestHarness, text::StyleProperty, widget::TextArea,
|
||||
};
|
||||
use crate::assert_render_snapshot;
|
||||
use crate::testing::TestHarness;
|
||||
use crate::text::StyleProperty;
|
||||
use crate::widget::TextArea;
|
||||
|
||||
#[test]
|
||||
fn textbox_outline() {
|
||||
|
|
|
@ -12,14 +12,12 @@ use vello::kurbo::{Point, Size};
|
|||
use vello::Scene;
|
||||
|
||||
use crate::text::{ArcStr, StyleProperty};
|
||||
use crate::widget::WidgetMut;
|
||||
use crate::widget::{Label, WidgetMut, WidgetPod};
|
||||
use crate::{
|
||||
AccessCtx, AccessEvent, BoxConstraints, EventCtx, FontWeight, LayoutCtx, PaintCtx,
|
||||
PointerEvent, QueryCtx, RegisterCtx, TextEvent, Update, UpdateCtx, Widget, WidgetId,
|
||||
};
|
||||
|
||||
use super::{Label, WidgetPod};
|
||||
|
||||
/// An `f32` value which can move towards a target value at a linear rate over time.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct AnimatedF32 {
|
||||
|
|
|
@ -3,14 +3,17 @@
|
|||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use crate::{
|
||||
vello::Scene, widget::WidgetMut, AccessCtx, BoxConstraints, LayoutCtx, PaintCtx, Point,
|
||||
QueryCtx, RegisterCtx, Size, Widget, WidgetId, WidgetPod,
|
||||
};
|
||||
use accesskit::{Node, Role};
|
||||
use smallvec::SmallVec;
|
||||
use tracing::trace_span;
|
||||
|
||||
use crate::vello::Scene;
|
||||
use crate::widget::WidgetMut;
|
||||
use crate::{
|
||||
AccessCtx, BoxConstraints, LayoutCtx, PaintCtx, Point, QueryCtx, RegisterCtx, Size, Widget,
|
||||
WidgetId, WidgetPod,
|
||||
};
|
||||
|
||||
struct Child {
|
||||
widget: WidgetPod<dyn Widget>,
|
||||
alignment: ChildAlignment,
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
#![expect(clippy::allow_attributes, reason = "Deferred: Noisy")]
|
||||
#![expect(clippy::allow_attributes_without_reason, reason = "Deferred: Noisy")]
|
||||
|
||||
use std::{any::Any, ops::Deref as _};
|
||||
use std::any::Any;
|
||||
use std::ops::Deref as _;
|
||||
|
||||
use web_sys::wasm_bindgen::JsCast;
|
||||
|
||||
|
|
Loading…
Reference in New Issue