Skip to content

Commit

Permalink
Add neon theme & fix help popping up in input mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Reiter committed Sep 15, 2024
1 parent 3746a3e commit 836f40c
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 14 deletions.
82 changes: 82 additions & 0 deletions wireman-theme/resources/skins/neon.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# black #020617
# white #f1f5f9
# gray: #44475a
# neon-magenta: #ff33cc
# neon-green: #00cc66
# neon-orange: #ff9900

[base]
background = "#020617"
foreground = "#f1f5f9"

[border.text.unfocused]
foreground = "#f1f5f9"

[border.text.focused]
foreground = "#f1f5f9"

[navbar.title]
foreground = "#ff33cc"
bold = true

[navbar.tabs.unfocused]
foreground = "#f1f5f9"
background = "#020617"

[navbar.tabs.focused]
foreground = "#020617"
background = "#00cc66"

[list.focused]
foreground = "#020617"
background = "#ff9900"

[history.inactive.unfocused]
foreground = "#44475a"
background = "#020617"

[history.inactive.focused]
foreground = "#020617"
background = "#f1f5f9"

[history.active.unfocused]
foreground = "#ff9900"
background = "#020617"

[history.active.focused]
foreground = "#020617"
background = "#ff9900"

[headers.titles]
foreground = "#f1f5f9"
background = "#020617"
bold = true

[headers.tabs.focused]
foreground = "#020617"
background = "#ff9900"

[editor.selection]
foreground = "#020617"
background = "#ff33cc"

[editor.status_line]
bold = true

[editor.status_line.primary]
foreground = "#020617"
background = "#ff9900"

[editor.status_line.secondary]
background = "#020617"



[footer]
hide = true
# [footer.tabs]
# background = "#6272A4"
# [footer.text]
# foreground = "#44475A"


10 changes: 5 additions & 5 deletions wireman/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ impl App {
Tab::Selection => match self.ctx.selection_tab {
SelectionTab::Services => {
ServicesSelectionEventsHandler::handle_key_event(&mut self.ctx, event);
if event.code == HELP_KEY {
if event.code == HELP_KEY && !self.ctx.disable_root_events {
Self::toggle_help(&mut self.ctx, ServicesSelectionEventsHandler);
}
}
SelectionTab::Methods => {
MethodsSelectionEventsHandler::handle_key_event(&mut self.ctx, event);
if event.code == HELP_KEY {
if event.code == HELP_KEY && !self.ctx.disable_root_events {
Self::toggle_help(&mut self.ctx, MethodsSelectionEventsHandler);
}
}
Expand All @@ -75,20 +75,20 @@ impl App {
},
Tab::Headers => {
HeadersEventHandler::handle_key_event(&mut self.ctx, event);
if event.code == HELP_KEY {
if event.code == HELP_KEY && !self.ctx.disable_root_events {
Self::toggle_help(&mut self.ctx, HeadersEventHandler);
}
}
Tab::Messages => match self.ctx.messages_tab {
MessagesTab::Request => {
RequestEventHandler::handle_key_event(&mut self.ctx, event);
if event.code == HELP_KEY {
if event.code == HELP_KEY && !self.ctx.disable_root_events {
Self::toggle_help(&mut self.ctx, RequestEventHandler);
}
}
MessagesTab::Response => {
ResponseEventHandler::handle_key_event(&mut self.ctx, event);
if event.code == HELP_KEY {
if event.code == HELP_KEY && !self.ctx.disable_root_events {
Self::toggle_help(&mut self.ctx, ResponseEventHandler);
}
}
Expand Down
17 changes: 8 additions & 9 deletions wireman/src/events/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,19 @@ impl EventHandler for HeadersEventHandler {
HeadersTab::Meta => {
if let Some(input) = ctx.headers.borrow_mut().selected_editor_mut() {
input.on_key(key_event.clone().into());
ctx.disable_root_events = !(input.normal_mode());
}
}
HeadersTab::Addr => {
ctx.headers
.borrow_mut()
.addr
.on_key(key_event.clone().into());
let input = &mut ctx.headers.borrow_mut().addr;
input.on_key(key_event.clone().into());
ctx.disable_root_events = !(input.normal_mode());
}
HeadersTab::Auth => {
ctx.headers
.borrow_mut()
.auth
.selected_editor_mut()
.on_key(key_event.clone().into());
let mut headers = ctx.headers.borrow_mut();
let input = headers.auth.selected_editor_mut();
input.on_key(key_event.clone().into());
ctx.disable_root_events = !(input.normal_mode());
}
HeadersTab::None => (),
}
Expand Down

0 comments on commit 836f40c

Please sign in to comment.