This commit is contained in:
parent
1e1912d419
commit
20d042d279
5 changed files with 69 additions and 45 deletions
|
|
@ -95,7 +95,10 @@ mod test {
|
|||
let screenshot = bg_path_from_video(video);
|
||||
let screenshot_string =
|
||||
screenshot.to_str().expect("Should be thing");
|
||||
assert_eq!(screenshot_string, "/home/chris/.local/share/lumina/thumbnails/moms-funeral.png");
|
||||
assert_eq!(
|
||||
screenshot_string,
|
||||
"/home/chris/.local/share/lumina/thumbnails/moms-funeral.png"
|
||||
);
|
||||
|
||||
// let runtime = tokio::runtime::Runtime::new().unwrap();
|
||||
let result = bg_from_video(video, &screenshot);
|
||||
|
|
@ -118,6 +121,9 @@ mod test {
|
|||
let screenshot = bg_path_from_video(video);
|
||||
let screenshot_string =
|
||||
screenshot.to_str().expect("Should be thing");
|
||||
assert_ne!(screenshot_string, "/home/chris/.local/share/lumina/thumbnails/All WebDev Sucks and you know it.webm");
|
||||
assert_ne!(
|
||||
screenshot_string,
|
||||
"/home/chris/.local/share/lumina/thumbnails/All WebDev Sucks and you know it.webm"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
29
src/main.rs
29
src/main.rs
|
|
@ -1290,8 +1290,7 @@ impl cosmic::Application for App {
|
|||
let song_editor =
|
||||
self.song_editor.view().map(Message::SongEditor);
|
||||
|
||||
let row = row![
|
||||
library,
|
||||
let service_row = row![
|
||||
service_list,
|
||||
Container::new(
|
||||
button::icon(icon_left)
|
||||
|
|
@ -1325,23 +1324,33 @@ impl cosmic::Application for App {
|
|||
.height(Length::Fill)
|
||||
.spacing(20);
|
||||
|
||||
let column = column![
|
||||
Container::new(row).center_y(Length::Fill),
|
||||
let preview_bar = if self.editor_mode.is_none() {
|
||||
Container::new(
|
||||
self.presenter.preview_bar().map(Message::Present)
|
||||
self.presenter.preview_bar().map(Message::Present),
|
||||
)
|
||||
.clip(true)
|
||||
.width(Length::Fill)
|
||||
.center_y(180)
|
||||
];
|
||||
} else {
|
||||
Container::new(horizontal_space())
|
||||
};
|
||||
|
||||
if let Some(_editor) = &self.editor_mode {
|
||||
let main_area = if let Some(editor) = &self.editor_mode {
|
||||
container(song_editor)
|
||||
.padding(cosmic::theme::spacing().space_xxl)
|
||||
.into()
|
||||
} else {
|
||||
Element::from(column)
|
||||
}
|
||||
Container::new(service_row).center_y(Length::Fill)
|
||||
};
|
||||
|
||||
let column = column![
|
||||
row![
|
||||
library.width(Length::FillPortion(1)),
|
||||
main_area.width(Length::FillPortion(4))
|
||||
],
|
||||
preview_bar
|
||||
];
|
||||
|
||||
column.into()
|
||||
}
|
||||
|
||||
// View for presentation
|
||||
|
|
|
|||
|
|
@ -488,14 +488,15 @@ impl<'a> Library {
|
|||
column({
|
||||
model.items.iter().enumerate().map(
|
||||
|(index, item)| {
|
||||
|
||||
let service_item = item.to_service_item();
|
||||
let visual_item = self
|
||||
.single_item(index, item, model)
|
||||
.map(|()| Message::None);
|
||||
|
||||
DndSource::<Message, ServiceItem>::new({
|
||||
let mouse_area = Element::from(mouse_area(visual_item)
|
||||
.on_drag(Message::DragItem(service_item.clone()))
|
||||
.on_enter(Message::HoverItem(
|
||||
let mouse_area = mouse_area(visual_item);
|
||||
let mouse_area = mouse_area.on_enter(Message::HoverItem(
|
||||
Some((
|
||||
model.kind,
|
||||
index as i32,
|
||||
|
|
@ -514,14 +515,16 @@ impl<'a> Library {
|
|||
model.kind,
|
||||
index as i32,
|
||||
)),
|
||||
)));
|
||||
));
|
||||
|
||||
if let Some(context_id) = self.context_menu {
|
||||
if index == context_id as usize {
|
||||
let menu_items = vec![menu::Item::Button("Delete", None, MenuMessage::Delete((model.kind, index as i32)))];
|
||||
let context_menu = context_menu(
|
||||
mouse_area,
|
||||
self.context_menu.map_or_else(|| None, |_| {
|
||||
Some(menu::items(&self.menu_keys,
|
||||
vec![menu::Item::Button("Delete", None, MenuMessage::Delete((model.kind, index as i32)))]))
|
||||
menu_items))
|
||||
})
|
||||
);
|
||||
Element::from(context_menu)
|
||||
|
|
|
|||
|
|
@ -256,11 +256,13 @@ impl TextSvg {
|
|||
path.push(PathBuf::from("temp"));
|
||||
|
||||
let shadow = if let Some(shadow) = &self.shadow {
|
||||
format!("<filter id=\"shadow\"><feDropShadow dx=\"{}\" dy=\"{}\" stdDeviation=\"{}\" flood-color=\"{}\"/></filter>",
|
||||
format!(
|
||||
"<filter id=\"shadow\"><feDropShadow dx=\"{}\" dy=\"{}\" stdDeviation=\"{}\" flood-color=\"{}\"/></filter>",
|
||||
shadow.offset_x,
|
||||
shadow.offset_y,
|
||||
shadow.spread,
|
||||
shadow.color)
|
||||
shadow.color
|
||||
)
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
|
|
@ -299,13 +301,17 @@ impl TextSvg {
|
|||
.collect();
|
||||
let text: String = text_pieces.join("\n");
|
||||
|
||||
let final_svg = format!("<svg viewBox=\"0 0 {} {}\" xmlns=\"http://www.w3.org/2000/svg\"><defs>{}</defs><text x=\"50%\" y=\"50%\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-weight=\"bold\" font-family=\"{}\" font-size=\"{}\" fill=\"{}\" {} style=\"filter:url(#shadow);\">{}</text></svg>",
|
||||
let final_svg = format!(
|
||||
"<svg viewBox=\"0 0 {} {}\" xmlns=\"http://www.w3.org/2000/svg\"><defs>{}</defs><text x=\"50%\" y=\"50%\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-weight=\"bold\" font-family=\"{}\" font-size=\"{}\" fill=\"{}\" {} style=\"filter:url(#shadow);\">{}</text></svg>",
|
||||
size.width,
|
||||
size.height,
|
||||
shadow,
|
||||
self.font.name,
|
||||
font_size,
|
||||
self.fill, stroke, text);
|
||||
self.fill,
|
||||
stroke,
|
||||
text
|
||||
);
|
||||
|
||||
let hashed_title = rapidhash_v3(final_svg.as_bytes());
|
||||
path.push(PathBuf::from(hashed_title.to_string()));
|
||||
|
|
|
|||
2
todo.org
2
todo.org
|
|
@ -1,7 +1,7 @@
|
|||
#+TITLE: The Task list for Lumina
|
||||
|
||||
|
||||
* TODO [#A] Add removal and reordering of service_items
|
||||
* DONE [#A] Add removal and reordering of service_items
|
||||
Reordering is finished
|
||||
* TODO Add OBS integration
|
||||
This will be based on each slide having the ability to activate an OBS scene when it is active.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue