Skip to content

Commit 8671ae6

Browse files
authored
Merge pull request #10 from pop-os/docs-fixes
Fix doc build and add github test for it.
2 parents ebce463 + 6b4276b commit 8671ae6

File tree

14 files changed

+81
-61
lines changed

14 files changed

+81
-61
lines changed

.github/workflows/doc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Docs
2+
on: [push, pull_request]
3+
jobs:
4+
all:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: hecrj/setup-rust-action@v1
8+
with:
9+
components: clippy
10+
- uses: actions/checkout@master
11+
- name: Check Docs
12+
run: cargo doc --workspace

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cosmic-time"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2021"
55
description = "An animation Crate for Iced and Cosmic DE"
66
license = "MIT"

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# COSMIC TIME
2-
## An animation toolkit for Iced-rs/Iced
2+
## An animation toolkit for [Iced](https://github.com/iced-rs/iced)
33

44
> This Project was build for [Cosmic DE](https://github.com/pop-os/cosmic-epoch). Though this will work for any project that depends on [Iced](https://github.com/iced-rs/iced).
55
@@ -56,12 +56,12 @@ There are some different things here!
5656
> let animation = chain![
5757
5858
Cosmic Time refers to animations as [`Chain`]s because of how we build then.
59-
Each [`Keyframe`] is linked together like a chain. The Cosmic Time API doesn't
59+
Each Keyframe is linked together like a chain. The Cosmic Time API doesn't
6060
say "change your width from 10 to 100". We define each state we want the
6161
widget to have `.width(10)` at `Duration::ZERO` then `.width(100)` at
6262
`Duration::from_secs(10)`. Where the `Duration` is the time after the previous
63-
[`keyframe`]. This is why we call the animations chains. We cannot get to the
64-
next state without animating though all previous [`Keyframe`]s.
63+
keyframe. This is why we call the animations chains. We cannot get to the
64+
next state without animating though all previous Keyframes.
6565

6666
> self.timeline.set_chain(animation).start();
6767
@@ -140,6 +140,9 @@ Done:
140140
- [x] Lazy keyframes. (Keyframes that can use the position of a previous (active or not) animation to start another animation.)
141141

142142
TODOs:
143+
- [ ] Add container and space animiations between arbitraty length units.
144+
Example: Length::Shrink to Length::Fixed(10.) and/or Length::Fill to Length::Shrink
145+
Only fixed Length::Fixed(_) are supported currently.
143146
- [ ] Add `Cosmic` cargo feature for compatibility with both iced and System76's temporary fork.
144147
- [ ] Low motion accesability detection to disable animations.
145148
- [ ] general animation logic tests

examples/pong/src/layer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct Layer<'a, Message, Renderer> {
1818
}
1919

2020
impl<'a, Message, Renderer> Layer<'a, Message, Renderer> {
21-
/// Returns a new [`Modal`]
21+
/// Returns a new [`Layer`]
2222
pub fn new(
2323
base: impl Into<Element<'a, Message, Renderer>>,
2424
layer: impl Into<Element<'a, Message, Renderer>>,

src/keyframes/button.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ impl Id {
2121
Self(widget::Id::unique())
2222
}
2323

24-
/// Used by [`chain!`] macro
24+
/// Used by [`crate::chain!`] macro
2525
pub fn into_chain(self) -> Chain {
2626
Chain::new(self)
2727
}
2828

29-
/// Used by [`chain!`] macro
29+
/// Used by [`crate::chain!`] macro
3030
pub fn into_chain_with_children(self, children: Vec<Button>) -> Chain {
3131
Chain::with_children(self, children)
3232
}
3333

34-
/// Used by [`anim!`] macro
34+
/// Used by [`crate::anim!`] macro
3535
pub fn as_widget<'a, Message, Renderer>(
3636
self,
3737
timeline: &crate::Timeline,

src/keyframes/column.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ impl Id {
2121
Self(widget::Id::unique())
2222
}
2323

24-
/// Used by [`chain!`] macro
24+
/// Used by [`crate::chain!`] macro
2525
pub fn into_chain(self) -> Chain {
2626
Chain::new(self)
2727
}
2828

29-
/// Used by [`chain!`] macro
29+
/// Used by [`crate::chain!`] macro
3030
pub fn into_chain_with_children(self, children: Vec<Column>) -> Chain {
3131
Chain::with_children(self, children)
3232
}
3333

34-
/// Used by [`anim!`] macro
34+
/// Used by [`crate::anim!`] macro
3535
pub fn as_widget<'a, Message, Renderer>(
3636
self,
3737
timeline: &crate::Timeline,

src/keyframes/container.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ impl Id {
2121
Self(widget::Id::unique())
2222
}
2323

24-
/// Used by [`chain!`] macro
24+
/// Used by [`crate::chain!`] macro
2525
pub fn into_chain(self) -> Chain {
2626
Chain::new(self)
2727
}
2828

29-
/// Used by [`chain!`] macro
29+
/// Used by [`crate::chain!`] macro
3030
pub fn into_chain_with_children(self, children: Vec<Container>) -> Chain {
3131
Chain::with_children(self, children)
3232
}
3333

34-
/// Used by [`anim!`] macro
34+
/// Used by [`crate::anim!`] macro
3535
pub fn as_widget<'a, Message, Renderer>(
3636
self,
3737
timeline: &crate::Timeline,

src/keyframes/helpers.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@ use crate::keyframes::{Button, Column, Container, Row, Space, StyleButton, Style
22
use crate::MovementType;
33

44
/// Create a button keyframe.
5-
/// Needs to be added into a chain. See [`chain!`] macro.
5+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
66
pub fn button(at: impl Into<MovementType>) -> Button {
77
Button::new(at)
88
}
99

1010
/// Create a column keyframe.
11-
/// Needs to be added into a chain. See [`chain!`] macro.
11+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
1212
pub fn column(at: impl Into<MovementType>) -> Column {
1313
Column::new(at)
1414
}
1515

1616
/// Create a container keyframe.
17-
/// Needs to be added into a chain. See [`chain!`] macro.
17+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
1818
pub fn container(at: impl Into<MovementType>) -> Container {
1919
Container::new(at)
2020
}
2121

2222
/// Create a row keyframe.
23-
/// Needs to be added into a chain. See [`chain!`] macro.
23+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
2424
pub fn row(at: impl Into<MovementType>) -> Row {
2525
Row::new(at)
2626
}
2727

2828
/// Create a space keyframe.
29-
/// Needs to be added into a chain. See [`chain!`] macro.
29+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
3030
pub fn space(at: impl Into<MovementType>) -> Space {
3131
Space::new(at)
3232
}
3333

3434
/// Create a style_button keyframe.
35-
/// Needs to be added into a chain. See [`chain!`] macro.
35+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
3636
pub fn style_button(at: impl Into<MovementType>) -> StyleButton {
3737
StyleButton::new(at)
3838
}
3939

4040
/// Create a style_container keyframe.
41-
/// Needs to be added into a chain. See [`chain!`] macro.
41+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
4242
pub fn style_container(at: impl Into<MovementType>) -> StyleContainer {
4343
StyleContainer::new(at)
4444
}
@@ -49,43 +49,43 @@ pub mod lazy {
4949
use crate::MovementType;
5050

5151
/// Create a lazy button keyframe.
52-
/// Needs to be added into a chain. See [`chain!`] macro.
52+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
5353
pub fn button(at: impl Into<MovementType>) -> Button {
5454
Button::lazy(at)
5555
}
5656

5757
/// Create a lazy column keyframe.
58-
/// Needs to be added into a chain. See [`chain!`] macro.
58+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
5959
pub fn column(at: impl Into<MovementType>) -> Column {
6060
Column::lazy(at)
6161
}
6262

6363
/// Create a lazy container keyframe.
64-
/// Needs to be added into a chain. See [`chain!`] macro.
64+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
6565
pub fn container(at: impl Into<MovementType>) -> Container {
6666
Container::lazy(at)
6767
}
6868

6969
/// Create a lazy row keyframe.
70-
/// Needs to be added into a chain. See [`chain!`] macro.
70+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
7171
pub fn row(at: impl Into<MovementType>) -> Row {
7272
Row::lazy(at)
7373
}
7474

7575
/// Create a lazy space keyframe.
76-
/// Needs to be added into a chain. See [`chain!`] macro.
76+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
7777
pub fn space(at: impl Into<MovementType>) -> Space {
7878
Space::lazy(at)
7979
}
8080

8181
/// Create a lazy style_button keyframe.
82-
/// Needs to be added into a chain. See [`chain!`] macro.
82+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
8383
pub fn style_button(at: impl Into<MovementType>) -> StyleButton {
8484
StyleButton::lazy(at)
8585
}
8686

8787
/// Create a lazy style_container keyframe.
88-
/// Needs to be added into a chain. See [`chain!`] macro.
88+
/// Needs to be added into a chain. See [`crate::chain!`] macro.
8989
pub fn style_container(at: impl Into<MovementType>) -> StyleContainer {
9090
StyleContainer::lazy(at)
9191
}

src/keyframes/row.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ impl Id {
2121
Self(widget::Id::unique())
2222
}
2323

24-
/// Used by [`chain!`] macro
24+
/// Used by [`crate::chain!`] macro
2525
pub fn into_chain(self) -> Chain {
2626
Chain::new(self)
2727
}
2828

29-
/// Used by [`chain!`] macro
29+
/// Used by [`crate::chain!`] macro
3030
pub fn into_chain_with_children(self, children: Vec<Row>) -> Chain {
3131
Chain::with_children(self, children)
3232
}
3333

34-
/// Used by [`anim!`] macro
34+
/// Used by [`crate::anim!`] macro
3535
pub fn as_widget<'a, Message, Renderer>(
3636
self,
3737
timeline: &crate::Timeline,

src/keyframes/space.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ impl Id {
2121
Self(widget::Id::unique())
2222
}
2323

24-
/// Used by [`chain!`] macro
24+
/// Used by [`crate::chain!`] macro
2525
pub fn into_chain(self) -> Chain {
2626
Chain::new(self)
2727
}
2828

29-
/// Used by [`chain!`] macro
29+
/// Used by [`crate::chain!`] macro
3030
pub fn into_chain_with_children(self, children: Vec<Space>) -> Chain {
3131
Chain::with_children(self, children)
3232
}
3333

34-
/// Used by [`anim!`] macro
34+
/// Used by [`crate::anim!`] macro
3535
pub fn as_widget(self, timeline: &crate::Timeline) -> widget::Space {
3636
Space::as_widget(self, timeline)
3737
}

0 commit comments

Comments
 (0)