fix: fixed Theme Maker title and created popup

fix #157
This commit is contained in:
ThinLiquid 2024-01-24 11:07:35 +00:00
parent 54a92c5d79
commit e630ae664c
No known key found for this signature in database
GPG key ID: 17538DC3DF6A7387
2 changed files with 6 additions and 5 deletions

View file

@ -14,7 +14,7 @@ const ThemeConfig: Process = {
const { Input, Button } = await process.loadLibrary('lib/Components') const { Input, Button } = await process.loadLibrary('lib/Components')
const win = wm.createWindow({ const win = wm.createWindow({
title: 'Task Manager', title: 'Theme Maker',
icon, icon,
width: 600, width: 600,
height: 200 height: 200

View file

@ -61,14 +61,15 @@ const WindowManager: Library = {
win win
} }
} }
document.dispatchEvent(new CustomEvent('app_opened', appOpenedEvent))
const { Button } = await process.loadLibrary('lib/Components') const { Button } = await process.loadLibrary('lib/Components')
return { return {
value: await new Promise((resolve) => { value: await new Promise((resolve) => {
new HTML('h3').text(title).appendTo(win.content) new HTML('h3').text(title).style({ margin: '0' }).appendTo(win.content)
new HTML('p').text(text).appendTo(win.content) new HTML('p').text(text).style({ margin: '0' }).appendTo(win.content)
if (type === 'allow') document.dispatchEvent(new CustomEvent('app_opened', appOpenedEvent))
if (type === 'allow') { if (type === 'allow') {
Button.new().text('Allow').appendTo(win.content).on('click', () => { Button.new().text('Allow').appendTo(win.content).on('click', () => {
@ -81,8 +82,8 @@ const WindowManager: Library = {
}) })
} else if (type === 'ok') { } else if (type === 'ok') {
Button.new().text('OK').appendTo(win.content).on('click', () => { Button.new().text('OK').appendTo(win.content).on('click', () => {
resolve(true)
win.close() win.close()
resolve(true)
}) })
} }