Compare commits

...

3 Commits

Author SHA1 Message Date
85e44f0bb8
additional spaces needed, because borders are symbols too
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-12-25 14:25:09 +03:00
cbf3aa95a5
the worst fix ever, disable 'q' for Quit
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-12-25 14:23:37 +03:00
10a9ca166c
inverse the logs queue, ascending order for events
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-12-25 13:18:08 +03:00
4 changed files with 10 additions and 14 deletions

View File

@ -45,7 +45,6 @@
"<Ctrl-z>": "Suspend",
},
"Wallet": {
"<q>": "Quit",
"<Ctrl-d>": "Quit",
"<Ctrl-c>": "Quit",
"<Ctrl-z>": "Suspend",

View File

@ -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);

View File

@ -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) {

View File

@ -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);