Skip to content

Commit 5feadbd

Browse files
authored
Merge pull request #184 from replydev/fix/terminal_colors
Follow terminal background color on rendering
2 parents ec08b6e + ff113f3 commit 5feadbd

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cotp"
3-
version = "1.2.1"
3+
version = "1.2.2"
44
authors = ["replydev <[email protected]>"]
55
edition = "2021"
66
description = "Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality."

src/interface/app.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,20 @@ impl App {
103103
};
104104
Paragraph::new(element.get_qrcode())
105105
.block(Block::default().title(title).borders(Borders::ALL))
106-
.style(Style::default().fg(Color::White).bg(Color::Black))
106+
.style(Style::default().fg(Color::White).bg(Color::Reset))
107107
.alignment(Alignment::Center)
108108
.wrap(Wrap { trim: true })
109109
} else {
110110
Paragraph::new("No element is selected")
111111
.block(Block::default().title("Nope").borders(Borders::ALL))
112-
.style(Style::default().fg(Color::White).bg(Color::Black))
112+
.style(Style::default().fg(Color::White).bg(Color::Reset))
113113
.alignment(Alignment::Center)
114114
.wrap(Wrap { trim: true })
115115
}
116116
} else {
117117
Paragraph::new("No element is selected")
118118
.block(Block::default().title("Nope").borders(Borders::ALL))
119-
.style(Style::default().fg(Color::White).bg(Color::Black))
119+
.style(Style::default().fg(Color::White).bg(Color::Reset))
120120
.alignment(Alignment::Center)
121121
.wrap(Wrap { trim: true })
122122
};
@@ -138,9 +138,9 @@ impl App {
138138
.direction(Direction::Vertical)
139139
.constraints(
140140
[
141-
Constraint::Length(3), // Search bar
142-
Constraint::Length(height - 3 - 6), // Table + Info Box
143-
Constraint::Length(6), // Progress bar
141+
Constraint::Length(3), // Search bar
142+
Constraint::Length(height - 8), // Table + Info Box
143+
Constraint::Length(1), // Progress bar
144144
]
145145
.as_ref(),
146146
)
@@ -159,7 +159,7 @@ impl App {
159159
Color::White
160160
})),
161161
)
162-
.style(Style::default().fg(Color::White).bg(Color::Black))
162+
.style(Style::default().fg(Color::White).bg(Color::Reset))
163163
.alignment(Alignment::Center)
164164
.wrap(Wrap { trim: true });
165165

@@ -173,14 +173,13 @@ impl App {
173173
.gauge_style(
174174
Style::default()
175175
.bg(Color::White)
176-
.fg(Color::Black)
176+
.fg(Color::DarkGray)
177177
.add_modifier(Modifier::BOLD),
178178
)
179179
.percent(self.progress)
180180
.label(progress_label);
181181

182182
frame.render_widget(search_bar, rects[0]);
183-
//frame.render_stateful_widget(t, rects[1], &mut self.table.state);
184183
self.render_table_box(frame, rects[1]);
185184
frame.render_widget(progress_bar, rects[2]);
186185
if self.focus == Focus::Popup {
@@ -286,7 +285,7 @@ impl App {
286285
);
287286
let paragraph = Paragraph::new(text)
288287
.block(Block::default().title("Code info").borders(Borders::ALL))
289-
.style(Style::default().fg(Color::White).bg(Color::Black))
288+
.style(Style::default().fg(Color::White).bg(Color::Reset))
290289
.alignment(Alignment::Left)
291290
.wrap(Wrap { trim: true });
292291
frame.render_stateful_widget(t, chunks[0], &mut self.table.state);

0 commit comments

Comments
 (0)