mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 02:22:58 +03:00
move zterm to new app
This commit is contained in:
parent
b4d52498da
commit
7560e4d7af
@ -3,6 +3,6 @@
|
||||
"version": "0.1.0",
|
||||
"description": "Mega eXtreme Window Manager",
|
||||
"author": "MeexReay",
|
||||
"apps": [ "zcom.js", "startz.js" ],
|
||||
"apps": [ "zcom.js", "startz.js", "zterm.js" ],
|
||||
"configs": []
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ async function drawWindowDecorations(ctx, x, y, width, height, title) {
|
||||
const buttonSpacing = 8;
|
||||
|
||||
const outerX = x - borderWidth - 1;
|
||||
const outerY = y - headerHeight - borderWidth - 1;
|
||||
const outerWidth = width + borderWidth * 2;
|
||||
const outerHeight = height + headerHeight + borderWidth * 2;
|
||||
const outerY = y - headerHeight - borderWidth - 2;
|
||||
const outerWidth = width + borderWidth * 2 + 1;
|
||||
const outerHeight = height + headerHeight + borderWidth * 2 + 2;
|
||||
|
||||
ctx.fillStyle = "#f4f4f4";
|
||||
ctx.fillRect(outerX, outerY, outerWidth, outerHeight)
|
||||
@ -34,23 +34,7 @@ async function drawWindowDecorations(ctx, x, y, width, height, title) {
|
||||
}
|
||||
|
||||
async function onStart(screen_ctx) {
|
||||
let wid, ctx = createWindow({
|
||||
"title": "zterm",
|
||||
"width": 500,
|
||||
"height": 500,
|
||||
"x": 50,
|
||||
"y": 50,
|
||||
"onkeydown": key => {
|
||||
ctx.fillStyle = "#222";
|
||||
ctx.font = "bold 14px sans-serif";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.textAlign = "left";
|
||||
ctx.fillText(key, 10, 10);
|
||||
}
|
||||
})
|
||||
|
||||
ctx.fillStyle = "cyan"
|
||||
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height)
|
||||
executeCommand(["/app/zterm.js"])
|
||||
}
|
||||
|
||||
async function onKeyDown(ctx, key) {
|
||||
|
34
app/mxwm/zterm.js
Normal file
34
app/mxwm/zterm.js
Normal file
@ -0,0 +1,34 @@
|
||||
eval(readFile("/app/zcom.js"))
|
||||
|
||||
var text = ""
|
||||
|
||||
async function draw(ctx) {
|
||||
ctx.fillStyle = "cyan"
|
||||
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height)
|
||||
|
||||
ctx.fillStyle = "#222";
|
||||
ctx.font = "bold 14px sans-serif";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.textAlign = "left";
|
||||
ctx.fillText(text, 10, 10);
|
||||
}
|
||||
|
||||
async function onKeyDown(key) {
|
||||
text += key
|
||||
}
|
||||
|
||||
async function main(args) {
|
||||
let wid, ctx = createWindow({
|
||||
"title": "zterm",
|
||||
"width": 500,
|
||||
"height": 500,
|
||||
"x": 50,
|
||||
"y": 50,
|
||||
"onkeydown": onKeyDown
|
||||
})
|
||||
|
||||
while (graphics_canvas != null) {
|
||||
draw(ctx)
|
||||
await new Promise(res => setTimeout(res, 100));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user