diff options
| author | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-09-20 10:26:08 +0200 |
|---|---|---|
| committer | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-09-20 10:26:08 +0200 |
| commit | 7c5e910042dccd9242b363058ceed7610948c382 (patch) | |
| tree | c1be27d535fb838a191235ad9990e198fd6890f4 /src/widgets | |
| parent | chore: bump version to v0.5.0 (diff) | |
| download | sl0pstatus-7c5e910042dccd9242b363058ceed7610948c382.tar.gz sl0pstatus-7c5e910042dccd9242b363058ceed7610948c382.tar.xz sl0pstatus-7c5e910042dccd9242b363058ceed7610948c382.zip | |
fix: default active_fullscreen + sync to active format
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/tabs.rs | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/widgets/tabs.rs b/src/widgets/tabs.rs index ca8323a..78ac009 100644 --- a/src/widgets/tabs.rs +++ b/src/widgets/tabs.rs @@ -22,30 +22,34 @@ impl TabsWidget { normal_tab_format_string = form; } - let normal_tab_fullscreen_format = FormattedPart::from_format_string(match config.get("tab_normal_fullscreen") { - Some(form) => form.to_string(), - None => normal_tab_format_string.to_string(), - }); + let normal_tab_fullscreen_format = + FormattedPart::from_format_string(match config.get("tab_normal_fullscreen") { + Some(form) => form.to_string(), + None => normal_tab_format_string.to_string(), + }); - let normal_tab_sync_format = FormattedPart::from_format_string(match config.get("tab_normal_sync") { - Some(form) => form.to_string(), - None => normal_tab_format_string.to_string(), - }); + let normal_tab_sync_format = + FormattedPart::from_format_string(match config.get("tab_normal_sync") { + Some(form) => form.to_string(), + None => normal_tab_format_string.to_string(), + }); - let active_tab_format = FormattedPart::from_format_string(match config.get("tab_active") { - Some(form) => form.to_string(), - None => normal_tab_format_string.to_string(), - }); + let mut active_tab_format_string = normal_tab_format_string.clone(); + if let Some(form) = config.get("tab_active") { + active_tab_format_string = form; + } - let active_tab_fullscreen_format = FormattedPart::from_format_string(match config.get("tab_active_fullscreen") { - Some(form) => form.to_string(), - None => normal_tab_format_string.to_string(), - }); + let active_tab_fullscreen_format = + FormattedPart::from_format_string(match config.get("tab_active_fullscreen") { + Some(form) => form.to_string(), + None => active_tab_format_string.to_string(), + }); - let active_tab_sync_format = FormattedPart::from_format_string(match config.get("tab_active_sync") { - Some(form) => form.to_string(), - None => normal_tab_format_string.to_string(), - }); + let active_tab_sync_format = + FormattedPart::from_format_string(match config.get("tab_active_sync") { + Some(form) => form.to_string(), + None => active_tab_format_string.to_string(), + }); Self { normal_tab_format: FormattedPart::from_format_string( @@ -53,7 +57,9 @@ impl TabsWidget { ), normal_tab_fullscreen_format, normal_tab_sync_format, - active_tab_format, + active_tab_format: FormattedPart::from_format_string( + active_tab_format_string.to_string(), + ), active_tab_fullscreen_format, active_tab_sync_format, } |
