From aba3cc85eb44af08d7cd8609e3709dbaac4895d9 Mon Sep 17 00:00:00 2001 From: RisingGlitch Date: Tue, 17 Oct 2023 17:44:22 -0700 Subject: [PATCH 1/2] Commits --- src/apps/editor.ts | 3 ++- src/apps/files.ts | 3 ++- src/apps/info.ts | 60 ++++++++++++++++++++++++++++++++++++++++++++ src/apps/music.ts | 5 +++- src/apps/settings.ts | 3 ++- src/flow.ts | 4 ++- src/types.ts | 2 ++ src/wm.ts | 13 +++++++--- 8 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 src/apps/info.ts diff --git a/src/apps/editor.ts b/src/apps/editor.ts index 5d3a846..9625f38 100644 --- a/src/apps/editor.ts +++ b/src/apps/editor.ts @@ -30,7 +30,8 @@ export default class EditorApp implements App { title: this.name, icon, width: 500, - height: 400 + height: 400, + canResize: true }) if (data != null) { diff --git a/src/apps/files.ts b/src/apps/files.ts index 69ba2ff..eca41e9 100644 --- a/src/apps/files.ts +++ b/src/apps/files.ts @@ -17,7 +17,8 @@ export default class FilesApp implements App { title: this.name, icon, width: 500, - height: 400 + height: 400, + canResize: true }) win.content.style.display = 'flex' diff --git a/src/apps/info.ts b/src/apps/info.ts new file mode 100644 index 0000000..35b9d28 --- /dev/null +++ b/src/apps/info.ts @@ -0,0 +1,60 @@ +import icon from '../assets/icons/settings.png' +import { App } from '../types.ts' +import { FlowWindow } from '../wm.ts' + +export default class SettingsApp implements App { + name = 'Info' + pkg = 'flow.info' + icon = icon + version = '1.0.0' + canResize = true + + async open (): Promise { + const win = window.wm.createWindow({ + title: this.name, + icon, + width: 300, + height: 400, + canResize: false + }) + + win.content.style.padding = '10px' + win.content.innerHTML = ` +

FlowOS

+

v2.0

+ +

Created by ThinLiquid, 1nspird_, Proudparot2, Systemless_

+ + Discord + + Github + + + ` + + return win + } +} diff --git a/src/apps/music.ts b/src/apps/music.ts index a93abee..f31ad2b 100644 --- a/src/apps/music.ts +++ b/src/apps/music.ts @@ -11,7 +11,10 @@ export default class MusicApp implements App { async open (): Promise { const win = window.wm.createWindow({ title: this.name, - icon + icon, + width: 700, + height: 300, + canResize: true }) win.content.innerHTML = 'hi' diff --git a/src/apps/settings.ts b/src/apps/settings.ts index 04567db..3354c83 100644 --- a/src/apps/settings.ts +++ b/src/apps/settings.ts @@ -13,7 +13,8 @@ export default class SettingsApp implements App { title: this.name, icon, width: 700, - height: 300 + height: 300, + canResize: true }) win.content.style.padding = '10px' diff --git a/src/flow.ts b/src/flow.ts index 5be8f64..bf53e0c 100644 --- a/src/flow.ts +++ b/src/flow.ts @@ -4,13 +4,15 @@ import SettingsApp from './apps/settings.ts' import FilesApp from './apps/files.ts' import MusicApp from './apps/music.ts' import EditorApp from './apps/editor.ts' +import InfoApp from './apps/info.ts' const flow: Flow = { apps: { 'flow.settings': new SettingsApp(), 'flow.music': new MusicApp(), 'flow.files': new FilesApp(), - 'flow.editor': new EditorApp() + 'flow.editor': new EditorApp(), + 'flow.info': new InfoApp() }, async openApp (pkg: string, data: any) { const win = this.apps[pkg].open(data) diff --git a/src/types.ts b/src/types.ts index d6748be..71f5f9c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -40,6 +40,8 @@ export interface FlowWindowConfig { width?: number height?: number + canResize: boolean + minWidth?: number minHeight?: number } diff --git a/src/wm.ts b/src/wm.ts index 4e97706..8afb7a6 100644 --- a/src/wm.ts +++ b/src/wm.ts @@ -93,13 +93,20 @@ export class FlowWindow { this.element.style.height = `${config.height ?? 200}px` this.header = document.createElement('window-header') - this.header.innerHTML = `
${config.title}
`; + this.header.innerHTML = `
${config.title}
` + if (config.canResize) { + this.header.innerHTML = `
${config.title}
` + } + (this.header.querySelector('#close') as HTMLElement).onclick = () => { this.close() } - (this.header.querySelector('#min') as HTMLElement).onclick = () => this.toggleMin(); - (this.header.querySelector('#max') as HTMLElement).onclick = () => this.toggleMax() + (this.header.querySelector('#min') as HTMLElement).onclick = () => this.toggleMin() + + if (config.canResize) { + (this.header.querySelector('#max') as HTMLElement).onclick = () => this.toggleMax() + } this.content = document.createElement('window-content') From df2be116a56dee9816d402ebec80be413991b80d Mon Sep 17 00:00:00 2001 From: RisingGlitch Date: Tue, 17 Oct 2023 18:18:34 -0700 Subject: [PATCH 2/2] =?UTF-8?q?[=E2=9C=A8]=20Added=20CanResize=20option=20?= =?UTF-8?q?to=20vm,=20and=20added=20info=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/info.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/info.ts b/src/apps/info.ts index 35b9d28..7ed97ad 100644 --- a/src/apps/info.ts +++ b/src/apps/info.ts @@ -1,4 +1,4 @@ -import icon from '../assets/icons/settings.png' +import icon from '../assets/icons/info.png' import { App } from '../types.ts' import { FlowWindow } from '../wm.ts' @@ -45,12 +45,12 @@ export default class SettingsApp implements App { .github { float:right; position: relative; - top: 80px; + top: 125px; } .discord { float:left; position: relative; - top: 80px; + top: 125px; } `