[🔨] Made default value of canResize true
This commit is contained in:
parent
8b9e11183d
commit
b774939e23
6 changed files with 9 additions and 11 deletions
|
|
@ -30,8 +30,7 @@ export default class EditorApp implements App {
|
|||
title: this.name,
|
||||
icon,
|
||||
width: 500,
|
||||
height: 400,
|
||||
canResize: true
|
||||
height: 400
|
||||
})
|
||||
|
||||
if (data != null) {
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ export default class FilesApp implements App {
|
|||
title: this.name,
|
||||
icon,
|
||||
width: 500,
|
||||
height: 400,
|
||||
canResize: true
|
||||
height: 400
|
||||
})
|
||||
|
||||
win.content.style.display = 'flex'
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ export default class MusicApp implements App {
|
|||
title: this.name,
|
||||
icon,
|
||||
width: 700,
|
||||
height: 300,
|
||||
canResize: true
|
||||
height: 300
|
||||
})
|
||||
|
||||
win.content.innerHTML = 'hi'
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ export default class SettingsApp implements App {
|
|||
title: this.name,
|
||||
icon,
|
||||
width: 700,
|
||||
height: 300,
|
||||
canResize: true
|
||||
height: 300
|
||||
})
|
||||
|
||||
win.content.style.padding = '10px'
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export interface FlowWindowConfig {
|
|||
width?: number
|
||||
height?: number
|
||||
|
||||
canResize: boolean
|
||||
canResize?: boolean
|
||||
|
||||
minWidth?: number
|
||||
minHeight?: number
|
||||
|
|
|
|||
|
|
@ -88,12 +88,14 @@ export class FlowWindow {
|
|||
this.focus()
|
||||
}
|
||||
|
||||
if (config.canResize === undefined) config.canResize = true
|
||||
|
||||
this.element.style.width = `${config.width ?? 300}px`
|
||||
this.element.style.height = `${config.height ?? 200}px`
|
||||
|
||||
this.header = document.createElement('window-header')
|
||||
this.header.innerHTML = `<img src="${config.icon}"></img> <div class="title">${config.title}</div><div style="flex:1;"></div><i id="min" class='bx bx-minus'></i><i id="close" class='bx bx-x'></i>`
|
||||
if (config.canResize) {
|
||||
if (!config.canResize) {
|
||||
this.header.innerHTML = `<img src="${config.icon}"></img> <div class="title">${config.title}</div><div style="flex:1;"></div><i id="min" class='bx bx-minus'></i><i id="max" class='bx bx-checkbox'></i><i id="close" class='bx bx-x'></i>`
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +105,7 @@ export class FlowWindow {
|
|||
|
||||
(this.header.querySelector('#min') as HTMLElement).onclick = () => this.toggleMin()
|
||||
|
||||
if (config.canResize) {
|
||||
if (!config.canResize) {
|
||||
(this.header.querySelector('#max') as HTMLElement).onclick = () => this.toggleMax()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue