summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-04-29 19:43:07 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-04-29 19:46:17 -0400
commit065ef4d5a1f5443de5726343323403477b0263b5 (patch)
tree5f9178bb33229b068c7e9b346d5b7e1c046b989b /src/ui
parent10394fd7a2fb41e9eb6bea36e57b5270d50e5cbf (diff)
rework config structure
- sort options is now nested under display options which holds a lot of previously general options - fix glob search not searching backwards
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/views/tui_folder_view.rs19
-rw-r--r--src/ui/widgets/tui_text.rs2
-rw-r--r--src/ui/widgets/tui_topbar.rs2
3 files changed, 12 insertions, 11 deletions
diff --git a/src/ui/views/tui_folder_view.rs b/src/ui/views/tui_folder_view.rs
index 65e4d6b..f32b422 100644
--- a/src/ui/views/tui_folder_view.rs
+++ b/src/ui/views/tui_folder_view.rs
@@ -31,16 +31,17 @@ impl<'a> Widget for TuiFolderView<'a> {
let parent_list = curr_tab.parent_list_ref();
let child_list = curr_tab.child_list_ref();
- let constraints: &[Constraint; 3] = if !self.context.config_ref().collapse_preview {
- &self.context.config_ref().default_layout
- } else {
- match child_list {
- Some(_) => &self.context.config_ref().default_layout,
- None => &self.context.config_ref().no_preview_layout,
- }
- };
+ let constraints: &[Constraint; 3] =
+ if !self.context.display_options_ref().collapse_preview() {
+ &self.context.display_options_ref().default_layout
+ } else {
+ match child_list {
+ Some(_) => &self.context.display_options_ref().default_layout,
+ None => &self.context.display_options_ref().no_preview_layout,
+ }
+ };
- let layout_rect = if self.context.config_ref().show_borders {
+ let layout_rect = if self.context.display_options_ref().show_borders() {
let area = Rect {
y: area.top() + 1,
height: area.height - 2,
diff --git a/src/ui/widgets/tui_text.rs b/src/ui/widgets/tui_text.rs
index 7fa6935..1a1064c 100644
--- a/src/ui/widgets/tui_text.rs
+++ b/src/ui/widgets/tui_text.rs
@@ -1,6 +1,6 @@
use tui::buffer::Buffer;
use tui::layout::Rect;
-use tui::style::{Color, Modifier, Style};
+use tui::style::{Color, Style};
use tui::widgets::Widget;
use unicode_width::{UnicodeWidthChar, UnicodeWidthStr};
diff --git a/src/ui/widgets/tui_topbar.rs b/src/ui/widgets/tui_topbar.rs
index 0b9c7e8..74cd44b 100644
--- a/src/ui/widgets/tui_topbar.rs
+++ b/src/ui/widgets/tui_topbar.rs
@@ -42,7 +42,7 @@ impl<'a> Widget for TuiTopBar<'a> {
None => {}
}
}
- if self.context.config_ref().tilde_in_titlebar {
+ if self.context.display_options_ref().tilde_in_titlebar() {
if let Some(home_dir) = HOME_DIR.as_ref() {
let home_dir_str = home_dir.to_string_lossy().into_owned();
curr_path_str = curr_path_str.replace(&home_dir_str, "~");