1use gpui::App;
4
5pub trait AppExt {
7 fn caption_style(&self) -> crate::titlebar::CaptionStyle;
9
10 fn set_caption_style(&mut self, style: crate::titlebar::CaptionStyle);
12
13 fn caret_blink(&self) -> bool;
15
16 fn set_caret_blink(&mut self, blink: bool);
18
19 fn caret_shape(&self) -> crate::input::CaretShape;
21
22 fn set_caret_shape(&mut self, shape: crate::input::CaretShape);
24
25 fn scrollbar_visibility(&self) -> crate::scroll::Visibility;
27
28 fn set_scrollbar_visibility(&mut self, value: crate::scroll::Visibility);
30
31 fn color_swatches(&self) -> std::rc::Rc<[crate::color::Swatch]>;
33
34 fn set_color_swatches(&mut self, set: impl Into<std::rc::Rc<[crate::color::Swatch]>>);
37}
38
39impl AppExt for App {
40 fn caption_style(&self) -> crate::titlebar::CaptionStyle {
41 crate::titlebar::caption_style(self)
42 }
43
44 fn set_caption_style(&mut self, style: crate::titlebar::CaptionStyle) {
45 self.set_global(style);
46 self.refresh_windows();
47 }
48
49 fn caret_blink(&self) -> bool {
50 crate::input::caret_blink(self)
51 }
52
53 fn set_caret_blink(&mut self, blink: bool) {
54 crate::input::set_caret_blink(blink, self)
55 }
56
57 fn caret_shape(&self) -> crate::input::CaretShape {
58 crate::input::caret::caret_shape(self)
59 }
60
61 fn set_caret_shape(&mut self, shape: crate::input::CaretShape) {
62 crate::input::caret::set_caret_shape(shape, self)
63 }
64
65 fn scrollbar_visibility(&self) -> crate::scroll::Visibility {
66 crate::scroll::overlay::visibility(self)
67 }
68
69 fn set_scrollbar_visibility(&mut self, value: crate::scroll::Visibility) {
70 crate::scroll::overlay::set_visibility(value, self)
71 }
72
73 fn color_swatches(&self) -> std::rc::Rc<[crate::color::Swatch]> {
74 crate::color::swatches(self)
75 }
76
77 fn set_color_swatches(&mut self, set: impl Into<std::rc::Rc<[crate::color::Swatch]>>) {
78 crate::color::set_swatches(set, self)
79 }
80}