mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Added misc_info_dialog to themes
This commit is contained in:
@@ -254,6 +254,9 @@ impl SetupActivity {
|
||||
super::COMPONENT_COLOR_MISC_ERROR => {
|
||||
theme.misc_error_dialog = color;
|
||||
}
|
||||
super::COMPONENT_COLOR_MISC_INFO => {
|
||||
theme.misc_info_dialog = color;
|
||||
}
|
||||
super::COMPONENT_COLOR_MISC_INPUT => {
|
||||
theme.misc_input_dialog = color;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ const COMPONENT_COLOR_AUTH_PROTOCOL: &str = "COMPONENT_COLOR_AUTH_PROTOCOL";
|
||||
const COMPONENT_COLOR_AUTH_RECENTS: &str = "COMPONENT_COLOR_AUTH_RECENTS";
|
||||
const COMPONENT_COLOR_AUTH_USERNAME: &str = "COMPONENT_COLOR_AUTH_USERNAME";
|
||||
const COMPONENT_COLOR_MISC_ERROR: &str = "COMPONENT_COLOR_MISC_ERROR";
|
||||
const COMPONENT_COLOR_MISC_INFO: &str = "COMPONENT_COLOR_MISC_INFO";
|
||||
const COMPONENT_COLOR_MISC_INPUT: &str = "COMPONENT_COLOR_MISC_INPUT";
|
||||
const COMPONENT_COLOR_MISC_KEYS: &str = "COMPONENT_COLOR_MISC_KEYS";
|
||||
const COMPONENT_COLOR_MISC_QUIT: &str = "COMPONENT_COLOR_MISC_QUIT";
|
||||
|
||||
@@ -31,8 +31,8 @@ use super::{
|
||||
SetupActivity, ViewLayout, COMPONENT_COLOR_AUTH_ADDR, COMPONENT_COLOR_AUTH_BOOKMARKS,
|
||||
COMPONENT_COLOR_AUTH_PASSWORD, COMPONENT_COLOR_AUTH_PORT, COMPONENT_COLOR_AUTH_PROTOCOL,
|
||||
COMPONENT_COLOR_AUTH_RECENTS, COMPONENT_COLOR_AUTH_USERNAME, COMPONENT_COLOR_MISC_ERROR,
|
||||
COMPONENT_COLOR_MISC_INPUT, COMPONENT_COLOR_MISC_KEYS, COMPONENT_COLOR_MISC_QUIT,
|
||||
COMPONENT_COLOR_MISC_SAVE, COMPONENT_COLOR_MISC_WARN,
|
||||
COMPONENT_COLOR_MISC_INFO, COMPONENT_COLOR_MISC_INPUT, COMPONENT_COLOR_MISC_KEYS,
|
||||
COMPONENT_COLOR_MISC_QUIT, COMPONENT_COLOR_MISC_SAVE, COMPONENT_COLOR_MISC_WARN,
|
||||
COMPONENT_COLOR_TRANSFER_EXPLORER_LOCAL_BG, COMPONENT_COLOR_TRANSFER_EXPLORER_LOCAL_FG,
|
||||
COMPONENT_COLOR_TRANSFER_EXPLORER_LOCAL_HG, COMPONENT_COLOR_TRANSFER_EXPLORER_REMOTE_BG,
|
||||
COMPONENT_COLOR_TRANSFER_EXPLORER_REMOTE_FG, COMPONENT_COLOR_TRANSFER_EXPLORER_REMOTE_HG,
|
||||
@@ -441,6 +441,10 @@ impl SetupActivity {
|
||||
None
|
||||
}
|
||||
(COMPONENT_COLOR_MISC_ERROR, key) if key == &MSG_KEY_DOWN => {
|
||||
self.view.active(COMPONENT_COLOR_MISC_INFO);
|
||||
None
|
||||
}
|
||||
(COMPONENT_COLOR_MISC_INFO, key) if key == &MSG_KEY_DOWN => {
|
||||
self.view.active(COMPONENT_COLOR_MISC_INPUT);
|
||||
None
|
||||
}
|
||||
@@ -551,10 +555,14 @@ impl SetupActivity {
|
||||
self.view.active(COMPONENT_COLOR_AUTH_RECENTS);
|
||||
None
|
||||
}
|
||||
(COMPONENT_COLOR_MISC_INPUT, key) if key == &MSG_KEY_UP => {
|
||||
(COMPONENT_COLOR_MISC_INFO, key) if key == &MSG_KEY_UP => {
|
||||
self.view.active(COMPONENT_COLOR_MISC_ERROR);
|
||||
None
|
||||
}
|
||||
(COMPONENT_COLOR_MISC_INPUT, key) if key == &MSG_KEY_UP => {
|
||||
self.view.active(COMPONENT_COLOR_MISC_INFO);
|
||||
None
|
||||
}
|
||||
(COMPONENT_COLOR_MISC_KEYS, key) if key == &MSG_KEY_UP => {
|
||||
self.view.active(COMPONENT_COLOR_MISC_INPUT);
|
||||
None
|
||||
|
||||
@@ -70,6 +70,7 @@ impl SetupActivity {
|
||||
// Misc
|
||||
self.mount_title(super::COMPONENT_COLOR_MISC_TITLE, "Misc styles");
|
||||
self.mount_color_picker(super::COMPONENT_COLOR_MISC_ERROR, "Error");
|
||||
self.mount_color_picker(super::COMPONENT_COLOR_MISC_INFO, "Info dialogs");
|
||||
self.mount_color_picker(super::COMPONENT_COLOR_MISC_INPUT, "Input fields");
|
||||
self.mount_color_picker(super::COMPONENT_COLOR_MISC_KEYS, "Key strokes");
|
||||
self.mount_color_picker(super::COMPONENT_COLOR_MISC_QUIT, "Quit dialogs");
|
||||
@@ -222,12 +223,12 @@ impl SetupActivity {
|
||||
[
|
||||
Constraint::Length(1), // Title
|
||||
Constraint::Length(3), // Error
|
||||
Constraint::Length(3), // Info
|
||||
Constraint::Length(3), // Input
|
||||
Constraint::Length(3), // Keys
|
||||
Constraint::Length(3), // Quit
|
||||
Constraint::Length(3), // Save
|
||||
Constraint::Length(3), // Warn
|
||||
Constraint::Length(3), // Empty
|
||||
]
|
||||
.as_ref(),
|
||||
)
|
||||
@@ -237,15 +238,17 @@ impl SetupActivity {
|
||||
self.view
|
||||
.render(super::COMPONENT_COLOR_MISC_ERROR, f, misc_colors_layout[1]);
|
||||
self.view
|
||||
.render(super::COMPONENT_COLOR_MISC_INPUT, f, misc_colors_layout[2]);
|
||||
.render(super::COMPONENT_COLOR_MISC_INFO, f, misc_colors_layout[2]);
|
||||
self.view
|
||||
.render(super::COMPONENT_COLOR_MISC_KEYS, f, misc_colors_layout[3]);
|
||||
.render(super::COMPONENT_COLOR_MISC_INPUT, f, misc_colors_layout[3]);
|
||||
self.view
|
||||
.render(super::COMPONENT_COLOR_MISC_QUIT, f, misc_colors_layout[4]);
|
||||
.render(super::COMPONENT_COLOR_MISC_KEYS, f, misc_colors_layout[4]);
|
||||
self.view
|
||||
.render(super::COMPONENT_COLOR_MISC_SAVE, f, misc_colors_layout[5]);
|
||||
.render(super::COMPONENT_COLOR_MISC_QUIT, f, misc_colors_layout[5]);
|
||||
self.view
|
||||
.render(super::COMPONENT_COLOR_MISC_WARN, f, misc_colors_layout[6]);
|
||||
.render(super::COMPONENT_COLOR_MISC_SAVE, f, misc_colors_layout[6]);
|
||||
self.view
|
||||
.render(super::COMPONENT_COLOR_MISC_WARN, f, misc_colors_layout[7]);
|
||||
|
||||
let transfer_colors_layout_col1 = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
@@ -405,6 +408,7 @@ impl SetupActivity {
|
||||
self.update_color(super::COMPONENT_COLOR_AUTH_RECENTS, theme.auth_recents);
|
||||
self.update_color(super::COMPONENT_COLOR_AUTH_USERNAME, theme.auth_username);
|
||||
self.update_color(super::COMPONENT_COLOR_MISC_ERROR, theme.misc_error_dialog);
|
||||
self.update_color(super::COMPONENT_COLOR_MISC_INFO, theme.misc_info_dialog);
|
||||
self.update_color(super::COMPONENT_COLOR_MISC_INPUT, theme.misc_input_dialog);
|
||||
self.update_color(super::COMPONENT_COLOR_MISC_KEYS, theme.misc_keys);
|
||||
self.update_color(super::COMPONENT_COLOR_MISC_QUIT, theme.misc_quit_dialog);
|
||||
@@ -495,6 +499,9 @@ impl SetupActivity {
|
||||
let misc_error_dialog: Color = self
|
||||
.get_color(super::COMPONENT_COLOR_MISC_ERROR)
|
||||
.map_err(|_| super::COMPONENT_COLOR_MISC_ERROR)?;
|
||||
let misc_info_dialog: Color = self
|
||||
.get_color(super::COMPONENT_COLOR_MISC_INFO)
|
||||
.map_err(|_| super::COMPONENT_COLOR_MISC_INFO)?;
|
||||
let misc_input_dialog: Color = self
|
||||
.get_color(super::COMPONENT_COLOR_MISC_INPUT)
|
||||
.map_err(|_| super::COMPONENT_COLOR_MISC_INPUT)?;
|
||||
@@ -560,6 +567,7 @@ impl SetupActivity {
|
||||
theme.auth_recents = auth_recents;
|
||||
theme.auth_username = auth_username;
|
||||
theme.misc_error_dialog = misc_error_dialog;
|
||||
theme.misc_info_dialog = misc_info_dialog;
|
||||
theme.misc_input_dialog = misc_input_dialog;
|
||||
theme.misc_keys = misc_keys;
|
||||
theme.misc_quit_dialog = misc_quit_dialog;
|
||||
|
||||
Reference in New Issue
Block a user