pub struct Code(/* private fields */);Expand description
Implementations§
Source§impl Code
impl Code
Source§impl Code
impl Code
Sourcepub fn code(self) -> CodeText
pub fn code(self) -> CodeText
The source.
.to(next, seconds) diffs the two versions: tokens that stay slide
to their new places, deleted tokens fade and collapse, new tokens
fade in. Txt types its text out; code does not. .get(), .set()
and .bind() still replace the source with no animation, and .set
cancels a diff that is already running.
Sourcepub fn focus_lines(
self,
first: usize,
last: usize,
duration: f64,
) -> Tween<Vec2> ⓘ
pub fn focus_lines( self, first: usize, last: usize, duration: f64, ) -> Tween<Vec2> ⓘ
Moves the focus to lines first..=last over duration.
Lines are 1-based. While a diff is running, a focus that sits on lines which shift rides with those lines, and lands on their new numbers when the diff ends.
Sourcepub fn insert(
self,
line: usize,
col: usize,
text: impl Into<String>,
duration: impl Seconds,
) -> CodeTween ⓘ
pub fn insert( self, line: usize, col: usize, text: impl Into<String>, duration: impl Seconds, ) -> CodeTween ⓘ
Inserts text at line (1-based) and col (0-based characters).
§Panics
If the line or column is outside the current source. The line just after the last one, column 0, is the end of the source.
Sourcepub fn remove(
self,
range: ((usize, usize), (usize, usize)),
duration: impl Seconds,
) -> CodeTween ⓘ
pub fn remove( self, range: ((usize, usize), (usize, usize)), duration: impl Seconds, ) -> CodeTween ⓘ
Removes the half-open range ((start_line, start_col), (end_line, end_col)).
Lines are 1-based, columns are 0-based characters. ((5, 0), (6, 0))
removes line 5.
§Panics
If a point is outside the source, or the end is before the start.
Methods from Deref<Target = Node>§
Sourcepub fn rotation(self) -> Signal<f64>
pub fn rotation(self) -> Signal<f64>
Degrees, clockwise.
The rotation property as an animatable signal.
Sourcepub fn line_width(self) -> Signal<f64>
pub fn line_width(self) -> Signal<f64>
The line_width property as an animatable signal.
Sourcepub fn start(self) -> Signal<f64>
pub fn start(self) -> Signal<f64>
Start of the drawn part of the outline (fraction of its length).
The start property as an animatable signal.
Sourcepub fn end(self) -> Signal<f64>
pub fn end(self) -> Signal<f64>
End of the drawn part of the outline.
The end property as an animatable signal.
Sourcepub fn fill_gradient(self) -> Signal<Option<Gradient>>
pub fn fill_gradient(self) -> Signal<Option<Gradient>>
The fill_gradient property as an animatable signal.
Sourcepub fn stroke_gradient(self) -> Signal<Option<Gradient>>
pub fn stroke_gradient(self) -> Signal<Option<Gradient>>
The stroke_gradient property as an animatable signal.
Sourcepub fn dash_offset(self) -> Signal<f64>
pub fn dash_offset(self) -> Signal<f64>
The dash_offset property as an animatable signal.
Sourcepub fn shadow_color(self) -> Signal<Color>
pub fn shadow_color(self) -> Signal<Color>
The shadow_color property as an animatable signal.
Sourcepub fn shadow_blur(self) -> Signal<f64>
pub fn shadow_blur(self) -> Signal<f64>
The shadow_blur property as an animatable signal.
Sourcepub fn shadow_offset(self) -> Signal<Vec2>
pub fn shadow_offset(self) -> Signal<Vec2>
The shadow_offset property as an animatable signal.
Sourcepub fn align_self(self) -> Signal<Option<LayoutAlign>>
pub fn align_self(self) -> Signal<Option<LayoutAlign>>
The align_self property as an animatable signal.
Sourcepub fn add<B: NodeBuilder>(self, child: B) -> B::Handle
pub fn add<B: NodeBuilder>(self, child: B) -> B::Handle
Adds a child node; children are positioned relative to the parent.
The call site is stored on the node (oxframe check and oxframe inspect print it). .name("title") overrides the automatic label.
Sourcepub fn fade_in(self) -> Tween<f64> ⓘ
pub fn fade_in(self) -> Tween<f64> ⓘ
Fades the node in from transparent, over the theme’s normal duration with its enter easing.
Sourcepub fn pop_in(self) -> Tween<Vec2> ⓘ
pub fn pop_in(self) -> Tween<Vec2> ⓘ
Grows the node from nothing to its current scale with a small
overshoot (the theme’s emphasis easing, OUT_BACK by default).
Sourcepub fn draw_on(self) -> Tween<f64> ⓘ
pub fn draw_on(self) -> Tween<f64> ⓘ
Draws the outline from start to end (end from 0 to 1), as if with a
pen. Works on every shape with an outline: paths, lines, rectangles,
circles, polygons.
Sourcepub fn slide_in(self, from: Side) -> impl Future<Output = ()> + 'static
pub fn slide_in(self, from: Side) -> impl Future<Output = ()> + 'static
Slides the node into its place from SLIDE_DISTANCE pixels towards
from, fading in on the way.
Sourcepub fn next_to(self, other: impl Into<Node>, side: Side) -> Self
pub fn next_to(self, other: impl Into<Node>, side: Side) -> Self
Sits just outside other. The gap is the theme’s Md step, and the
position is recomputed every frame.
Sourcepub fn align_to(self, other: impl Into<Node>, edge: Edge) -> Self
pub fn align_to(self, other: impl Into<Node>, edge: Edge) -> Self
Lines this node’s edge up with the same edge of other.
Sourcepub fn to_edge(self, edge: Edge) -> Self
pub fn to_edge(self, edge: Edge) -> Self
Pins one edge to the safe area. The other axis is left as it is.
Sourcepub fn fade_out(self) -> Tween<f64> ⓘ
pub fn fade_out(self) -> Tween<f64> ⓘ
Fades the node out, over the theme’s normal duration with its exit easing.
Sourcepub fn absolute_position(self) -> Vec2
pub fn absolute_position(self) -> Vec2
Position of the node’s origin in scene coordinates.