docs: screenshot
This commit is contained in:
@@ -123,26 +123,6 @@ impl DockerData {
|
||||
}
|
||||
}
|
||||
|
||||
// pub fn sort_containers(i: &mut [ContainerSummary], so: SortedOrder, header: Header) -> &[ContainerSummary] {
|
||||
// match header {
|
||||
// Header::State => {
|
||||
// match so {
|
||||
// SortedOrder::Asc => i.sort_by(|a,b|b.state.cmp(&a.state)),
|
||||
// SortedOrder::Desc => i.sort_by(|a,b|a.state.cmp(&b.state)),
|
||||
// }
|
||||
|
||||
// },
|
||||
// Header::Image => {
|
||||
// match so {
|
||||
// SortedOrder::Asc => i.sort_by(|a,b|b.image.cmp(&a.image)),
|
||||
// SortedOrder::Desc => i.sort_by(|a,b|a.image.cmp(&b.image)),
|
||||
// }
|
||||
// },
|
||||
// _ => ()
|
||||
// }
|
||||
// i
|
||||
// }
|
||||
|
||||
/// Get all current containers, handle into ContainerItem in the app_data struct rather than here
|
||||
/// Just make sure that items sent are guaranteed to have an id
|
||||
/// return Vec<(is_running, id)>
|
||||
@@ -163,9 +143,6 @@ impl DockerData {
|
||||
.filter(|i| i.id.is_some())
|
||||
.for_each(|c| output.push(c.to_owned()));
|
||||
|
||||
// containers.so
|
||||
// let a = Self::sort_containers(&mut output, SortedOrder::Asc, Header::State);
|
||||
|
||||
self.app_data.lock().update_containers(&output);
|
||||
|
||||
let current_sort = self.app_data.lock().get_sorted();
|
||||
|
||||
@@ -123,7 +123,7 @@ impl InputHandler {
|
||||
_ => locked_data.set_sorted(Some((header, SortedOrder::Asc))),
|
||||
}
|
||||
} else {
|
||||
locked_data.set_sorted(Some((header, SortedOrder::Asc)))
|
||||
locked_data.set_sorted(Some((header, SortedOrder::Desc)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,25 +252,15 @@ impl InputHandler {
|
||||
MouseEventKind::ScrollUp => self.previous(),
|
||||
MouseEventKind::ScrollDown => self.next(),
|
||||
MouseEventKind::Down(MouseButton::Left) => {
|
||||
let header_int = self.gui_state.lock().header_intersect(Rect::new(
|
||||
let header_intersects = self.gui_state.lock().header_intersect(Rect::new(
|
||||
mouse_event.column,
|
||||
mouse_event.row,
|
||||
1,
|
||||
1,
|
||||
));
|
||||
|
||||
// Don't like this
|
||||
let order = if let Some((_, or)) = self.app_data.lock().get_sorted() {
|
||||
match or {
|
||||
SortedOrder::Asc => SortedOrder::Desc,
|
||||
SortedOrder::Desc => SortedOrder::Asc,
|
||||
}
|
||||
} else {
|
||||
SortedOrder::Asc
|
||||
};
|
||||
|
||||
if let Some(header) = header_int {
|
||||
self.app_data.lock().set_sorted(Some((header, order)))
|
||||
if let Some(header) = header_intersects {
|
||||
self.sort(header);
|
||||
}
|
||||
|
||||
self.gui_state.lock().panel_intersect(Rect::new(
|
||||
|
||||
@@ -407,8 +407,8 @@ pub fn draw_heading_bar<B: Backend>(
|
||||
if let Some((a, b)) = sorted_by.as_ref() {
|
||||
if x == a {
|
||||
match b {
|
||||
SortedOrder::Asc => suffix = " ⌄",
|
||||
SortedOrder::Desc => suffix = " ⌃",
|
||||
SortedOrder::Asc => suffix = " ⌃",
|
||||
SortedOrder::Desc => suffix = " ⌄",
|
||||
}
|
||||
suffix_margin = 2;
|
||||
color = Color::White
|
||||
|
||||
Reference in New Issue
Block a user