GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
src/color/chords.rs (1K)
1 //! The search keys the tree and list widgets open and close their search with: input.kdl's
2 //! `open_search` / `close_search` chords, falling back to the legacy colour-file keys.
3
4 use super::*;
5
6 pub fn tree_open_search_key() -> String {
7 load_colors_once();
8 let legacy = TREE_OPEN_SEARCH_KEY.read().unwrap().clone();
9 crate::input::widget_chord("open_search", &legacy, "ctrl+f")
10 }
11 pub fn set_tree_open_search_key(k: String) {
12 style_write(&TREE_OPEN_SEARCH_KEY, k);
13 }
14
15 pub fn list_open_search_key() -> String {
16 load_colors_once();
17 let legacy = LIST_OPEN_SEARCH_KEY.read().unwrap().clone();
18 crate::input::widget_chord("open_search", &legacy, "ctrl+f")
19 }
20 pub fn set_list_open_search_key(k: String) {
21 style_write(&LIST_OPEN_SEARCH_KEY, k);
22 }
23
24 pub fn list_close_search_key() -> String {
25 load_colors_once();
26 let legacy = LIST_CLOSE_SEARCH_KEY.read().unwrap().clone();
27 crate::input::widget_chord("close_search", &legacy, "escape")
28 }
29 pub fn set_list_close_search_key(k: String) {
30 style_write(&LIST_CLOSE_SEARCH_KEY, k);
31 }