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