@@ -12,8 +12,6 @@ use crate::{
1212 yaml_val:: { value_to_string, Val } ,
1313} ;
1414
15- const DEFAULT_PROCESSES_TITLE : & ' static str = "Processes" ;
16-
1715pub struct ConfigContext {
1816 pub path : PathBuf ,
1917}
@@ -25,7 +23,7 @@ pub struct Config {
2523 pub mouse_scroll_speed : usize ,
2624 pub scrollback_len : usize ,
2725 pub proc_list_width : usize ,
28- pub title : String ,
26+ pub proc_list_title : String ,
2927}
3028
3129impl Config {
@@ -65,13 +63,12 @@ impl Config {
6563 None
6664 } ;
6765
68- let title = if let Some ( title) = config. get ( & Value :: from ( "title" ) ) {
69- title. as_str ( ) ?. to_string ( )
70- } else if let Some ( title) = & settings. title {
71- title. clone ( )
72- } else {
73- DEFAULT_PROCESSES_TITLE . to_string ( )
74- } ;
66+ let proc_list_title =
67+ if let Some ( title) = config. get ( & Value :: from ( "proc_list_title" ) ) {
68+ title. as_str ( ) ?. to_string ( )
69+ } else {
70+ settings. proc_list_title . clone ( )
71+ } ;
7572
7673 let config = Config {
7774 procs,
@@ -80,7 +77,7 @@ impl Config {
8077 mouse_scroll_speed : settings. mouse_scroll_speed ,
8178 scrollback_len : settings. scrollback_len ,
8279 proc_list_width : settings. proc_list_width ,
83- title ,
80+ proc_list_title ,
8481 } ;
8582
8683 Ok ( config)
@@ -94,7 +91,7 @@ impl Config {
9491 mouse_scroll_speed : settings. mouse_scroll_speed ,
9592 scrollback_len : settings. scrollback_len ,
9693 proc_list_width : settings. proc_list_width ,
97- title : DEFAULT_PROCESSES_TITLE . to_string ( ) ,
94+ proc_list_title : settings . proc_list_title . clone ( ) ,
9895 }
9996 }
10097}
0 commit comments