Add separators to navbar, part of #335
This commit is contained in:
parent
5d596239be
commit
24a44c3b52
3 changed files with 26 additions and 19 deletions
34
Cargo.lock
generated
34
Cargo.lock
generated
|
|
@ -1213,7 +1213,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"cosmic-config-derive",
|
||||
|
|
@ -1232,7 +1232,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -1339,7 +1339,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"almost",
|
||||
"cosmic-config",
|
||||
|
|
@ -2782,7 +2782,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2801,7 +2801,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_accessibility"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"accesskit_unix",
|
||||
|
|
@ -2811,7 +2811,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"dnd",
|
||||
|
|
@ -2833,7 +2833,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -2846,7 +2846,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"bytemuck",
|
||||
|
|
@ -2870,7 +2870,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -2882,7 +2882,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2896,7 +2896,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_sctk"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"enum-repr",
|
||||
"float-cmp",
|
||||
|
|
@ -2923,7 +2923,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_style"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"once_cell",
|
||||
|
|
@ -2933,7 +2933,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -2950,7 +2950,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"as-raw-xcb-connection",
|
||||
"bitflags 2.6.0",
|
||||
|
|
@ -2979,7 +2979,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2997,7 +2997,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_winit"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -3513,7 +3513,7 @@ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#05da0a83b25e857a85f8ac4e02097d21d367d63d"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"ashpd 0.9.1",
|
||||
|
|
|
|||
|
|
@ -635,6 +635,7 @@ impl App {
|
|||
b.text(fl!("trash"))
|
||||
.icon(widget::icon::icon(tab::trash_icon_symbolic(16)))
|
||||
.data(Location::Trash)
|
||||
.divider_above()
|
||||
});
|
||||
|
||||
// Collect all mounter items
|
||||
|
|
@ -647,7 +648,7 @@ impl App {
|
|||
// Sort by name lexically
|
||||
nav_items.sort_by(|a, b| LANGUAGE_SORTER.compare(&a.1.name(), &b.1.name()));
|
||||
// Add items to nav model
|
||||
for (key, item) in nav_items {
|
||||
for (i, (key, item)) in nav_items.into_iter().enumerate() {
|
||||
nav_model = nav_model.insert(|mut b| {
|
||||
b = b.text(item.name()).data(MounterData(key, item.clone()));
|
||||
if let Some(path) = item.path() {
|
||||
|
|
@ -659,6 +660,9 @@ impl App {
|
|||
if item.is_mounted() {
|
||||
b = b.closable();
|
||||
}
|
||||
if i == 0 {
|
||||
b = b.divider_above();
|
||||
}
|
||||
b
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ impl App {
|
|||
// Sort by name lexically
|
||||
nav_items.sort_by(|a, b| LANGUAGE_SORTER.compare(&a.1.name(), &b.1.name()));
|
||||
// Add items to nav model
|
||||
for (key, item) in nav_items {
|
||||
for (i, (key, item)) in nav_items.into_iter().enumerate() {
|
||||
nav_model = nav_model.insert(|mut b| {
|
||||
b = b.text(item.name()).data(MounterData(key, item.clone()));
|
||||
if let Some(path) = item.path() {
|
||||
|
|
@ -451,6 +451,9 @@ impl App {
|
|||
if item.is_mounted() {
|
||||
b = b.closable();
|
||||
}
|
||||
if i == 0 {
|
||||
b = b.divider_above();
|
||||
}
|
||||
b
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue