updates
This commit is contained in:
parent
df944f980c
commit
bbaa35cb46
1112
Cargo.lock
generated
1112
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
10
src/main.rs
10
src/main.rs
|
@ -88,7 +88,7 @@ struct App {
|
||||||
current_slide: Slide,
|
current_slide: Slide,
|
||||||
presentation_open: bool,
|
presentation_open: bool,
|
||||||
cli_mode: bool,
|
cli_mode: bool,
|
||||||
library: Library,
|
// library: Library,
|
||||||
library_open: bool,
|
library_open: bool,
|
||||||
library_width: f32,
|
library_width: f32,
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ impl cosmic::Application for App {
|
||||||
current_slide,
|
current_slide,
|
||||||
presentation_open: false,
|
presentation_open: false,
|
||||||
cli_mode: !input.ui,
|
cli_mode: !input.ui,
|
||||||
library: Library::new(&items),
|
// library: Library::new(&items),
|
||||||
library_open: true,
|
library_open: true,
|
||||||
library_width: 60.0,
|
library_width: 60.0,
|
||||||
};
|
};
|
||||||
|
@ -550,9 +550,9 @@ impl cosmic::Application for App {
|
||||||
]
|
]
|
||||||
.spacing(3);
|
.spacing(3);
|
||||||
|
|
||||||
let library = Container::new(self.library.view())
|
// let library = Container::new(self.library.view())
|
||||||
.center(Length::Fill)
|
// .center(Length::Fill)
|
||||||
.width(self.library_width);
|
// .width(self.library_width);
|
||||||
// let drag_handle = Container::new(Space::new(1, Length::Fill))
|
// let drag_handle = Container::new(Space::new(1, Length::Fill))
|
||||||
// .style(|t| nav_bar_style(t));
|
// .style(|t| nav_bar_style(t));
|
||||||
// let dragger = MouseArea::new(drag_handle)
|
// let dragger = MouseArea::new(drag_handle)
|
||||||
|
|
|
@ -9,16 +9,18 @@ use cosmic::{
|
||||||
Background, Border, Color, ContentFit, Font, Length, Shadow,
|
Background, Border, Color, ContentFit, Font, Length, Shadow,
|
||||||
Vector,
|
Vector,
|
||||||
},
|
},
|
||||||
|
iced_core::text::Span,
|
||||||
iced_widget::{
|
iced_widget::{
|
||||||
|
rich_text,
|
||||||
scrollable::{
|
scrollable::{
|
||||||
scroll_to, AbsoluteOffset, Direction, Scrollbar,
|
scroll_to, AbsoluteOffset, Direction, Scrollbar,
|
||||||
},
|
},
|
||||||
stack,
|
span, stack,
|
||||||
},
|
},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
widget::{
|
widget::{
|
||||||
container, image, mouse_area, responsive, scrollable, text,
|
container, image, mouse_area, responsive, scrollable, Column,
|
||||||
Column, Container, Id, Responsive, Row, Space,
|
Container, Id, Row, Space,
|
||||||
},
|
},
|
||||||
Task,
|
Task,
|
||||||
};
|
};
|
||||||
|
@ -492,38 +494,36 @@ impl Presenter {
|
||||||
);
|
);
|
||||||
let slide_text = slide.text();
|
let slide_text = slide.text();
|
||||||
let lines = slide_text.lines();
|
let lines = slide_text.lines();
|
||||||
let line_size = lines.clone().count();
|
// let line_size = lines.clone().count();
|
||||||
// debug!(?lines);
|
// debug!(?lines);
|
||||||
let text: Vec<Element<Message>> = lines
|
let text: Vec<Span<Message>> = lines
|
||||||
.map(|t| {
|
.map(|t| {
|
||||||
text(t.to_string())
|
span(format!("{}\n", t.to_string()))
|
||||||
.size(font_size)
|
.background(
|
||||||
.font(font)
|
Background::Color(Color::BLACK)
|
||||||
.width(Length::Fill)
|
.scale_alpha(0.3),
|
||||||
.align_x(Horizontal::Center)
|
)
|
||||||
.into()
|
.padding(3)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let texts = Column::with_children(text);
|
let text_container =
|
||||||
|
rich_text(text).size(font_size).font(font).center();
|
||||||
// let text = text(slide.text())
|
// let text = text(slide.text())
|
||||||
// .size(font_size)
|
// .size(font_size)
|
||||||
// .font(font)
|
// .font(font)
|
||||||
// .align_x(Horizontal::Center);
|
// .align_x(Horizontal::Center);
|
||||||
let text = Container::new(texts).center(Length::Fill);
|
// let text_background = Container::new(Space::new(0, 0))
|
||||||
let text_background = Container::new(Space::new(0, 0))
|
// .style(|_| {
|
||||||
.style(|_| {
|
// container::background(
|
||||||
container::background(
|
// Background::Color(Color::BLACK)
|
||||||
Background::Color(Color::BLACK)
|
// .scale_alpha(0.3),
|
||||||
.scale_alpha(0.3),
|
// )
|
||||||
)
|
// })
|
||||||
})
|
// .width(size.width)
|
||||||
.width(size.width)
|
// .height(
|
||||||
.height(
|
// font_size * line_size as f32 * line_size as f32,
|
||||||
font_size * line_size as f32 * line_size as f32,
|
// );
|
||||||
);
|
// let text_stack = stack!(text_background, text);
|
||||||
let text_stack = stack!(text_background, text);
|
|
||||||
let text_container =
|
|
||||||
Container::new(text_stack).center(Length::Fill);
|
|
||||||
let black = Container::new(Space::new(0, 0))
|
let black = Container::new(Space::new(0, 0))
|
||||||
.style(|_| {
|
.style(|_| {
|
||||||
container::background(Background::Color(
|
container::background(Background::Color(
|
||||||
|
|
2
todo.org
2
todo.org
|
@ -7,6 +7,8 @@
|
||||||
* TODO Develop library system for slides that are more than images or video i.e. content
|
* TODO Develop library system for slides that are more than images or video i.e. content
|
||||||
* TODO Functions for text alignments
|
* TODO Functions for text alignments
|
||||||
This will need to be matched on for the =TextAlignment= from the user
|
This will need to be matched on for the =TextAlignment= from the user
|
||||||
|
* TODO Use Rich Text instead of normal text for slides
|
||||||
|
This will make it so that we can add styling to the text like borders and backgrounds or highlights. Maybe in the future it'll add shadows too.
|
||||||
* TODO Find a way to load and discover every font on the system for slide building
|
* TODO Find a way to load and discover every font on the system for slide building
|
||||||
This may not be necessary since it is possible to create a font using =Box::leak()=.
|
This may not be necessary since it is possible to create a font using =Box::leak()=.
|
||||||
#+begin_src rust
|
#+begin_src rust
|
||||||
|
|
Loading…
Reference in a new issue