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 fn menu_width(&self) -> crate::menu::MenuWidth;
59
60 fn set_menu_width(&mut self, width: crate::menu::MenuWidth);
63}
64
65impl AppExt for App {
66 fn caption_style(&self) -> crate::titlebar::CaptionStyle {
67 crate::titlebar::caption_style(self)
68 }
69
70 fn set_caption_style(&mut self, style: crate::titlebar::CaptionStyle) {
71 self.set_global(style);
72 self.refresh_windows();
73 }
74
75 fn caret_blink(&self) -> bool {
76 crate::input::caret_blink(self)
77 }
78
79 fn set_caret_blink(&mut self, blink: bool) {
80 crate::input::set_caret_blink(blink, self)
81 }
82
83 fn caret_shape(&self) -> crate::input::CaretShape {
84 crate::input::caret::caret_shape(self)
85 }
86
87 fn set_caret_shape(&mut self, shape: crate::input::CaretShape) {
88 crate::input::caret::set_caret_shape(shape, self)
89 }
90
91 fn caret_height(&self) -> crate::input::CaretHeight {
92 crate::input::caret::caret_height(self)
93 }
94
95 fn set_caret_height(&mut self, height: crate::input::CaretHeight) {
96 crate::input::caret::set_caret_height(height, self)
97 }
98
99 fn inactive_caret(&self) -> crate::input::InactiveCaret {
100 crate::input::caret::inactive_caret(self)
101 }
102
103 fn set_inactive_caret(&mut self, inactive: crate::input::InactiveCaret) {
104 crate::input::caret::set_inactive_caret(inactive, self)
105 }
106
107 fn scrollbar_visibility(&self) -> crate::scroll::Visibility {
108 crate::scroll::overlay::visibility(self)
109 }
110
111 fn set_scrollbar_visibility(&mut self, value: crate::scroll::Visibility) {
112 crate::scroll::overlay::set_visibility(value, self)
113 }
114
115 fn color_swatches(&self) -> std::rc::Rc<[crate::color::Swatch]> {
116 crate::color::swatches(self)
117 }
118
119 fn set_color_swatches(&mut self, set: impl Into<std::rc::Rc<[crate::color::Swatch]>>) {
120 crate::color::set_swatches(set, self)
121 }
122
123 fn menu_indent(&self) -> crate::menu::MenuIndent {
124 crate::menu::indent(self)
125 }
126
127 fn set_menu_indent(&mut self, indent: crate::menu::MenuIndent) {
128 crate::menu::set_indent(indent, self)
129 }
130
131 fn menu_width(&self) -> crate::menu::MenuWidth {
132 crate::menu::width(self)
133 }
134
135 fn set_menu_width(&mut self, width: crate::menu::MenuWidth) {
136 crate::menu::set_width(width, self)
137 }
138}