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