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 caret_height(&self) -> crate::input::CaretHeight;
27
28 fn set_caret_height(&mut self, height: crate::input::CaretHeight);
30
31 fn scrollbar_visibility(&self) -> crate::scroll::Visibility;
33
34 fn set_scrollbar_visibility(&mut self, value: crate::scroll::Visibility);
36
37 fn color_swatches(&self) -> std::rc::Rc<[crate::color::Swatch]>;
39
40 fn set_color_swatches(&mut self, set: impl Into<std::rc::Rc<[crate::color::Swatch]>>);
43}
44
45impl AppExt for App {
46 fn caption_style(&self) -> crate::titlebar::CaptionStyle {
47 crate::titlebar::caption_style(self)
48 }
49
50 fn set_caption_style(&mut self, style: crate::titlebar::CaptionStyle) {
51 self.set_global(style);
52 self.refresh_windows();
53 }
54
55 fn caret_blink(&self) -> bool {
56 crate::input::caret_blink(self)
57 }
58
59 fn set_caret_blink(&mut self, blink: bool) {
60 crate::input::set_caret_blink(blink, self)
61 }
62
63 fn caret_shape(&self) -> crate::input::CaretShape {
64 crate::input::caret::caret_shape(self)
65 }
66
67 fn set_caret_shape(&mut self, shape: crate::input::CaretShape) {
68 crate::input::caret::set_caret_shape(shape, self)
69 }
70
71 fn caret_height(&self) -> crate::input::CaretHeight {
72 crate::input::caret::caret_height(self)
73 }
74
75 fn set_caret_height(&mut self, height: crate::input::CaretHeight) {
76 crate::input::caret::set_caret_height(height, self)
77 }
78
79 fn scrollbar_visibility(&self) -> crate::scroll::Visibility {
80 crate::scroll::overlay::visibility(self)
81 }
82
83 fn set_scrollbar_visibility(&mut self, value: crate::scroll::Visibility) {
84 crate::scroll::overlay::set_visibility(value, self)
85 }
86
87 fn color_swatches(&self) -> std::rc::Rc<[crate::color::Swatch]> {
88 crate::color::swatches(self)
89 }
90
91 fn set_color_swatches(&mut self, set: impl Into<std::rc::Rc<[crate::color::Swatch]>>) {
92 crate::color::set_swatches(set, self)
93 }
94}