Implement open with buttons

This commit is contained in:
Jeremy Soller 2024-03-04 10:39:48 -07:00
parent a54957ddf2
commit ac4626d9cf
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 23 additions and 5 deletions

View file

@ -32,7 +32,7 @@ use std::{
};
use crate::{
app::Action,
app::{self, Action},
config::{IconSizes, TabConfig},
dialog::DialogKind,
fl,
@ -485,7 +485,7 @@ pub struct Item {
}
impl Item {
pub fn open_with_view(&self, sizes: IconSizes) -> Element<crate::app::Message> {
pub fn open_with_view(&self, sizes: IconSizes) -> Element<app::Message> {
let cosmic_theme::Spacing {
space_xs,
space_xxxs,
@ -505,6 +505,8 @@ impl Item {
])
.spacing(space_xs),
)
//TODO: do not clone so much?
.on_press(app::Message::OpenWith(self.path.clone(), app.clone()))
.padding(space_xs)
.width(Length::Fill),
);
@ -513,7 +515,7 @@ impl Item {
column.into()
}
pub fn property_view(&self, sizes: IconSizes) -> Element<crate::app::Message> {
pub fn property_view(&self, sizes: IconSizes) -> Element<app::Message> {
let cosmic_theme::Spacing { space_xxxs, .. } = theme::active().cosmic().spacing;
let mut column = widget::column().spacing(space_xxxs);