parent
1e7e99f499
commit
2dec7fa6b6
|
@ -235,59 +235,29 @@ impl Component for Listing {
|
||||||
}
|
}
|
||||||
UIEvent::Action(ref action) => match action {
|
UIEvent::Action(ref action) => match action {
|
||||||
Action::Listing(ListingAction::SetPlain) => {
|
Action::Listing(ListingAction::SetPlain) => {
|
||||||
let new_l = match self.component {
|
if let Plain(_) = self.component {
|
||||||
Plain(_) => {
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
let mut new_l = PlainListing::default();
|
||||||
Threaded(ref mut l) => {
|
new_l.set_coordinates((self.cursor_pos.0, self.cursor_pos.1, None));
|
||||||
let mut new_l = PlainListing::default();
|
|
||||||
new_l.set_coordinates(l.coordinates());
|
|
||||||
new_l
|
|
||||||
}
|
|
||||||
Compact(ref mut l) => {
|
|
||||||
let mut new_l = PlainListing::default();
|
|
||||||
new_l.set_coordinates(l.coordinates());
|
|
||||||
new_l
|
|
||||||
}
|
|
||||||
};
|
|
||||||
self.component = Plain(new_l);
|
self.component = Plain(new_l);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Action::Listing(ListingAction::SetThreaded) => {
|
Action::Listing(ListingAction::SetThreaded) => {
|
||||||
let new_l = match self.component {
|
if let Threaded(_) = self.component {
|
||||||
Threaded(_) => {
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
let mut new_l = ThreadListing::default();
|
||||||
Plain(ref mut l) => {
|
new_l.set_coordinates((self.cursor_pos.0, self.cursor_pos.1, None));
|
||||||
let mut new_l = ThreadListing::default();
|
|
||||||
new_l.set_coordinates(l.coordinates());
|
|
||||||
new_l
|
|
||||||
}
|
|
||||||
Compact(ref mut l) => {
|
|
||||||
let mut new_l = ThreadListing::default();
|
|
||||||
new_l.set_coordinates(l.coordinates());
|
|
||||||
new_l
|
|
||||||
}
|
|
||||||
};
|
|
||||||
self.component = Threaded(new_l);
|
self.component = Threaded(new_l);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Action::Listing(ListingAction::SetCompact) => {
|
Action::Listing(ListingAction::SetCompact) => {
|
||||||
let new_l = match self.component {
|
if let Compact(_) = self.component {
|
||||||
Compact(_) => {
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
let mut new_l = CompactListing::default();
|
||||||
Threaded(ref mut l) => {
|
new_l.set_coordinates((self.cursor_pos.0, self.cursor_pos.1, None));
|
||||||
let mut new_l = CompactListing::default();
|
|
||||||
new_l.set_coordinates(l.coordinates());
|
|
||||||
new_l
|
|
||||||
}
|
|
||||||
Plain(ref mut l) => {
|
|
||||||
let mut new_l = CompactListing::default();
|
|
||||||
new_l.set_coordinates(l.coordinates());
|
|
||||||
new_l
|
|
||||||
}
|
|
||||||
};
|
|
||||||
self.component = Compact(new_l);
|
self.component = Compact(new_l);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue