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
|
|
@ -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