forked from Blendman974/faceclaw
Add font viewer
This commit is contained in:
1 parent
1b4844b1ef
commit
1d00849eb2
7 files changed
+775
-1
No files matched your search
@@ -2,6 +2,7 @@ import { type AppContext, type AppDefinition } from "../app-definition";
|
||||
import { openEvenHubPackage } from "../evenhub";
|
||||
import {
|
||||
createFilesAppWindow,
|
||||
createFontDocumentWindow,
|
||||
createImageDocumentWindow,
|
||||
createTextDocumentWindow,
|
||||
FILES_SURFACE_ID,
|
||||
@@ -34,6 +35,17 @@ function openImageDocumentWindow(ctx: AppContext, title: string, path: string):
|
||||
});
|
||||
}
|
||||
|
||||
function openFontDocumentWindow(ctx: AppContext, title: string, path: string): void {
|
||||
const windowId = `files:doc:${nextDocumentSerial++}`;
|
||||
void ctx
|
||||
.launchInProcessApp(windowId, `window:${windowId}`, (options) =>
|
||||
createFontDocumentWindow(windowId, title, path, options),
|
||||
)
|
||||
.catch((error) => {
|
||||
ctx.appendLog(`font preview window failed: ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
const filesApp: AppDefinition = {
|
||||
appId: "files",
|
||||
title: "Files",
|
||||
@@ -49,6 +61,7 @@ const filesApp: AppDefinition = {
|
||||
ctx.appendLog(`evenhub launch failed: ${error}`);
|
||||
});
|
||||
},
|
||||
openFontWindow: (title, path) => openFontDocumentWindow(ctx, title, path),
|
||||
}),
|
||||
),
|
||||
// A document arriving via Android's Share intent opens as its own window.
|
||||
|
||||
Reference in new issue
Block a user