diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2023-06-04 00:18:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-04 00:18:24 -0400 |
commit | 5e0900584b776a0282d3c80ced60af5a49256230 (patch) | |
tree | be64211acc3e7df490ca520646b370e6ff09479f /src/canvas/widgets/process_table.rs | |
parent | c6d322263e8dffb4cc1c36cdcbd0a1922cce58d1 (diff) |
refactor: change canvas macOS check to compile-time (#1184)
Diffstat (limited to 'src/canvas/widgets/process_table.rs')
-rw-r--r-- | src/canvas/widgets/process_table.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/canvas/widgets/process_table.rs b/src/canvas/widgets/process_table.rs index 44cb5b2f..534809be 100644 --- a/src/canvas/widgets/process_table.rs +++ b/src/canvas/widgets/process_table.rs @@ -220,10 +220,14 @@ impl Painter { // TODO: [MOUSE] Mouse support for these in search // TODO: [MOVEMENT] Movement support for these in search - let (case, whole, regex) = if self.is_mac_os { - ("Case(F1)", "Whole(F2)", "Regex(F3)") - } else { - ("Case(Alt+C)", "Whole(Alt+W)", "Regex(Alt+R)") + let (case, whole, regex) = { + cfg_if::cfg_if! { + if #[cfg(target_os = "macos")] { + ("Case(F1)", "Whole(F2)", "Regex(F3)") + } else { + ("Case(Alt+C)", "Whole(Alt+W)", "Regex(Alt+R)") + } + } }; let option_text = Line::from(vec![ Span::styled(case, case_style), |