mirror of
https://github.com/veeso/termscp.git
synced 2025-12-06 17:15:35 -08:00
Ux improvements (described in issue #80)
This commit is contained in:
committed by
Christian Visintin
parent
027545f14c
commit
685444655c
12
CHANGELOG.md
12
CHANGELOG.md
@@ -38,6 +38,18 @@ Released on FIXME:
|
||||
- **Ui**:
|
||||
- Transfer abortion is now more responsive
|
||||
- Selected files will now be rendered with **Reversed, underlined and italic** text modifiers instead of being prepended with `*`.
|
||||
- **Midnight commander keys**
|
||||
- `<F1>`: Show help
|
||||
- `<F3>`: View file
|
||||
- `<F4>`: Open file (with text editor)
|
||||
- `<F5>`: Copy file
|
||||
- `<F6>`: Rename file
|
||||
- `<F7>`: Make directory
|
||||
- `<F8>`: Remove file
|
||||
- `<F10>`: Quit
|
||||
- Added footer with most used key bindings
|
||||
- ❗ `<TAB>` will now switch explorer tab (will do what `<LEFT>` and `<RIGHT>` currently do)
|
||||
- ❗ Use `<BACKTAB>` to switch between explorer tab and log tab. ❗ Backtab is `<SHIFT + TAB>`
|
||||
- **Tui-realm migration**:
|
||||
- migrated application to tui-realm 1.x
|
||||
- Improved application performance
|
||||
|
||||
@@ -149,8 +149,8 @@ In order to change panel you need to type `<LEFT>` to move the remote explorer p
|
||||
| Key | Command | Reminder |
|
||||
|---------------|-------------------------------------------------------|-------------|
|
||||
| `<ESC>` | Disconnect from remote; return to authentication page | |
|
||||
| `<TAB>` | Switch between log tab and explorer | |
|
||||
| `<BACKSPACE>` | Go to previous directory in stack | |
|
||||
| `<TAB>` | Switch explorer tab | |
|
||||
| `<RIGHT>` | Move to remote explorer tab | |
|
||||
| `<LEFT>` | Move to local explorer tab | |
|
||||
| `<UP>` | Move up in selected list | |
|
||||
@@ -159,28 +159,28 @@ In order to change panel you need to type `<LEFT>` to move the remote explorer p
|
||||
| `<PGDOWN>` | Move down in selected list by 8 rows | |
|
||||
| `<ENTER>` | Enter directory | |
|
||||
| `<SPACE>` | Upload / download selected file | |
|
||||
| `<BACKTAB>` | Switch between log tab and explorer | |
|
||||
| `<A>` | Toggle hidden files | All |
|
||||
| `<B>` | Sort files by | Bubblesort? |
|
||||
| `<C>` | Copy file/directory | Copy |
|
||||
| `<D>` | Make directory | Directory |
|
||||
| `<E>` | Delete file (Same as `DEL`) | Erase |
|
||||
| `<C|F5>` | Copy file/directory | Copy |
|
||||
| `<D|F7>` | Make directory | Directory |
|
||||
| `<E|F8|DEL>` | Delete file | Erase |
|
||||
| `<F>` | Search for files (wild match is supported) | Find |
|
||||
| `<G>` | Go to supplied path | Go to |
|
||||
| `<H>` | Show help | Help |
|
||||
| `<H|F1>` | Show help | Help |
|
||||
| `<I>` | Show info about selected file or directory | Info |
|
||||
| `<L>` | Reload current directory's content / Clear selection | List |
|
||||
| `<M>` | Select a file | Mark |
|
||||
| `<N>` | Create new file with provided name | New |
|
||||
| `<O>` | Edit file; see Text editor | Open |
|
||||
| `<Q>` | Quit termscp | Quit |
|
||||
| `<R>` | Rename file | Rename |
|
||||
| `<O|F4>` | Edit file; see Text editor | Open |
|
||||
| `<Q|F10>` | Quit termscp | Quit |
|
||||
| `<R|F6>` | Rename file | Rename |
|
||||
| `<S>` | Save file as... | Save |
|
||||
| `<U>` | Go to parent directory | Upper |
|
||||
| `<V>` | Open file with default program for filetype | View |
|
||||
| `<V|F3>` | Open file with default program for filetype | View |
|
||||
| `<W>` | Open file with provided program | With |
|
||||
| `<X>` | Execute a command | eXecute |
|
||||
| `<Y>` | Toggle synchronized browsing | sYnc |
|
||||
| `<DEL>` | Delete file | |
|
||||
| `<CTRL+A>` | Select all files | |
|
||||
| `<CTRL+C>` | Abort file transfer process | |
|
||||
|
||||
|
||||
@@ -149,8 +149,8 @@ Para cambiar de panel, debe escribir `<LEFT>` para mover el panel del explorador
|
||||
| Key | Command | Reminder |
|
||||
|---------------|-------------------------------------------------------|-------------|
|
||||
| `<ESC>` | Desconecte; volver a la página de autenticación | |
|
||||
| `<TAB>` | Cambiar entre la pestaña de registro y el explorador | |
|
||||
| `<BACKSPACE>` | Ir al directorio anterior en la pila | |
|
||||
| `<TAB>` | Cambiar pestaña del explorador | |
|
||||
| `<RIGHT>` | Mover a la pestaña del explorador remoto | |
|
||||
| `<LEFT>` | Mover a la pestaña del explorador local | |
|
||||
| `<UP>` | Subir en la lista seleccionada | |
|
||||
@@ -159,28 +159,28 @@ Para cambiar de panel, debe escribir `<LEFT>` para mover el panel del explorador
|
||||
| `<PGDOWN>` | Bajar 8 filas en la lista seleccionada | |
|
||||
| `<ENTER>` | Entrar directorio | |
|
||||
| `<SPACE>` | Cargar / descargar el archivo seleccionado | |
|
||||
| `<BACKTAB>` | Cambiar entre la pestaña de registro y el explorador | |
|
||||
| `<A>` | Alternar archivos ocultos | All |
|
||||
| `<B>` | Ordenar archivos por | Bubblesort? |
|
||||
| `<C>` | Copiar archivo / directorio | Copy |
|
||||
| `<D>` | Hacer directorio | Directory |
|
||||
| `<E>` | Eliminar archivo (igual que `DEL`) | Erase |
|
||||
| `<C|F5>` | Copiar archivo / directorio | Copy |
|
||||
| `<D|F7>` | Hacer directorio | Directory |
|
||||
| `<E|F8|DEL>` | Eliminar archivo | Erase |
|
||||
| `<F>` | Búsqueda de archivos | Find |
|
||||
| `<G>` | Ir a la ruta proporcionada | Go to |
|
||||
| `<H>` | Mostrar ayuda | Help |
|
||||
| `<H|F1>` | Mostrar ayuda | Help |
|
||||
| `<I>` | Mostrar información sobre el archivo | Info |
|
||||
| `<L>` | Recargar contenido del directorio / Borrar selección | List |
|
||||
| `<M>` | Seleccione un archivo | Mark |
|
||||
| `<N>` | Crear un nuevo archivo con el nombre proporcionado | New |
|
||||
| `<O>` | Editar archivo | Open |
|
||||
| `<Q>` | Salir de termscp | Quit |
|
||||
| `<R>` | Renombrar archivo | Rename |
|
||||
| `<O|F4>` | Editar archivo | Open |
|
||||
| `<Q|F10>` | Salir de termscp | Quit |
|
||||
| `<R|F6>` | Renombrar archivo | Rename |
|
||||
| `<S>` | Guardar archivo como... | Save |
|
||||
| `<U>` | Ir al directorio principal | Upper |
|
||||
| `<V>` | Abrir archivo con el programa predeterminado | View |
|
||||
| `<V|F3>` | Abrir archivo con el programa predeterminado | View |
|
||||
| `<W>` | Abrir archivo con el programa proporcionado | With |
|
||||
| `<X>` | Ejecutar un comando | eXecute |
|
||||
| `<Y>` | Alternar navegación sincronizada | sYnc |
|
||||
| `<DEL>` | Eliminar archivo | |
|
||||
| `<CTRL+A>` | Seleccionar todos los archivos | |
|
||||
| `<CTRL+C>` | Abortar el proceso de transferencia de archivos | |
|
||||
|
||||
|
||||
@@ -147,8 +147,8 @@ Pour changer de panneau, vous devez taper `<LEFT>` pour déplacer le panneau de
|
||||
| Key | Command | Reminder |
|
||||
|---------------|---------------------------------------------------------------------|-------------|
|
||||
| `<ESC>` | Se Déconnecter de le serveur; retour à la page d'authentification | |
|
||||
| `<TAB>` | Basculer entre l'onglet journal et l'explorateur | |
|
||||
| `<BACKSPACE>` | Aller au répertoire précédent dans la pile | |
|
||||
| `<TAB>` | Changer d'onglet explorateur | |
|
||||
| `<RIGHT>` | Déplacer vers l'onglet explorateur distant | |
|
||||
| `<LEFT>` | Déplacer vers l'onglet explorateur local | |
|
||||
| `<UP>` | Remonter dans la liste sélectionnée | |
|
||||
@@ -157,28 +157,28 @@ Pour changer de panneau, vous devez taper `<LEFT>` pour déplacer le panneau de
|
||||
| `<PGDOWN>` | Descendre dans la liste sélectionnée de 8 lignes | |
|
||||
| `<ENTER>` | Entrer dans le directoire | |
|
||||
| `<SPACE>` | Télécharger le fichier sélectionné | |
|
||||
| `<BACKTAB>` | Basculer entre l'onglet journal et l'explorateur | |
|
||||
| `<A>` | Basculer les fichiers cachés | All |
|
||||
| `<B>` | Trier les fichiers par | Bubblesort? |
|
||||
| `<C>` | Copier le fichier/répertoire | Copy |
|
||||
| `<D>` | Créer un dossier | Directory |
|
||||
| `<E>` | Supprimer le fichier (Identique à `DEL`) | Erase |
|
||||
| `<C|F5>` | Copier le fichier/répertoire | Copy |
|
||||
| `<D|F7>` | Créer un dossier | Directory |
|
||||
| `<E|F8|DEL>` | Supprimer le fichier (Identique à `DEL`) | Erase |
|
||||
| `<F>` | Rechercher des fichiers | Find |
|
||||
| `<G>` | Aller au chemin fourni | Go to |
|
||||
| `<H>` | Afficher l'aide | Help |
|
||||
| `<H|F1>` | Afficher l'aide | Help |
|
||||
| `<I>` | Afficher les informations sur le fichier ou le dossier sélectionné | Info |
|
||||
| `<L>` | Recharger le contenu du répertoire actuel / Effacer la sélection | List |
|
||||
| `<M>` | Sélectionner un fichier | Mark |
|
||||
| `<N>` | Créer un nouveau fichier avec le nom fourni | New |
|
||||
| `<O>` | Modifier le fichier | Open |
|
||||
| `<Q>` | Quitter termscp | Quit |
|
||||
| `<R>` | Renommer le fichier | Rename |
|
||||
| `<O|F4>` | Modifier le fichier | Open |
|
||||
| `<Q|F10>` | Quitter termscp | Quit |
|
||||
| `<R|F6>` | Renommer le fichier | Rename |
|
||||
| `<S>` | Enregistrer le fichier sous... | Save |
|
||||
| `<U>` | Aller dans le répertoire parent | Upper |
|
||||
| `<V>` | Ouvrir le fichier avec le programme défaut pour le type de fichier | View |
|
||||
| `<V|F3>` | Ouvrir le fichier avec le programme défaut pour le type de fichier | View |
|
||||
| `<W>` | Ouvrir le fichier avec le programme spécifié | With |
|
||||
| `<X>` | Exécuter une commande | eXecute |
|
||||
| `<Y>` | Basculer la navigation synchronisée | sYnc |
|
||||
| `<DEL>` | Supprimer le fichier | |
|
||||
| `<CTRL+A>` | Sélectionner tous les fichiers | |
|
||||
| `<CTRL+C>` | Abandonner le processus de transfert de fichiers | |
|
||||
|
||||
|
||||
@@ -143,8 +143,8 @@ Per cambiare pannello ti puoi muovere con le frecce, `<LEFT>` per andare sul pan
|
||||
| Key | Command | Reminder |
|
||||
|---------------|-------------------------------------------------------|-------------|
|
||||
| `<ESC>` | Disconnettiti; chiudi popup | |
|
||||
| `<TAB>` | Cambia tra explorer e pannello di log | |
|
||||
| `<BACKSPACE>` | Vai alla directory precedente | |
|
||||
| `<TAB>` | Cambia pannello remoto | |
|
||||
| `<RIGHT>` | Vai al pannello remoto | |
|
||||
| `<LEFT>` | Vai al pannello locale | |
|
||||
| `<UP>` | Muovi il cursore verso l'alto | |
|
||||
@@ -153,28 +153,28 @@ Per cambiare pannello ti puoi muovere con le frecce, `<LEFT>` per andare sul pan
|
||||
| `<PGDOWN>` | Muovi il cursore verso il basso di 8 | |
|
||||
| `<ENTER>` | Entra nella directory | |
|
||||
| `<SPACE>` | Upload / download file selezionato/i | |
|
||||
| `<BACKTAB>` | Cambia tra explorer e pannello di log | |
|
||||
| `<A>` | Mostra/nascondi file nascosti | All |
|
||||
| `<B>` | Ordina file per | Bubblesort? |
|
||||
| `<C>` | Copia file/directory | Copy |
|
||||
| `<D>` | Crea directory | Directory |
|
||||
| `<E>` | Elimina file (Come `DEL`) | Erase |
|
||||
| `<C|F5>` | Copia file/directory | Copy |
|
||||
| `<D|F7>` | Crea directory | Directory |
|
||||
| `<E|F8|DEL>` | Elimina file | Erase |
|
||||
| `<F>` | Cerca file (wild match supportato) | Find |
|
||||
| `<G>` | Vai al percorso indicato | Go to |
|
||||
| `<H>` | Mostra help | Help |
|
||||
| `<H|F1>` | Mostra help | Help |
|
||||
| `<I>` | Mostra informazioni per il file selezionato | Info |
|
||||
| `<L>` | Ricarica posizione corrente / pulisci selezione file | List |
|
||||
| `<M>` | Seleziona file | Mark |
|
||||
| `<N>` | Crea nuovo file con il nome fornito | New |
|
||||
| `<O>` | Modifica file; Vedi text editor | Open |
|
||||
| `<Q>` | Termina termscp | Quit |
|
||||
| `<R>` | Rinomina file | Rename |
|
||||
| `<O|F4>` | Modifica file; Vedi text editor | Open |
|
||||
| `<Q|F10>` | Termina termscp | Quit |
|
||||
| `<R|F6>` | Rinomina file | Rename |
|
||||
| `<S>` | Salva file con nome | Save |
|
||||
| `<U>` | Vai alla directory padre | Upper |
|
||||
| `<V>` | Apri il file con il programma definito dal sistema | View |
|
||||
| `<V|F3>` | Apri il file con il programma definito dal sistema | View |
|
||||
| `<W>` | Apri il file con il programma specificato | With |
|
||||
| `<X>` | Esegui comando shell | eXecute |
|
||||
| `<Y>` | Abilita/disabilita Sync-Browsing | sYnc |
|
||||
| `<DEL>` | Rimuovi file | |
|
||||
| `<CTRL+A>` | Seleziona tutti i file | |
|
||||
| `<CTRL+C>` | Annulla trasferimento file | |
|
||||
|
||||
|
||||
20
docs/man.md
20
docs/man.md
@@ -147,8 +147,8 @@ In order to change panel you need to type `<LEFT>` to move the remote explorer p
|
||||
| Key | Command | Reminder |
|
||||
|---------------|-------------------------------------------------------|-------------|
|
||||
| `<ESC>` | Disconnect from remote; return to authentication page | |
|
||||
| `<TAB>` | Switch between log tab and explorer | |
|
||||
| `<BACKSPACE>` | Go to previous directory in stack | |
|
||||
| `<TAB>` | Switch explorer tab | |
|
||||
| `<RIGHT>` | Move to remote explorer tab | |
|
||||
| `<LEFT>` | Move to local explorer tab | |
|
||||
| `<UP>` | Move up in selected list | |
|
||||
@@ -157,28 +157,28 @@ In order to change panel you need to type `<LEFT>` to move the remote explorer p
|
||||
| `<PGDOWN>` | Move down in selected list by 8 rows | |
|
||||
| `<ENTER>` | Enter directory | |
|
||||
| `<SPACE>` | Upload / download selected file | |
|
||||
| `<BACKTAB>` | Switch between log tab and explorer | |
|
||||
| `<A>` | Toggle hidden files | All |
|
||||
| `<B>` | Sort files by | Bubblesort? |
|
||||
| `<C>` | Copy file/directory | Copy |
|
||||
| `<D>` | Make directory | Directory |
|
||||
| `<E>` | Delete file (Same as `DEL`) | Erase |
|
||||
| `<C|F5>` | Copy file/directory | Copy |
|
||||
| `<D|F7>` | Make directory | Directory |
|
||||
| `<E|F8|DEL>` | Delete file | Erase |
|
||||
| `<F>` | Search for files (wild match is supported) | Find |
|
||||
| `<G>` | Go to supplied path | Go to |
|
||||
| `<H>` | Show help | Help |
|
||||
| `<H|F1>` | Show help | Help |
|
||||
| `<I>` | Show info about selected file or directory | Info |
|
||||
| `<L>` | Reload current directory's content / Clear selection | List |
|
||||
| `<M>` | Select a file | Mark |
|
||||
| `<N>` | Create new file with provided name | New |
|
||||
| `<O>` | Edit file; see Text editor | Open |
|
||||
| `<Q>` | Quit termscp | Quit |
|
||||
| `<R>` | Rename file | Rename |
|
||||
| `<O|F4>` | Edit file; see Text editor | Open |
|
||||
| `<Q|F10>` | Quit termscp | Quit |
|
||||
| `<R|F6>` | Rename file | Rename |
|
||||
| `<S>` | Save file as... | Save |
|
||||
| `<U>` | Go to parent directory | Upper |
|
||||
| `<V>` | Open file with default program for filetype | View |
|
||||
| `<V|F3>` | Open file with default program for filetype | View |
|
||||
| `<W>` | Open file with provided program | With |
|
||||
| `<X>` | Execute a command | eXecute |
|
||||
| `<Y>` | Toggle synchronized browsing | sYnc |
|
||||
| `<DEL>` | Delete file | |
|
||||
| `<CTRL+A>` | Select all files | |
|
||||
| `<CTRL+C>` | Abort file transfer process | |
|
||||
|
||||
|
||||
@@ -145,8 +145,8 @@ termscp中的文件资源管理器是指你与远程建立连接后可以看到
|
||||
| 按键 | 命令 | 助记词 |
|
||||
|---------------|-------------------------------------------------------|-------------|
|
||||
| `<ESC>` | 断开远程连接;回到登录页 | |
|
||||
| `<TAB>` | 在日志面板和管理器面板之间切换 | |
|
||||
| `<BACKSPACE>` | 返回上一次目录 | |
|
||||
| `<TAB>` | 切换资源管理器选项卡 | |
|
||||
| `<RIGHT>` | 切换到远程管理器面板 | |
|
||||
| `<LEFT>` | 切换到本地管理器面板 | |
|
||||
| `<UP>` | 在当前列表中向上移动光标 | |
|
||||
@@ -155,28 +155,28 @@ termscp中的文件资源管理器是指你与远程建立连接后可以看到
|
||||
| `<PGDOWN>` | 在当前列表中光标下移8行 | |
|
||||
| `<ENTER>` | 进入文件夹 | |
|
||||
| `<SPACE>` | 上传 / 下载选中文件 | |
|
||||
| `<BACKTAB>` | 在日志面板和管理器面板之间切换 | |
|
||||
| `<A>` | 是否显示隐藏文件 | All |
|
||||
| `<B>` | 按..排序 | Bubblesort? |
|
||||
| `<C>` | 复制文件(夹) | Copy |
|
||||
| `<D>` | 创建文件夹 | Directory |
|
||||
| `<E>` | 删除文件(同 `DEL`) | Erase |
|
||||
| `<C|F5>` | 复制文件(夹) | Copy |
|
||||
| `<D|F7>` | 创建文件夹 | Directory |
|
||||
| `<E|F8|DEL>` | 删除文件 | Erase |
|
||||
| `<F>` | 文件搜索 (支持通配符) | Find |
|
||||
| `<G>` | 跳转到指定路径 | Go to |
|
||||
| `<H>` | 显示帮助 | Help |
|
||||
| `<H|F1>` | 显示帮助 | Help |
|
||||
| `<I>` | 显示选中文件(夹)信息 | Info |
|
||||
| `<L>` | 刷新当前目录列表 / 清除选中状态 | List |
|
||||
| `<M>` | 选中文件 | Mark |
|
||||
| `<N>` | 使用键入的名称新建文件 | New |
|
||||
| `<O>` | 编辑文件;参考文本编辑器文档 | Open |
|
||||
| `<Q>` | 退出termscp | Quit |
|
||||
| `<R>` | 重命名文件 | Rename |
|
||||
| `<O|F4>` | 编辑文件;参考文本编辑器文档 | Open |
|
||||
| `<Q|F10>` | 退出termscp | Quit |
|
||||
| `<R|F7>` | 重命名文件 | Rename |
|
||||
| `<S>` | 另存为... | Save |
|
||||
| `<U>` | 进入上层目录 | Upper |
|
||||
| `<V>` | 使用默认方式打开文件 | View |
|
||||
| `<V|F3>` | 使用默认方式打开文件 | View |
|
||||
| `<W>` | 使用指定程序打开文件 | With |
|
||||
| `<X>` | 运行命令 | eXecute |
|
||||
| `<Y>` | 是否开启同步浏览 | sYnc |
|
||||
| `<DEL>` | 删除文件 | |
|
||||
| `<CTRL+A>` | 选中所有文件 | |
|
||||
| `<CTRL+C>` | 终止文件传输 | |
|
||||
|
||||
|
||||
@@ -62,10 +62,10 @@ impl MockComponent for Log {
|
||||
.props
|
||||
.get_or(Attribute::Focus, AttrValue::Flag(false))
|
||||
.unwrap_flag();
|
||||
let fg = self
|
||||
let borders = self
|
||||
.props
|
||||
.get_or(Attribute::Foreground, AttrValue::Color(Color::Reset))
|
||||
.unwrap_color();
|
||||
.get_or(Attribute::Borders, AttrValue::Borders(Borders::default()))
|
||||
.unwrap_borders();
|
||||
let bg = self
|
||||
.props
|
||||
.get_or(Attribute::Background, AttrValue::Color(Color::Reset))
|
||||
@@ -81,7 +81,7 @@ impl MockComponent for Log {
|
||||
.collect();
|
||||
let w = TuiList::new(list_items)
|
||||
.block(tui_realm_stdlib::utils::get_block(
|
||||
Borders::default().color(fg),
|
||||
borders,
|
||||
Some(("Log".to_string(), Alignment::Left)),
|
||||
focus,
|
||||
None,
|
||||
@@ -214,7 +214,9 @@ impl Component<Msg, NoUserEvent> for Log {
|
||||
Some(Msg::None)
|
||||
}
|
||||
// -- comp msg
|
||||
Event::Keyboard(KeyEvent { code: Key::Tab, .. }) => Some(Msg::Ui(UiMsg::LogTabbed)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::BackTab, ..
|
||||
}) => Some(Msg::Ui(UiMsg::LogBackTabbed)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
74
src/ui/activities/filetransfer/components/misc.rs
Executable file
74
src/ui/activities/filetransfer/components/misc.rs
Executable file
@@ -0,0 +1,74 @@
|
||||
//! ## Components
|
||||
//!
|
||||
//! file transfer activity components
|
||||
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* termscp - Copyright (c) 2021 Christian Visintin
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
use super::Msg;
|
||||
|
||||
use tui_realm_stdlib::Span;
|
||||
use tuirealm::props::{Color, TextSpan};
|
||||
use tuirealm::{Component, Event, MockComponent, NoUserEvent};
|
||||
|
||||
#[derive(MockComponent)]
|
||||
pub struct FooterBar {
|
||||
component: Span,
|
||||
}
|
||||
|
||||
impl FooterBar {
|
||||
pub fn new(key_color: Color) -> Self {
|
||||
Self {
|
||||
component: Span::default().spans(&[
|
||||
TextSpan::from("<F1|H>").fg(key_color),
|
||||
TextSpan::from(" Help "),
|
||||
TextSpan::from("<TAB>").fg(key_color),
|
||||
TextSpan::from(" Change tab "),
|
||||
TextSpan::from("<SPACE>").fg(key_color),
|
||||
TextSpan::from(" Transfer "),
|
||||
TextSpan::from("<ENTER>").fg(key_color),
|
||||
TextSpan::from(" Enter dir "),
|
||||
TextSpan::from("<F3|V>").fg(key_color),
|
||||
TextSpan::from(" View "),
|
||||
TextSpan::from("<F4|O>").fg(key_color),
|
||||
TextSpan::from(" Edit "),
|
||||
TextSpan::from("<F5|C>").fg(key_color),
|
||||
TextSpan::from(" Copy "),
|
||||
TextSpan::from("<F6|R>").fg(key_color),
|
||||
TextSpan::from(" Rename "),
|
||||
TextSpan::from("<F7|D>").fg(key_color),
|
||||
TextSpan::from(" Make dir "),
|
||||
TextSpan::from("<F8|DEL>").fg(key_color),
|
||||
TextSpan::from(" Make dir "),
|
||||
TextSpan::from("<F10|Q>").fg(key_color),
|
||||
TextSpan::from(" Quit "),
|
||||
]),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Component<Msg, NoUserEvent> for FooterBar {
|
||||
fn on(&mut self, _: Event<NoUserEvent>) -> Option<Msg> {
|
||||
None
|
||||
}
|
||||
}
|
||||
@@ -35,10 +35,12 @@ use tuirealm::{
|
||||
|
||||
// -- export
|
||||
mod log;
|
||||
mod misc;
|
||||
mod popups;
|
||||
mod transfer;
|
||||
|
||||
pub use self::log::Log;
|
||||
pub use misc::FooterBar;
|
||||
pub use popups::{
|
||||
CopyPopup, DeletePopup, DisconnectPopup, ErrorPopup, ExecPopup, FatalPopup, FileInfoPopup,
|
||||
FindPopup, GoToPopup, KeybindingsPopup, MkdirPopup, NewfilePopup, OpenWithPopup,
|
||||
@@ -59,11 +61,11 @@ impl Component<Msg, NoUserEvent> for GlobalListener {
|
||||
Some(Msg::Ui(UiMsg::ShowDisconnectPopup))
|
||||
}
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('q'),
|
||||
code: Key::Char('q') | Key::Function(10),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowQuitPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('h'),
|
||||
code: Key::Char('h') | Key::Function(1),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowKeybindingsPopup)),
|
||||
_ => None,
|
||||
|
||||
@@ -676,102 +676,106 @@ impl KeybindingsPopup {
|
||||
.rows(
|
||||
TableBuilder::default()
|
||||
.add_col(TextSpan::new("<ESC>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Disconnect"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<TAB>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(
|
||||
" Switch between explorer and logs",
|
||||
))
|
||||
.add_col(TextSpan::from(" Disconnect"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<BACKSPACE>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Go to previous directory"))
|
||||
.add_col(TextSpan::from(" Go to previous directory"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<RIGHT/LEFT>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Change explorer tab"))
|
||||
.add_col(TextSpan::new("<TAB|RIGHT|LEFT>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Change explorer tab"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<UP/DOWN>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Move up/down in list"))
|
||||
.add_col(TextSpan::from(" Move up/down in list"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<ENTER>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Enter directory"))
|
||||
.add_col(TextSpan::from(" Enter directory"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<SPACE>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Upload/Download file"))
|
||||
.add_col(TextSpan::from(" Upload/Download file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<A>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Toggle hidden files"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<B>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Change file sorting mode"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<C>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Copy"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<D>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Make directory"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<F>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Search files"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<G>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Go to path"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<H>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Show help"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<I>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Show info about selected file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<L>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Reload directory content"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<M>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Select file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<N>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Create new file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<O>").bold().fg(key_color))
|
||||
.add_col(TextSpan::new("<BACKTAB>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(
|
||||
" Open text file with preferred editor",
|
||||
" Switch between explorer and log window",
|
||||
))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<Q>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Quit termscp"))
|
||||
.add_col(TextSpan::new("<A>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Toggle hidden files"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<R>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Rename file"))
|
||||
.add_col(TextSpan::new("<B>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Change file sorting mode"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<C|F5>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Copy"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<D|F7>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Make directory"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<F>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Search files"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<G>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Go to path"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<H|F1>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Show help"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<I>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(
|
||||
" Show info about selected file",
|
||||
))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<L>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Reload directory content"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<M>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Select file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<N>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Create new file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<O|F4>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(
|
||||
" Open text file with preferred editor",
|
||||
))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<Q|F10>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Quit termscp"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<R|F6>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Rename file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<S>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Save file as"))
|
||||
.add_col(TextSpan::from(" Save file as"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<U>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Go to parent directory"))
|
||||
.add_col(TextSpan::from(" Go to parent directory"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<V>").bold().fg(key_color))
|
||||
.add_col(TextSpan::new("<V|F3>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(
|
||||
" Open file with default application for file type",
|
||||
" Open file with default application for file type",
|
||||
))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<W>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(
|
||||
" Open file with specified application",
|
||||
" Open file with specified application",
|
||||
))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<X>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Execute shell command"))
|
||||
.add_col(TextSpan::from(" Execute shell command"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<Y>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Toggle synchronized browsing"))
|
||||
.add_col(TextSpan::from(
|
||||
" Toggle synchronized browsing",
|
||||
))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<DEL|E>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Delete selected file"))
|
||||
.add_col(TextSpan::new("<DEL|F8|E>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Delete selected file"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<CTRL+A>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Select all files"))
|
||||
.add_col(TextSpan::from(" Select all files"))
|
||||
.add_row()
|
||||
.add_col(TextSpan::new("<CTRL+C>").bold().fg(key_color))
|
||||
.add_col(TextSpan::from(" Interrupt file transfer"))
|
||||
.add_col(TextSpan::from(" Interrupt file transfer"))
|
||||
.build(),
|
||||
),
|
||||
}
|
||||
|
||||
@@ -105,14 +105,14 @@ impl Component<Msg, NoUserEvent> for ExplorerFind {
|
||||
Some(Msg::None)
|
||||
}
|
||||
// -- comp msg
|
||||
Event::Keyboard(KeyEvent { code: Key::Tab, .. }) => {
|
||||
Some(Msg::Ui(UiMsg::ExplorerTabbed))
|
||||
}
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::BackTab, ..
|
||||
}) => Some(Msg::Ui(UiMsg::ExplorerBackTabbed)),
|
||||
Event::Keyboard(KeyEvent { code: Key::Esc, .. }) => {
|
||||
Some(Msg::Ui(UiMsg::CloseFindExplorer))
|
||||
}
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Left | Key::Right,
|
||||
code: Key::Left | Key::Right | Key::Tab,
|
||||
..
|
||||
}) => Some(Msg::Ui(UiMsg::ChangeTransferWindow)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -135,7 +135,7 @@ impl Component<Msg, NoUserEvent> for ExplorerFind {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowFileSortingPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('e') | Key::Delete,
|
||||
code: Key::Char('e') | Key::Delete | Key::Function(8),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowDeletePopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -147,7 +147,7 @@ impl Component<Msg, NoUserEvent> for ExplorerFind {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowSaveAsPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('v'),
|
||||
code: Key::Char('v') | Key::Function(3),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Transfer(TransferMsg::OpenFile)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -229,14 +229,15 @@ impl Component<Msg, NoUserEvent> for ExplorerLocal {
|
||||
Some(Msg::None)
|
||||
}
|
||||
// -- comp msg
|
||||
Event::Keyboard(KeyEvent { code: Key::Tab, .. }) => {
|
||||
Some(Msg::Ui(UiMsg::ExplorerTabbed))
|
||||
}
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::BackTab, ..
|
||||
}) => Some(Msg::Ui(UiMsg::ExplorerBackTabbed)),
|
||||
Event::Keyboard(KeyEvent { code: Key::Esc, .. }) => {
|
||||
Some(Msg::Ui(UiMsg::ShowDisconnectPopup))
|
||||
}
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Right, ..
|
||||
code: Key::Right | Key::Tab,
|
||||
..
|
||||
}) => Some(Msg::Ui(UiMsg::ChangeTransferWindow)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Backspace,
|
||||
@@ -258,15 +259,15 @@ impl Component<Msg, NoUserEvent> for ExplorerLocal {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowFileSortingPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('c'),
|
||||
code: Key::Char('c') | Key::Function(5),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowCopyPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('d'),
|
||||
code: Key::Char('d') | Key::Function(7),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowMkdirPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('e') | Key::Delete,
|
||||
code: Key::Char('e') | Key::Delete | Key::Function(8),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowDeletePopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -290,11 +291,11 @@ impl Component<Msg, NoUserEvent> for ExplorerLocal {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowNewFilePopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('o'),
|
||||
code: Key::Char('o') | Key::Function(4),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Transfer(TransferMsg::OpenTextFile)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('r'),
|
||||
code: Key::Char('r') | Key::Function(6),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowRenamePopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -314,7 +315,7 @@ impl Component<Msg, NoUserEvent> for ExplorerLocal {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ToggleSyncBrowsing)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('v'),
|
||||
code: Key::Char('v') | Key::Function(3),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Transfer(TransferMsg::OpenFile)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -396,14 +397,15 @@ impl Component<Msg, NoUserEvent> for ExplorerRemote {
|
||||
Some(Msg::None)
|
||||
}
|
||||
// -- comp msg
|
||||
Event::Keyboard(KeyEvent { code: Key::Tab, .. }) => {
|
||||
Some(Msg::Ui(UiMsg::ExplorerTabbed))
|
||||
}
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::BackTab, ..
|
||||
}) => Some(Msg::Ui(UiMsg::ExplorerBackTabbed)),
|
||||
Event::Keyboard(KeyEvent { code: Key::Esc, .. }) => {
|
||||
Some(Msg::Ui(UiMsg::ShowDisconnectPopup))
|
||||
}
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Left, ..
|
||||
code: Key::Left | Key::Tab,
|
||||
..
|
||||
}) => Some(Msg::Ui(UiMsg::ChangeTransferWindow)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Backspace,
|
||||
@@ -425,15 +427,15 @@ impl Component<Msg, NoUserEvent> for ExplorerRemote {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowFileSortingPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('c'),
|
||||
code: Key::Char('c') | Key::Function(5),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowCopyPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('d'),
|
||||
code: Key::Char('d') | Key::Function(7),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowMkdirPopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('e') | Key::Delete,
|
||||
code: Key::Char('e') | Key::Delete | Key::Function(8),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowDeletePopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -457,11 +459,11 @@ impl Component<Msg, NoUserEvent> for ExplorerRemote {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowNewFilePopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('o'),
|
||||
code: Key::Char('o') | Key::Function(4),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Transfer(TransferMsg::OpenTextFile)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('r'),
|
||||
code: Key::Char('r') | Key::Function(6),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ShowRenamePopup)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
@@ -481,7 +483,7 @@ impl Component<Msg, NoUserEvent> for ExplorerRemote {
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Ui(UiMsg::ToggleSyncBrowsing)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('v'),
|
||||
code: Key::Char('v') | Key::Function(3),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Transfer(TransferMsg::OpenFile)),
|
||||
Event::Keyboard(KeyEvent {
|
||||
|
||||
@@ -74,6 +74,7 @@ enum Id {
|
||||
FatalPopup,
|
||||
FileInfoPopup,
|
||||
FindPopup,
|
||||
FooterBar,
|
||||
GlobalListener,
|
||||
GotoPopup,
|
||||
KeybindingsPopup,
|
||||
@@ -148,8 +149,8 @@ enum UiMsg {
|
||||
CloseRenamePopup,
|
||||
CloseSaveAsPopup,
|
||||
Disconnect,
|
||||
ExplorerTabbed,
|
||||
LogTabbed,
|
||||
ExplorerBackTabbed,
|
||||
LogBackTabbed,
|
||||
Quit,
|
||||
ReplacePopupTabbed,
|
||||
ShowCopyPopup,
|
||||
|
||||
@@ -417,10 +417,10 @@ impl FileTransferActivity {
|
||||
self.disconnect();
|
||||
self.umount_disconnect();
|
||||
}
|
||||
UiMsg::ExplorerTabbed => {
|
||||
UiMsg::ExplorerBackTabbed => {
|
||||
assert!(self.app.active(&Id::Log).is_ok());
|
||||
}
|
||||
UiMsg::LogTabbed => {
|
||||
UiMsg::LogBackTabbed => {
|
||||
assert!(self.app.active(&Id::ExplorerLocal).is_ok());
|
||||
}
|
||||
UiMsg::Quit => {
|
||||
|
||||
@@ -52,8 +52,17 @@ impl FileTransferActivity {
|
||||
let remote_explorer_background = self.theme().transfer_remote_explorer_background;
|
||||
let remote_explorer_foreground = self.theme().transfer_remote_explorer_foreground;
|
||||
let remote_explorer_highlighted = self.theme().transfer_remote_explorer_highlighted;
|
||||
let key_color = self.theme().misc_keys;
|
||||
let log_panel = self.theme().transfer_log_window;
|
||||
let log_background = self.theme().transfer_log_background;
|
||||
assert!(self
|
||||
.app
|
||||
.mount(
|
||||
Id::FooterBar,
|
||||
Box::new(components::FooterBar::new(key_color)),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
assert!(self
|
||||
.app
|
||||
.mount(
|
||||
@@ -111,9 +120,19 @@ impl FileTransferActivity {
|
||||
let store: &mut Store = &mut context.store;
|
||||
let _ = context.terminal.raw_mut().draw(|f| {
|
||||
// Prepare chunks
|
||||
let chunks = Layout::default()
|
||||
let body = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints(
|
||||
[
|
||||
Constraint::Min(7), // Body
|
||||
Constraint::Length(1), // Footer
|
||||
]
|
||||
.as_ref(),
|
||||
)
|
||||
.split(f.size());
|
||||
// main chunks
|
||||
let main_chunks = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.margin(1)
|
||||
.constraints(
|
||||
[
|
||||
Constraint::Percentage(70), // Explorer
|
||||
@@ -121,17 +140,17 @@ impl FileTransferActivity {
|
||||
]
|
||||
.as_ref(),
|
||||
)
|
||||
.split(f.size());
|
||||
.split(body[0]);
|
||||
// Create explorer chunks
|
||||
let tabs_chunks = Layout::default()
|
||||
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
|
||||
.direction(Direction::Horizontal)
|
||||
.split(chunks[0]);
|
||||
.split(main_chunks[0]);
|
||||
// Create log box chunks
|
||||
let bottom_chunks = Layout::default()
|
||||
.constraints([Constraint::Length(1), Constraint::Length(10)].as_ref())
|
||||
.direction(Direction::Vertical)
|
||||
.split(chunks[1]);
|
||||
.split(main_chunks[1]);
|
||||
// Create status bar chunks
|
||||
let status_bar_chunks = Layout::default()
|
||||
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
|
||||
@@ -142,6 +161,8 @@ impl FileTransferActivity {
|
||||
if !store.isset(super::STORAGE_EXPLORER_WIDTH) {
|
||||
store.set_unsigned(super::STORAGE_EXPLORER_WIDTH, tabs_chunks[0].width as usize);
|
||||
}
|
||||
// Draw footer
|
||||
self.app.view(&Id::FooterBar, f, body[1]);
|
||||
// Draw explorers
|
||||
// @! Local explorer (Find or default)
|
||||
if matches!(self.browser.found_tab(), Some(FoundExplorerTab::Local)) {
|
||||
@@ -816,6 +837,20 @@ impl FileTransferActivity {
|
||||
}),
|
||||
Self::no_popup_mounted_clause(),
|
||||
),
|
||||
Sub::new(
|
||||
SubEventClause::Keyboard(KeyEvent {
|
||||
code: Key::Function(1),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}),
|
||||
Self::no_popup_mounted_clause(),
|
||||
),
|
||||
Sub::new(
|
||||
SubEventClause::Keyboard(KeyEvent {
|
||||
code: Key::Function(10),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}),
|
||||
Self::no_popup_mounted_clause(),
|
||||
),
|
||||
Sub::new(
|
||||
SubEventClause::Keyboard(KeyEvent {
|
||||
code: Key::Char('q'),
|
||||
|
||||
@@ -108,7 +108,7 @@ impl Header {
|
||||
.color(Color::Yellow)
|
||||
.sides(BorderSides::BOTTOM),
|
||||
)
|
||||
.choices(&["User interface", "SSH Keys", "Theme"])
|
||||
.choices(&["Configuration parameters", "SSH Keys", "Theme"])
|
||||
.foreground(Color::Yellow)
|
||||
.value(match layout {
|
||||
ViewLayout::SetupForm => 0,
|
||||
|
||||
Reference in New Issue
Block a user