Compare commits
3 Commits
9704af3978
...
85e44f0bb8
Author | SHA1 | Date | |
---|---|---|---|
85e44f0bb8 | |||
cbf3aa95a5 | |||
10a9ca166c |
@ -45,7 +45,6 @@
|
||||
"<Ctrl-z>": "Suspend",
|
||||
},
|
||||
"Wallet": {
|
||||
"<q>": "Quit",
|
||||
"<Ctrl-d>": "Quit",
|
||||
"<Ctrl-c>": "Quit",
|
||||
"<Ctrl-z>": "Suspend",
|
||||
|
@ -160,8 +160,8 @@ impl Component for AddAddressBookRecord {
|
||||
fn draw(&mut self, frame: &mut Frame, area: Rect) -> Result<()> {
|
||||
if self.is_active {
|
||||
let size = area.as_size();
|
||||
let name_area = Rect::new(size.width / 2, size.height / 2, 50, 3);
|
||||
let address_area = Rect::new(size.width / 2, size.height / 2 + 3, 50, 3);
|
||||
let name_area = Rect::new(size.width / 2, size.height / 2, 51, 3);
|
||||
let address_area = Rect::new(size.width / 2, size.height / 2 + 3, 51, 3);
|
||||
let (border_style, border_type) = self.palette.create_popup_style();
|
||||
|
||||
let input_name = Paragraph::new(self.name.value())
|
||||
@ -180,8 +180,8 @@ impl Component for AddAddressBookRecord {
|
||||
.title_alignment(Alignment::Right)
|
||||
.title("Address for new name"));
|
||||
|
||||
let v = Layout::vertical([Constraint::Max(3)]).flex(Flex::Center);
|
||||
let h = Layout::horizontal([Constraint::Max(50)]).flex(Flex::Center);
|
||||
let v = Layout::vertical([Constraint::Length(3)]).flex(Flex::Center);
|
||||
let h = Layout::horizontal([Constraint::Length(51)]).flex(Flex::Center);
|
||||
|
||||
let [name_area] = v.areas(name_area);
|
||||
let [name_area] = h.areas(name_area);
|
||||
|
@ -39,18 +39,15 @@ impl EventLogs {
|
||||
const MAX_LOGS: usize = 50;
|
||||
|
||||
fn add_new_log(&mut self, message: String, level: ActionLevel) {
|
||||
self.logs.push_back(WalletLog {
|
||||
self.logs.push_front(WalletLog {
|
||||
time: chrono::Local::now(),
|
||||
level,
|
||||
message,
|
||||
});
|
||||
|
||||
if self.logs.len() > Self::MAX_LOGS {
|
||||
let _ = self.logs.pop_front();
|
||||
let _ = self.logs.pop_back();
|
||||
}
|
||||
|
||||
self.table_state.select(Some(self.logs.len() - 1));
|
||||
self.scroll_state = self.scroll_state.content_length(self.logs.len());
|
||||
}
|
||||
|
||||
fn first_row(&mut self) {
|
||||
|
@ -221,8 +221,8 @@ impl Component for Transfer {
|
||||
fn draw(&mut self, frame: &mut Frame, area: Rect) -> Result<()> {
|
||||
if self.is_active {
|
||||
let size = area.as_size();
|
||||
let receiver_area = Rect::new(size.width / 2, size.height / 2, 50, 3);
|
||||
let amount_area = Rect::new(size.width / 2, size.height / 2 + 3, 50, 3);
|
||||
let receiver_area = Rect::new(size.width / 2, size.height / 2, 51, 3);
|
||||
let amount_area = Rect::new(size.width / 2, size.height / 2 + 3, 51, 3);
|
||||
let (border_style, border_type) = self.palette.create_popup_style();
|
||||
|
||||
let input_receiver = Paragraph::new(self.receiver.value())
|
||||
@ -241,8 +241,8 @@ impl Component for Transfer {
|
||||
.title_alignment(Alignment::Right)
|
||||
.title("Amount to send"));
|
||||
|
||||
let v = Layout::vertical([Constraint::Max(3)]).flex(Flex::Center);
|
||||
let h = Layout::horizontal([Constraint::Max(50)]).flex(Flex::Center);
|
||||
let v = Layout::vertical([Constraint::Length(3)]).flex(Flex::Center);
|
||||
let h = Layout::horizontal([Constraint::Length(51)]).flex(Flex::Center);
|
||||
|
||||
let [receiver_area] = v.areas(receiver_area);
|
||||
let [receiver_area] = h.areas(receiver_area);
|
||||
|
Loading…
Reference in New Issue
Block a user