parent
191dd0255d
commit
2413b96791
9 changed files with 45 additions and 70 deletions
|
|
@ -264,7 +264,8 @@ impl<'a> Library {
|
|||
let video_library = self.library_item(&self.video_library);
|
||||
let presentation_library =
|
||||
self.library_item(&self.presentation_library);
|
||||
let column = column![
|
||||
|
||||
column![
|
||||
text::heading("Library").center().width(Length::Fill),
|
||||
cosmic::iced::widget::horizontal_rule(1),
|
||||
song_library,
|
||||
|
|
@ -275,8 +276,7 @@ impl<'a> Library {
|
|||
.height(Length::Fill)
|
||||
.padding(10)
|
||||
.spacing(10)
|
||||
.into();
|
||||
column
|
||||
.into()
|
||||
}
|
||||
|
||||
pub fn library_item<T>(
|
||||
|
|
@ -481,25 +481,23 @@ impl<'a> Library {
|
|||
.accent_text_color()
|
||||
.into()
|
||||
}
|
||||
} else {
|
||||
if let Some((library, selected)) = self.selected_item
|
||||
} else if let Some((library, selected)) = self.selected_item
|
||||
{
|
||||
if model.kind == library
|
||||
&& selected == index as i32
|
||||
{
|
||||
if model.kind == library
|
||||
&& selected == index as i32
|
||||
{
|
||||
theme::active().cosmic().control_0().into()
|
||||
} else {
|
||||
theme::active()
|
||||
.cosmic()
|
||||
.destructive_text_color()
|
||||
.into()
|
||||
}
|
||||
theme::active().cosmic().control_0().into()
|
||||
} else {
|
||||
theme::active()
|
||||
.cosmic()
|
||||
.destructive_text_color()
|
||||
.into()
|
||||
}
|
||||
} else {
|
||||
theme::active()
|
||||
.cosmic()
|
||||
.destructive_text_color()
|
||||
.into()
|
||||
};
|
||||
text::body(elide_text(item.subtext(), size.width))
|
||||
.center()
|
||||
|
|
@ -529,20 +527,18 @@ impl<'a> Library {
|
|||
&& selected == index as i32
|
||||
{
|
||||
t.cosmic().accent.selected.into()
|
||||
} else {
|
||||
if let Some((library, hovered)) =
|
||||
self.hovered_item
|
||||
} else if let Some((library, hovered)) =
|
||||
self.hovered_item
|
||||
{
|
||||
if model.kind == library
|
||||
&& hovered == index as i32
|
||||
{
|
||||
if model.kind == library
|
||||
&& hovered == index as i32
|
||||
{
|
||||
t.cosmic().button.hover.into()
|
||||
} else {
|
||||
t.cosmic().button.base.into()
|
||||
}
|
||||
t.cosmic().button.hover.into()
|
||||
} else {
|
||||
t.cosmic().button.base.into()
|
||||
}
|
||||
} else {
|
||||
t.cosmic().button.base.into()
|
||||
}
|
||||
} else if let Some((library, hovered)) =
|
||||
self.hovered_item
|
||||
|
|
|
|||
|
|
@ -3,23 +3,18 @@ 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,
|
||||
},
|
||||
iced_widget::{
|
||||
rich_text,
|
||||
scrollable::{
|
||||
scroll_to, AbsoluteOffset, Direction, Scrollbar,
|
||||
},
|
||||
span, stack, vertical_rule,
|
||||
}, stack, vertical_rule,
|
||||
},
|
||||
prelude::*,
|
||||
widget::{
|
||||
container, image, mouse_area, responsive, scrollable, text,
|
||||
Column, Container, Id, Image, Row, Space,
|
||||
container, image, mouse_area, responsive, scrollable, text, Container, Id, Row, Space,
|
||||
},
|
||||
Task,
|
||||
};
|
||||
|
|
@ -33,8 +28,6 @@ use crate::{
|
|||
BackgroundKind,
|
||||
};
|
||||
|
||||
use crate::ui::pdf::PdfViewer;
|
||||
|
||||
const REFERENCE_WIDTH: f32 = 1920.0;
|
||||
const REFERENCE_HEIGHT: f32 = 1080.0;
|
||||
|
||||
|
|
@ -448,7 +441,7 @@ impl Presenter {
|
|||
);
|
||||
|
||||
let container = slide_view(
|
||||
&slide,
|
||||
slide,
|
||||
&self.video,
|
||||
font,
|
||||
true,
|
||||
|
|
@ -799,13 +792,11 @@ pub(crate) fn slide_view<'a>(
|
|||
.center_x(width)
|
||||
.center_y(size.height)
|
||||
.clip(true)
|
||||
.into()
|
||||
} else {
|
||||
Container::new(Space::new(0.0, 0.0))
|
||||
.center_x(width)
|
||||
.center_y(size.height)
|
||||
.clip(true)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
BackgroundKind::Html => todo!(),
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@ use std::{io, path::PathBuf};
|
|||
|
||||
use cosmic::{
|
||||
iced::{Color, Font, Length, Size},
|
||||
prelude::*,
|
||||
widget::{
|
||||
self,
|
||||
canvas::{self, Program, Stroke},
|
||||
container, Canvas,
|
||||
container,
|
||||
},
|
||||
Renderer,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ use cosmic::{
|
|||
iced_widget::row,
|
||||
theme,
|
||||
widget::{
|
||||
button, column, combo_box, container, horizontal_space, icon,
|
||||
scrollable, text, text_editor, text_input,
|
||||
button, column, combo_box, container, horizontal_space, icon, text, text_editor, text_input,
|
||||
},
|
||||
Element, Task,
|
||||
};
|
||||
|
|
@ -21,11 +20,10 @@ use tracing::{debug, error};
|
|||
|
||||
use crate::{
|
||||
core::{service_items::ServiceTrait, songs::Song},
|
||||
ui::slide_editor::{self, SlideEditor},
|
||||
ui::slide_editor::SlideEditor,
|
||||
Background, BackgroundKind,
|
||||
};
|
||||
|
||||
use super::presenter::slide_view;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SongEditor {
|
||||
|
|
@ -329,7 +327,6 @@ impl SongEditor {
|
|||
self.slide_state
|
||||
.view(Font::with_name("Quicksand Bold"))
|
||||
.map(|_s| Message::None)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn left_column(&self) -> Element<Message> {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use std::{
|
||||
fmt::Display,
|
||||
hash::{Hash, Hasher},
|
||||
io::Read,
|
||||
path::PathBuf,
|
||||
sync::Arc,
|
||||
};
|
||||
|
|
@ -13,7 +12,7 @@ use cosmic::{
|
|||
ContentFit, Length, Size,
|
||||
},
|
||||
prelude::*,
|
||||
widget::{container, image::Handle, Image},
|
||||
widget::{image::Handle, Image},
|
||||
};
|
||||
use rapidhash::v3::rapidhash_v3;
|
||||
use resvg::{
|
||||
|
|
@ -312,7 +311,7 @@ impl TextSvg {
|
|||
|
||||
debug!("text string built...");
|
||||
let resvg_tree = Tree::from_data(
|
||||
&final_svg.as_bytes(),
|
||||
final_svg.as_bytes(),
|
||||
&resvg::usvg::Options {
|
||||
fontdb: Arc::clone(&self.fontdb),
|
||||
..Default::default()
|
||||
|
|
@ -385,7 +384,7 @@ pub fn text_svg_generator(
|
|||
slide: &mut crate::core::slide::Slide,
|
||||
fontdb: Arc<fontdb::Database>,
|
||||
) {
|
||||
if slide.text().len() > 0 {
|
||||
if !slide.text().is_empty() {
|
||||
let text_svg = TextSvg::new(slide.text())
|
||||
.alignment(slide.text_alignment())
|
||||
.fill("#fff")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue