Compare commits

..

No commits in common. "891ad2587ed73f5d9463837189afaf2e9892fbad" and "bf6add5c67423a74ef97c5abd63a83930b52ca49" have entirely different histories.

5 changed files with 27 additions and 35 deletions

View file

@ -6,13 +6,13 @@ default:
build:
RUST_LOG=debug cargo build
run:
RUST_LOG=debug cargo run -- {{ui}} {{file}}
RUST_LOG=debug cargo run --release -- {{ui}} {{file}}
clean:
RUST_LOG=debug cargo clean
test:
RUST_LOG=debug cargo test --benches --tests --all-features -- --nocapture
profile:
cargo flamegraph --image-width 8000 -- {{ui}} {{file}}
cargo flamegraph --image-width 4000 -- {{ui}} {{file}}
alias r := run
alias c := clean

View file

@ -288,6 +288,22 @@ impl cosmic::Application for App {
}
fn header_start(&self) -> Vec<Element<Self::Message>> {
vec![]
}
fn header_center(&self) -> Vec<Element<Self::Message>> {
vec![search_input("Search...", "")
.on_input(|_| Message::None)
.on_submit(|_| Message::None)
.width(Length::Fill)
.into()]
}
fn header_end(&self) -> Vec<Element<Self::Message>> {
// let editor_toggle = toggler(self.editor_mode.is_some())
// .label("Editor")
// .spacing(10)
// .width(Length::Shrink)
// .on_toggle(Message::EditorToggle);
let presenter_window = self.windows.get(1);
let text = if self.presentation_open {
text::body("End Presentation")
@ -354,30 +370,6 @@ impl cosmic::Application for App {
)
.into(),
horizontal_space().width(HEADER_SPACE).into(),
]
}
fn header_center(&self) -> Vec<Element<Self::Message>> {
vec![search_input("Search...", "")
.on_input(|_| Message::None)
.on_submit(|_| Message::None)
.width(300)
.into()]
}
fn header_end(&self) -> Vec<Element<Self::Message>> {
// let editor_toggle = toggler(self.editor_mode.is_some())
// .label("Editor")
// .spacing(10)
// .width(Length::Shrink)
// .on_toggle(Message::EditorToggle);
let presenter_window = self.windows.get(1);
let text = if self.presentation_open {
text::body("End Presentation")
} else {
text::body("Present")
};
vec![
tooltip(
button::custom(
row!(

View file

@ -4,7 +4,6 @@ use std::{fs::File, io::BufReader, path::PathBuf, sync::Arc};
use cosmic::{
iced::{
alignment::Horizontal,
border,
font::{Family, Stretch, Style, Weight},
Background, Border, Color, ContentFit, Font, Length, Shadow,
Vector,
@ -552,11 +551,12 @@ pub(crate) fn slide_view(
// .text(&slide_text)
// .fill("#fff")
// .shadow(text_svg::shadow(2, 2, 5, "#000000"))
// .stroke(text_svg::stroke(3, "#000"))
// .stroke(text_svg::stroke(1, "#000"))
// .font(font)
// .view()
// .map(|m| Message::None);
// let text = text!("{}", &slide_text);
// text widget based
let lines = slide_text.lines();
let text: Vec<Element<Message>> = lines
@ -566,15 +566,14 @@ pub(crate) fn slide_view(
Background::Color(Color::BLACK)
.scale_alpha(0.4),
)
.border(border::rounded(10))
.padding(10)])
.padding(1)])
.size(font_size)
.font(font)
.center()
.into()
})
.collect();
let text = Column::with_children(text).spacing(26);
let text = Column::with_children(text).spacing(6);
//Next
let text_container = Container::new(text)

View file

@ -218,7 +218,7 @@ impl TextSvg {
};
let stroke = if let Some(stroke) = &self.stroke {
format!(
"stroke=\"{}\" stroke-width=\"{}px\" stroke-linejoin=\"arcs\" paint-order=\"stroke\"",
"stroke=\"{}\" stroke-width=\"{}\"",
stroke.color, stroke.size
)
} else {
@ -249,16 +249,17 @@ impl TextSvg {
self.fill, stroke, text);
// debug!(final_svg);
Svg::new(Handle::from_memory(
lazy(self.clone(), move |_s| Svg::new(Handle::from_memory(
Box::leak(<std::string::String as Clone>::clone(&final_svg).into_boxed_str()).as_bytes(),
))
.width(Length::Fill)
.height(Length::Fill)
.height(Length::Fill))
.into()
})).width(Length::Fill).height(Length::Fill).into()
}
fn text_spans(&self) -> Vec<String> {
let total_lines = self.text.lines().count();
self.text
.lines()
.enumerate()

View file

@ -4,7 +4,7 @@
(slide (video :source "~/vids/The Basics of Hanging Drywall.mkv" :fit contain))
(slide (video :source "~/vids/Ladybird Is The Future Of Web Browsers.webm" :fit contain))
(song :id 7 :author "North Point Worship"
:font "Quicksand Bold" :font-size 60
:font "Quicksand Bold" :font-size 30
:shadow "" :stroke ""
:title "Death Was Arrested"
:background (image :source "file:///home/chris/nc/tfc/openlp/CMG - Bright Mountains 01.jpg" :fit cover)