summaryrefslogtreecommitdiffstats
path: root/src/display/components/layout.rs
diff options
context:
space:
mode:
authorLouis Lesage <31346705+Louis-Lesage@users.noreply.github.com>2020-05-17 16:40:04 -0400
committerGitHub <noreply@github.com>2020-05-17 22:40:04 +0200
commit55e8885302172ccf0a79bc9829d339acfdc3564d (patch)
treec0c96671526c7623d9d036877cd9f123e7167e9c /src/display/components/layout.rs
parente6bb39a5e992498e00bc3af47d92352865e3223d (diff)
feat(layout): 'Window' ordering ability (#118)
* Window ordering ability Added ability to change display order of the windows using tab. Added a help tooltip. * fix redundant clone * fix fmt check * cargo fmt fix 2 * Fixed help layout and added tests * Fix fmt check
Diffstat (limited to 'src/display/components/layout.rs')
-rw-r--r--src/display/components/layout.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/display/components/layout.rs b/src/display/components/layout.rs
index c047774..79186cd 100644
--- a/src/display/components/layout.rs
+++ b/src/display/components/layout.rs
@@ -99,12 +99,12 @@ impl<'a> Layout<'a> {
self.build_three_children_layout(rect)
}
}
- pub fn render(&self, frame: &mut Frame<impl Backend>, rect: Rect) {
+ pub fn render(&self, frame: &mut Frame<impl Backend>, rect: Rect, ui_offset: usize) {
let (top, app, bottom) = top_app_and_bottom_split(rect);
let layout_slots = self.build_layout(app);
for i in 0..layout_slots.len() {
if let Some(rect) = layout_slots.get(i) {
- if let Some(child) = self.children.get(i) {
+ if let Some(child) = self.children.get((i + ui_offset) % self.children.len()) {
child.render(frame, *rect);
}
}