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 inactive_caret(&self) -> crate::input::InactiveCaret;
33
34 fn set_inactive_caret(&mut self, inactive: crate::input::InactiveCaret);
36
37 fn scrollbar_visibility(&self) -> crate::scroll::Visibility;
39
40 fn set_scrollbar_visibility(&mut self, value: crate::scroll::Visibility);
42
43 fn color_swatches(&self) -> std::rc::Rc<[crate::color::Swatch]>;
45
46 fn set_color_swatches(&mut self, set: impl Into<std::rc::Rc<[crate::color::Swatch]>>);
49
50 fn menu_indent(&self) -> crate::menu::MenuIndent;
52
53 fn set_menu_indent(&mut self, indent: crate::menu::MenuIndent);
56}
57
58impl AppExt for App {
59 fn caption_style(&self) -> crate::titlebar::CaptionStyle {
60 crate::titlebar::caption_style(self)
61 }
62
63 fn set_caption_style(&mut self, style: crate::titlebar::CaptionStyle) {
64 self.set_global(style);
65 self.refresh_windows();
66 }
67
68 fn caret_blink(&self) -> bool {
69 crate::input::caret_blink(self)
70 }
71
72 fn set_caret_blink(&mut self, blink: bool) {
73 crate::input::set_caret_blink(blink, self)
74 }
75
76 fn caret_shape(&self) -> crate::input::CaretShape {
77 crate::input::caret::caret_shape(self)
78 }
79
80 fn set_caret_shape(&mut self, shape: crate::input::CaretShape) {
81 crate::input::caret::set_caret_shape(shape, self)
82 }
83
84 fn caret_height(&self) -> crate::input::CaretHeight {
85 crate::input::caret::caret_height(self)
86 }
87
88 fn set_caret_height(&mut self, height: crate::input::CaretHeight) {
89 crate::input::caret::set_caret_height(height, self)
90 }
91
92 fn inactive_caret(&self) -> crate::input::InactiveCaret {
93 crate::input::caret::inactive_caret(self)
94 }
95
96 fn set_inactive_caret(&mut self, inactive: crate::input::InactiveCaret) {
97 crate::input::caret::set_inactive_caret(inactive, self)
98 }
99
100 fn scrollbar_visibility(&self) -> crate::scroll::Visibility {
101 crate::scroll::overlay::visibility(self)
102 }
103
104 fn set_scrollbar_visibility(&mut self, value: crate::scroll::Visibility) {
105 crate::scroll::overlay::set_visibility(value, self)
106 }
107
108 fn color_swatches(&self) -> std::rc::Rc<[crate::color::Swatch]> {
109 crate::color::swatches(self)
110 }
111
112 fn set_color_swatches(&mut self, set: impl Into<std::rc::Rc<[crate::color::Swatch]>>) {
113 crate::color::set_swatches(set, self)
114 }
115
116 fn menu_indent(&self) -> crate::menu::MenuIndent {
117 crate::menu::indent(self)
118 }
119
120 fn set_menu_indent(&mut self, indent: crate::menu::MenuIndent) {
121 crate::menu::set_indent(indent, self)
122 }
123}