chore: update dependencies
This commit is contained in:
parent
b3af8bf211
commit
93e31d433a
6 changed files with 453 additions and 396 deletions
158
src/app.rs
158
src/app.rs
|
|
@ -41,7 +41,7 @@ use cosmic::{
|
|||
icon,
|
||||
menu::{action::MenuAction, key_bind::KeyBind},
|
||||
segmented_button::{self, Entity, ReorderEvent},
|
||||
space,
|
||||
settings, space,
|
||||
},
|
||||
};
|
||||
use mime_guess::Mime;
|
||||
|
|
@ -1946,7 +1946,7 @@ impl App {
|
|||
fn network_drive(&self) -> Element<'_, Message> {
|
||||
let cosmic_theme::Spacing {
|
||||
space_xxs, space_m, ..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
let mut table = widget::column::with_capacity(8);
|
||||
for (i, line) in fl!("network-drive-schemes").lines().enumerate() {
|
||||
let mut row = widget::row::with_capacity(2);
|
||||
|
|
@ -1977,25 +1977,23 @@ impl App {
|
|||
fn desktop_view_options(&self) -> Element<'_, Message> {
|
||||
let cosmic_theme::Spacing {
|
||||
space_m, space_l, ..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
let config = self.config.desktop;
|
||||
|
||||
let mut column = widget::column::with_capacity(2);
|
||||
|
||||
let mut section = widget::settings::section().title(fl!("show-on-desktop"));
|
||||
section = section.add(
|
||||
widget::settings::item::builder(fl!("desktop-folder-content")).toggler(
|
||||
config.show_content,
|
||||
move |show_content| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
show_content,
|
||||
..config
|
||||
})
|
||||
},
|
||||
),
|
||||
);
|
||||
section = section.add(
|
||||
widget::settings::item::builder(fl!("mounted-drives")).toggler(
|
||||
let show_on_desktop = settings::section()
|
||||
.title(fl!("show-on-desktop"))
|
||||
.add(
|
||||
settings::item::builder(fl!("desktop-folder-content")).toggler(
|
||||
config.show_content,
|
||||
move |show_content| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
show_content,
|
||||
..config
|
||||
})
|
||||
},
|
||||
),
|
||||
)
|
||||
.add(settings::item::builder(fl!("mounted-drives")).toggler(
|
||||
config.show_mounted_drives,
|
||||
move |show_mounted_drives| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
|
|
@ -2003,10 +2001,8 @@ impl App {
|
|||
..config
|
||||
})
|
||||
},
|
||||
),
|
||||
);
|
||||
section = section.add(
|
||||
widget::settings::item::builder(fl!("trash-folder-icon")).toggler(
|
||||
))
|
||||
.add(settings::item::builder(fl!("trash-folder-icon")).toggler(
|
||||
config.show_trash,
|
||||
move |show_trash| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
|
|
@ -2014,50 +2010,49 @@ impl App {
|
|||
..config
|
||||
})
|
||||
},
|
||||
),
|
||||
);
|
||||
column = column.push(section);
|
||||
));
|
||||
|
||||
let mut section = widget::settings::section().title(fl!("icon-size-and-spacing"));
|
||||
let icon_size = config.icon_size;
|
||||
section = section.add(
|
||||
widget::settings::item::builder(fl!("icon-size"))
|
||||
.description(format!("{icon_size}%"))
|
||||
.control(
|
||||
widget::slider(50..=500, icon_size.get(), move |new_value| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
icon_size: NonZeroU16::new(new_value).unwrap_or(icon_size),
|
||||
..config
|
||||
})
|
||||
})
|
||||
.step(25u16),
|
||||
),
|
||||
);
|
||||
|
||||
let grid_spacing = config.grid_spacing;
|
||||
section = section.add(
|
||||
widget::settings::item::builder(fl!("grid-spacing"))
|
||||
.description(format!("{grid_spacing}%"))
|
||||
.control(
|
||||
widget::slider(50..=500, grid_spacing.get(), move |new_value| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
grid_spacing: NonZeroU16::new(new_value).unwrap_or(grid_spacing),
|
||||
..config
|
||||
let icon_size_and_spacing = settings::section()
|
||||
.title(fl!("icon-size-and-spacing"))
|
||||
.add(
|
||||
settings::item::builder(fl!("icon-size"))
|
||||
.description(format!("{icon_size}%"))
|
||||
.control(
|
||||
widget::slider(50..=500, icon_size.get(), move |new_value| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
icon_size: NonZeroU16::new(new_value).unwrap_or(icon_size),
|
||||
..config
|
||||
})
|
||||
})
|
||||
})
|
||||
.step(25u16),
|
||||
),
|
||||
);
|
||||
column = column.push(section);
|
||||
.step(25u16),
|
||||
),
|
||||
)
|
||||
.add(
|
||||
settings::item::builder(fl!("grid-spacing"))
|
||||
.description(format!("{grid_spacing}%"))
|
||||
.control(
|
||||
widget::slider(50..=500, grid_spacing.get(), move |new_value| {
|
||||
Message::DesktopConfig(DesktopConfig {
|
||||
grid_spacing: NonZeroU16::new(new_value).unwrap_or(grid_spacing),
|
||||
..config
|
||||
})
|
||||
})
|
||||
.step(25u16),
|
||||
),
|
||||
);
|
||||
|
||||
column
|
||||
widget::column::with_capacity(2)
|
||||
.padding([0, space_l, space_l, space_l])
|
||||
.spacing(space_m)
|
||||
.push(show_on_desktop)
|
||||
.push(icon_size_and_spacing)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn edit_history(&self) -> Element<'_, Message> {
|
||||
let cosmic_theme::Spacing { space_m, .. } = theme::active().cosmic().spacing;
|
||||
let cosmic_theme::Spacing { space_m, .. } = theme::spacing();
|
||||
|
||||
let mut children = Vec::new();
|
||||
|
||||
|
|
@ -2149,7 +2144,7 @@ impl App {
|
|||
kind: &'a PreviewKind,
|
||||
context_drawer: bool,
|
||||
) -> Element<'a, tab::Message> {
|
||||
let cosmic_theme::Spacing { space_l, .. } = theme::active().cosmic().spacing;
|
||||
let cosmic_theme::Spacing { space_l, .. } = theme::spacing();
|
||||
|
||||
let mut children = Vec::with_capacity(1);
|
||||
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
|
||||
|
|
@ -2219,8 +2214,8 @@ impl App {
|
|||
let tab_config = self.config.tab;
|
||||
|
||||
// TODO: Should dialog be updated here too?
|
||||
widget::settings::view_column(vec![
|
||||
widget::settings::section()
|
||||
settings::view_column(vec![
|
||||
settings::section()
|
||||
.title(fl!("appearance"))
|
||||
.add({
|
||||
let app_theme_selected = match self.config.app_theme {
|
||||
|
|
@ -2228,7 +2223,7 @@ impl App {
|
|||
AppTheme::Light => 2,
|
||||
AppTheme::System => 0,
|
||||
};
|
||||
widget::settings::item::builder(fl!("theme")).control(widget::dropdown(
|
||||
settings::item::builder(fl!("theme")).control(widget::dropdown(
|
||||
&self.app_themes,
|
||||
Some(app_theme_selected),
|
||||
move |index| {
|
||||
|
|
@ -2241,31 +2236,32 @@ impl App {
|
|||
))
|
||||
})
|
||||
.into(),
|
||||
widget::settings::section()
|
||||
settings::section()
|
||||
.title(fl!("type-to-search"))
|
||||
.add(widget::radio(
|
||||
widget::text::body(fl!("type-to-search-recursive")),
|
||||
TypeToSearch::Recursive,
|
||||
Some(self.config.type_to_search),
|
||||
Message::SetTypeToSearch,
|
||||
))
|
||||
.add(widget::radio(
|
||||
widget::text::body(fl!("type-to-search-enter-path")),
|
||||
TypeToSearch::EnterPath,
|
||||
Some(self.config.type_to_search),
|
||||
Message::SetTypeToSearch,
|
||||
))
|
||||
.add(widget::radio(
|
||||
widget::text::body(fl!("type-to-search-select")),
|
||||
.add(
|
||||
settings::item::builder(fl!("type-to-search-recursive")).radio(
|
||||
TypeToSearch::Recursive,
|
||||
Some(self.config.type_to_search),
|
||||
Message::SetTypeToSearch,
|
||||
),
|
||||
)
|
||||
.add(
|
||||
settings::item::builder(fl!("type-to-search-enter-path")).radio(
|
||||
TypeToSearch::EnterPath,
|
||||
Some(self.config.type_to_search),
|
||||
Message::SetTypeToSearch,
|
||||
),
|
||||
)
|
||||
.add(settings::item::builder(fl!("type-to-search-select")).radio(
|
||||
TypeToSearch::SelectByPrefix,
|
||||
Some(self.config.type_to_search),
|
||||
Message::SetTypeToSearch,
|
||||
))
|
||||
.into(),
|
||||
widget::settings::section()
|
||||
settings::section()
|
||||
.title(fl!("other"))
|
||||
.add({
|
||||
widget::settings::item::builder(fl!("single-click")).toggler(
|
||||
settings::item::builder(fl!("single-click")).toggler(
|
||||
tab_config.single_click,
|
||||
move |single_click| {
|
||||
Message::TabConfig(TabConfig {
|
||||
|
|
@ -2276,7 +2272,7 @@ impl App {
|
|||
)
|
||||
})
|
||||
.add({
|
||||
widget::settings::item::builder(fl!("show-recents"))
|
||||
settings::item::builder(fl!("show-recents"))
|
||||
.toggler(self.config.show_recents, Message::SetShowRecents)
|
||||
})
|
||||
.into(),
|
||||
|
|
@ -5526,7 +5522,7 @@ impl Application for App {
|
|||
|
||||
let cosmic_theme::Spacing {
|
||||
space_xxs, space_s, ..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let dialog = match dialog_page {
|
||||
DialogPage::Compress {
|
||||
|
|
@ -6288,7 +6284,7 @@ impl Application for App {
|
|||
|
||||
let cosmic_theme::Spacing {
|
||||
space_xs, space_s, ..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let mut title = String::new();
|
||||
let mut total_progress = 0.0;
|
||||
|
|
@ -6445,7 +6441,7 @@ impl Application for App {
|
|||
fn view(&self) -> Element<'_, Self::Message> {
|
||||
let cosmic_theme::Spacing {
|
||||
space_xxs, space_s, ..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let mut tab_column = widget::column::with_capacity(4);
|
||||
|
||||
|
|
|
|||
|
|
@ -587,7 +587,7 @@ impl App {
|
|||
space_s,
|
||||
space_l,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
let is_condensed = self.core().is_condensed();
|
||||
|
||||
let mut col = widget::column::with_capacity(2).spacing(space_xxs);
|
||||
|
|
@ -1125,7 +1125,7 @@ impl Application for App {
|
|||
}
|
||||
|
||||
fn dialog(&self) -> Option<Element<'_, Message>> {
|
||||
let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing;
|
||||
let cosmic_theme::Spacing { space_xxs, .. } = theme::spacing();
|
||||
|
||||
//TODO: should gallery view just be a dialog?
|
||||
if self.tab.gallery {
|
||||
|
|
@ -2017,7 +2017,7 @@ impl Application for App {
|
|||
|
||||
/// Creates a view after each update.
|
||||
fn view(&self) -> Element<'_, Message> {
|
||||
let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing;
|
||||
let cosmic_theme::Spacing { space_xxs, .. } = theme::spacing();
|
||||
|
||||
let mut col = widget::column::with_capacity(2);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ macro_rules! menu_button {
|
|||
.height(Length::Fixed(24.0))
|
||||
.align_y(Alignment::Center)
|
||||
)
|
||||
.padding([theme::active().cosmic().spacing.space_xxs, 16])
|
||||
.padding([theme::spacing().space_xxs, 16])
|
||||
.width(Length::Fill)
|
||||
.class(theme::Button::MenuItem)
|
||||
);
|
||||
|
|
@ -579,7 +579,7 @@ pub fn dialog_menu(
|
|||
])
|
||||
.item_height(ItemHeight::Dynamic(40))
|
||||
.item_width(ItemWidth::Uniform(360))
|
||||
.spacing(theme::active().cosmic().spacing.space_xxxs.into())
|
||||
.spacing(theme::spacing().space_xxxs.into())
|
||||
.into()
|
||||
}
|
||||
|
||||
|
|
@ -634,7 +634,7 @@ pub fn menu_bar<'a>(
|
|||
responsive_menu_bar()
|
||||
.item_height(ItemHeight::Dynamic(40))
|
||||
.item_width(ItemWidth::Uniform(360))
|
||||
.spacing(theme::active().cosmic().spacing.space_xxxs.into())
|
||||
.spacing(theme::spacing().space_xxxs.into())
|
||||
.into_element(
|
||||
core,
|
||||
key_binds,
|
||||
|
|
|
|||
20
src/tab.rs
20
src/tab.rs
|
|
@ -2278,7 +2278,7 @@ impl Item {
|
|||
}
|
||||
|
||||
fn preview(&self) -> Element<'_, Message> {
|
||||
let spacing = cosmic::theme::active().cosmic().spacing;
|
||||
let spacing = cosmic::theme::spacing();
|
||||
// This loads the image only if thumbnailing worked
|
||||
let icon = widget::icon::icon(self.icon_handle_grid.clone())
|
||||
.content_fit(ContentFit::Contain)
|
||||
|
|
@ -2339,7 +2339,7 @@ impl Item {
|
|||
space_xxxs,
|
||||
space_m,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let mut column = widget::column::with_capacity(4).spacing(space_m);
|
||||
|
||||
|
|
@ -2517,7 +2517,7 @@ impl Item {
|
|||
}
|
||||
|
||||
pub fn replace_view(&self, heading: String, military_time: bool) -> Element<'_, Message> {
|
||||
let cosmic_theme::Spacing { space_xxxs, .. } = theme::active().cosmic().spacing;
|
||||
let cosmic_theme::Spacing { space_xxxs, .. } = theme::spacing();
|
||||
|
||||
let mut row = widget::row::with_capacity(2).spacing(space_xxxs);
|
||||
row = row.push(self.preview());
|
||||
|
|
@ -4765,7 +4765,7 @@ impl Tab {
|
|||
space_xs,
|
||||
space_m,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
//TODO: display error messages when image not found?
|
||||
let mut name_opt = None;
|
||||
|
|
@ -4963,7 +4963,7 @@ impl Tab {
|
|||
space_s,
|
||||
space_m,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let size = self.size_opt.get().unwrap_or(Size::new(0.0, 0.0));
|
||||
|
||||
|
|
@ -5298,7 +5298,7 @@ impl Tab {
|
|||
}
|
||||
|
||||
pub fn empty_view(&self, has_hidden: bool) -> Element<'_, Message> {
|
||||
let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing;
|
||||
let cosmic_theme::Spacing { space_xxs, .. } = theme::spacing();
|
||||
|
||||
mouse_area::MouseArea::new(widget::column::with_children([widget::container(
|
||||
match self.mode {
|
||||
|
|
@ -5338,7 +5338,7 @@ impl Tab {
|
|||
space_xxs,
|
||||
space_xxxs,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let TabConfig {
|
||||
show_hidden,
|
||||
|
|
@ -5684,7 +5684,7 @@ impl Tab {
|
|||
) {
|
||||
let cosmic_theme::Spacing {
|
||||
space_s, space_xxs, ..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let TabConfig {
|
||||
show_hidden,
|
||||
|
|
@ -6086,7 +6086,7 @@ impl Tab {
|
|||
space_xxs,
|
||||
space_xs,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let location_view_opt = if matches!(self.mode, Mode::Desktop) {
|
||||
None
|
||||
|
|
@ -6282,7 +6282,7 @@ impl Tab {
|
|||
space_xxxs,
|
||||
space_m,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme::spacing();
|
||||
|
||||
let mut column = widget::column::with_capacity(4).spacing(space_m);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue