ElyMark: the file in MarkdownDocument, no web page
The view holds the component library's MarkdownDocument: the file's text is the document's text, saved as read when unedited. Find, tables, attachments, the look and export, which ran in the page, go until their own tasks rebuild them natively. The window scripts that drove the page go with it; gpui window tests cover the view. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
540637cada
commit
1f2920020a
34 files changed
+342
-4144
No files matched your search
@@ -66,12 +66,11 @@ pub fn load(file: &Path) -> io::Result<Look> {
|
||||
const SIZES: (u32, u32, u32) = (70, 200, 10);
|
||||
|
||||
impl Desk {
|
||||
/// Changes the look; pages, file and menus follow.
|
||||
/// Changes the look; its file and menus follow.
|
||||
pub fn relook(&mut self, change: impl FnOnce(&mut Look), cx: &mut Context<Self>) {
|
||||
change(&mut self.look);
|
||||
self.look.size = self.look.size.clamp(SIZES.0, SIZES.1);
|
||||
log::info!("mark: the look is now {:?}", self.look);
|
||||
self.show_look(cx);
|
||||
let json = serde_json::to_vec_pretty(&self.look).expect("a look serializes");
|
||||
if let Err(error) = ely_files::save_atomic(&self.look_file, &json, 0) {
|
||||
log::error!("mark: the look did not save: {error}");
|
||||
@@ -86,15 +85,6 @@ impl Desk {
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
/// Every tab's page takes the look.
|
||||
pub fn show_look(&mut self, cx: &mut Context<Self>) {
|
||||
let look = serde_json::to_value(&self.look).expect("a look serializes");
|
||||
for tab in &self.core.tabs {
|
||||
let look = look.clone();
|
||||
tab.view.update(cx, |view, cx| view.set_look(look, cx));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn look_actions(element: gpui::Div, cx: &mut Context<Self>) -> gpui::Div {
|
||||
use gpui::InteractiveElement as _;
|
||||
let step = SIZES.2;
|
||||
|
||||
Reference in new issue
Block a user