This commit is contained in:
veeso
2021-03-26 20:38:47 +01:00
parent 08b855e779
commit 5a5d2fb162
8 changed files with 15 additions and 18 deletions

View File

@@ -26,8 +26,8 @@
// Locals
use super::{AuthActivity, Context, FileTransferProtocol};
use crate::ui::layout::components::{
bookmark_list::BookmarkList, msgbox::MsgBox, input::Input, radio_group::RadioGroup, table::Table,
text::Text, title::Title,
bookmark_list::BookmarkList, input::Input, msgbox::MsgBox, radio_group::RadioGroup,
table::Table, text::Text, title::Title,
};
use crate::ui::layout::props::{
InputType, PropValue, PropsBuilder, TableBuilder, TextParts, TextSpan, TextSpanBuilder,

View File

@@ -29,8 +29,8 @@ use super::{Context, SetupActivity, ViewLayout};
use crate::filetransfer::FileTransferProtocol;
use crate::fs::explorer::GroupDirs;
use crate::ui::layout::components::{
bookmark_list::BookmarkList, msgbox::MsgBox, input::Input, radio_group::RadioGroup, table::Table,
text::Text,
bookmark_list::BookmarkList, input::Input, msgbox::MsgBox, radio_group::RadioGroup,
table::Table, text::Text,
};
use crate::ui::layout::props::{
PropValue, PropsBuilder, TableBuilder, TextParts, TextSpan, TextSpanBuilder,

View File

@@ -52,9 +52,9 @@ impl InputHandler {
match self.read_event() {
Ok(ev_opt) => match ev_opt {
Some(ev) => inbox.push(ev),
None => break
None => break,
},
Err(_) => return Err(())
Err(_) => return Err(()),
}
}
Ok(inbox)
@@ -74,7 +74,7 @@ impl InputHandler {
Err(())
}
}
false => Ok(None)
false => Ok(None),
}
} else {
Err(())

View File

@@ -206,8 +206,7 @@ impl Component for Input {
render.render_widget(p, area);
// Set cursor, if focus
if self.states.focus {
let x: u16 =
area.x + (self.states.cursor as u16) + 1;
let x: u16 = area.x + (self.states.cursor as u16) + 1;
render.set_cursor(x, area.y + 1);
}
}

View File

@@ -26,11 +26,7 @@
// locals
use super::{Canvas, Component, InputEvent, Msg, Payload, Props, PropsBuilder};
// ext
use tui::{
layout::Rect,
style::Style,
widgets::Paragraph,
};
use tui::{layout::Rect, style::Style, widgets::Paragraph};
// -- state

View File

@@ -26,8 +26,8 @@
// Modules
pub mod components;
pub mod props;
pub mod view;
pub mod utils;
pub mod view;
// locals
use props::{PropValue, Props, PropsBuilder};

View File

@@ -185,7 +185,9 @@ impl View {
if let Some(active_component) = self.focus.take() {
if active_component != component {
// Blur active component if are different
if let Some(active_component) = self.components.get_mut(active_component.as_str()) {
if let Some(active_component) =
self.components.get_mut(active_component.as_str())
{
active_component.blur();
}
}