Improve style of completions
This commit is contained in:
parent
6612c5203e
commit
121e9f5cf4
1 changed files with 9 additions and 5 deletions
14
src/tab.rs
14
src/tab.rs
|
|
@ -266,7 +266,6 @@ fn tab_complete(path: &Path) -> Result<Vec<(String, PathBuf)>, Box<dyn Error>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
completions.sort_by(|a, b| LANGUAGE_SORTER.compare(&a.0, &b.0));
|
completions.sort_by(|a, b| LANGUAGE_SORTER.compare(&a.0, &b.0));
|
||||||
println!("{:?}", completions);
|
|
||||||
Ok(completions)
|
Ok(completions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3116,7 +3115,7 @@ impl Tab {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if location != self.location {
|
if location != self.location || selected_paths.is_some() {
|
||||||
if location.path_opt().map_or(true, |path| path.is_dir()) {
|
if location.path_opt().map_or(true, |path| path.is_dir()) {
|
||||||
if selected_paths.is_none() {
|
if selected_paths.is_none() {
|
||||||
selected_paths = self
|
selected_paths = self
|
||||||
|
|
@ -3585,15 +3584,20 @@ impl Tab {
|
||||||
let selected = edit_location.selected == Some(i);
|
let selected = edit_location.selected == Some(i);
|
||||||
column = column.push(
|
column = column.push(
|
||||||
widget::button::custom(widget::text::body(name))
|
widget::button::custom(widget::text::body(name))
|
||||||
.class(button_style(selected, false, false, false, false))
|
//TODO: match to design
|
||||||
|
.class(if selected {
|
||||||
|
theme::Button::Standard
|
||||||
|
} else {
|
||||||
|
theme::Button::ListItem
|
||||||
|
})
|
||||||
.on_press(Message::EditLocationComplete(i))
|
.on_press(Message::EditLocationComplete(i))
|
||||||
.padding(space_xxs)
|
.padding(space_xxs)
|
||||||
.width(Length::Fill),
|
.width(Length::Fill),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
popover = popover.popup(
|
popover = popover.popup(
|
||||||
widget::layer_container(column)
|
widget::container(column)
|
||||||
.layer(cosmic_theme::Layer::Background)
|
.class(theme::Container::Dropdown)
|
||||||
//TODO: This is a hack to get the popover to be the right width
|
//TODO: This is a hack to get the popover to be the right width
|
||||||
.max_width(size.width - 124.0),
|
.max_width(size.width - 124.0),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue