11use crate :: raw_config:: constant:: {
22 APP_GUI_SETTINGS , APP_SETTINGS , BACKGROUND_COLOR , BACKGROUND_COLOR_BUTTON ,
3- FALLBACK_BG_BUTTON_COLOR , FALLBACK_BG_COLOR , FALLBACK_FG_BUTTON_COLOR ,
4- FALLBACK_FG_COLOR , FOREGROUND_COLOR , FOREGROUND_COLOR_BUTTON ,
5- HIDE_WHEN_CLOSED , HIDE_WHEN_CLOSED_FALLBACK , NOTIFICATION ,
6- NOTIFICATION_FALLBACK ,
3+ BACKGROUND_COLOR_TABLE_HEADER , FALLBACK_BG_BUTTON_COLOR , FALLBACK_BG_COLOR ,
4+ FALLBACK_BG_TABLE_HEADER_COLOR , FALLBACK_FG_BUTTON_COLOR ,
5+ FALLBACK_FG_COLOR , FALLBACK_FG_TABLE_HEADER_COLOR , FOREGROUND_COLOR ,
6+ FOREGROUND_COLOR_BUTTON , FOREGROUND_COLOR_TABLE_HEADER , HIDE_WHEN_CLOSED ,
7+ HIDE_WHEN_CLOSED_FALLBACK , NOTIFICATION , NOTIFICATION_FALLBACK ,
78} ;
89use std:: {
910 ffi:: { CStr , CString , c_char} ,
@@ -23,6 +24,8 @@ pub struct RawAppGuiSettings {
2324 pub foreground_color : * mut c_char ,
2425 pub background_button_color : * mut c_char ,
2526 pub foreground_button_color : * mut c_char ,
27+ pub background_header_table_color : * mut c_char ,
28+ pub foreground_header_table_color : * mut c_char ,
2629}
2730
2831#[ repr( C ) ]
@@ -109,6 +112,16 @@ pub unsafe extern "C" fn raw_exists_config(
109112 FOREGROUND_COLOR_BUTTON ,
110113 FALLBACK_FG_BUTTON_COLOR ,
111114 ) ;
115+ let bg_table_header_color = color_by_settings (
116+ & toml_value,
117+ BACKGROUND_COLOR_TABLE_HEADER ,
118+ FALLBACK_BG_TABLE_HEADER_COLOR ,
119+ ) ;
120+ let fg_table_header_color = color_by_settings (
121+ & toml_value,
122+ FOREGROUND_COLOR_TABLE_HEADER ,
123+ FALLBACK_FG_TABLE_HEADER_COLOR ,
124+ ) ;
112125
113126 let Ok ( bg_cstr) = CString :: new ( bg_color) else {
114127 return Status :: ConvertToCStringFailed ;
@@ -126,6 +139,14 @@ pub unsafe extern "C" fn raw_exists_config(
126139 return Status :: ConvertToCStringFailed ;
127140 } ;
128141
142+ let Ok ( bg_table_header_cstr) = CString :: new ( bg_table_header_color) else {
143+ return Status :: ConvertToCStringFailed ;
144+ } ;
145+
146+ let Ok ( fg_table_header_cstr) = CString :: new ( fg_table_header_color) else {
147+ return Status :: ConvertToCStringFailed ;
148+ } ;
149+
129150 if let Some ( config) = unsafe { raw_cfg_out. as_mut ( ) } {
130151 config. app_settings . hide_when_closed = app_settings. hide_when_closed ;
131152 config. app_settings . notification = app_settings. notification ;
@@ -135,6 +156,10 @@ pub unsafe extern "C" fn raw_exists_config(
135156 bg_btn_cstr. into_raw ( ) ;
136157 config. app_gui_settings . foreground_button_color =
137158 fg_btn_cstr. into_raw ( ) ;
159+ config. app_gui_settings . background_header_table_color =
160+ bg_table_header_cstr. into_raw ( ) ;
161+ config. app_gui_settings . foreground_header_table_color =
162+ fg_table_header_cstr. into_raw ( ) ;
138163
139164 return RawReadAppConfigStatus :: Ok ;
140165 }
@@ -154,6 +179,12 @@ pub unsafe extern "C" fn raw_free_cstr_app_config(config: *mut RawAppConfig) {
154179 CString :: from_raw ( cfg. app_gui_settings . background_button_color ) ;
155180 let _ =
156181 CString :: from_raw ( cfg. app_gui_settings . foreground_button_color ) ;
182+ let _ = CString :: from_raw (
183+ cfg. app_gui_settings . background_header_table_color ,
184+ ) ;
185+ let _ = CString :: from_raw (
186+ cfg. app_gui_settings . foreground_header_table_color ,
187+ ) ;
157188 }
158189 }
159190}
0 commit comments