This commit is contained in:
cyber-dream 2023-07-24 03:27:53 +03:00
parent 3b5b00f5b0
commit e76c55f2c3
11 changed files with 59 additions and 35 deletions

View File

@ -38,6 +38,9 @@ func NewAboutMeApp(webFs *webfilesystem.WebFileSystem) *AboutMeApp {
titleBarConfig: wde.TitleBarConfig{
Lable: "About Me",
CloseButton: true,
HasIcon: true,
IconPath: "/Icons/GenericApp.icn",
IconSize: "16",
},
manifest: manifest,
}

View File

@ -32,6 +32,9 @@ func NewFinderApplication(webFs *webfilesystem.WebFileSystem) *FinderApplication
titleBarConfig: wde.TitleBarConfig{
Lable: "Finder",
CloseButton: true,
HasIcon: true,
IconPath: "/Icons/GenericFolder.icn",
IconSize: "16",
},
manifest: manifest,
}

View File

@ -40,18 +40,20 @@
height: auto; */
/* margin-right: -20px; */
/* Inside auto layout */
flex: none;
order: 0;
align-self: stretch;
flex-grow: 1;
// background-color: aquamarine;
/* Inside auto layout */
width: 100%;
// flex: none;
// order: 0;
// align-self: stretch;
// flex-grow: 1;
/* Auto layout */
display: flex;
flex-direction: row;
align-items: center;
padding: 0px;
margin-right: 20;
// padding: 0px;
// margin-right: 20;
gap:15px;
}
@ -85,10 +87,10 @@
}
.PropertiesList .Links {
position: absolute;
right: 14px;
top: 27px;
/* background-color: aqua; */
// position: absolute;
// right: 14px;
// top: 27px;
// background-color: aqua;
height: auto;
width: auto;

View File

@ -87,7 +87,8 @@ export default class FinderWindow{
let newWindow = this.#wde.Decorat.CreateNewWindow(this.#appId, 500, 350 )
newWindow.innerHTML = html
newWindow.querySelector(".title-bar").querySelector(".icon").setAttribute("src","/system/libs/img/icon/get?path=/Icons/GenericFolder.icn&size=16")
//TODO change icons for every folder
// newWindow.querySelector(".title-bar").querySelector(".icon").setAttribute("src","/system/libs/img/icon/get?path=/Icons/GenericFolder.icn&size=16")
// console.log(newWindow.querySelector(".FileTileView"))

View File

@ -21,7 +21,6 @@ export default class Finder extends WDEApplication{
* @param {import("../../wde/wde.js").runContext} runContext
*/
async NewWindow(args, runContext){
let newFinder = new FinderWindow(this, super.WDE())
await newFinder.Init(this, args, runContext)
}
@ -31,7 +30,6 @@ export default class Finder extends WDEApplication{
* @param {import("../../wde/wde.js").runContext} runContext
*/
async NewView(args, runContext){
// console.log(super.WDE())
let newFinderView = new FinderWindow(this, super.WDE())
await newFinderView.Init(this, args, runContext)
}
@ -50,15 +48,16 @@ export default class Finder extends WDEApplication{
const response = await fetch(`/app/${this.AppId}/renderProps?` + params)
if (response.status != 200){
// WebDesktopEnvironment.Alert("Error in properties render") //TODO
this.WDE().Alert("Error in render properties widget") //TODO
return false
}
const html = await response.text()
let newWindow = super.WDE().Decorat.CreateNewWindow(this.AppId, 350, 500 )
let newWindow = this.WDE().Decorat.CreateNewWindow(this.AppId, 350, 500 )
newWindow.innerHTML = html
newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) {
// WebDesktopEnvironment.CloseWindow(newWindow)
newWindow.querySelector("#closeWindowButton").addEventListener('click', () => {
// console.log(this.WDE().Decorat())
this.WDE().Decorat.CloseWindow(newWindow)
})
}
}

View File

@ -17,10 +17,13 @@ export default class WebDesktopEnvironment extends AbstractWebDesktopEnvironment
Decorat
/** @type {Object<string, WDEApplication>} */
static Applications = {};
/** Deprecated */
/** @deprecated */
static isMobile = false
// static decorat
static webFs
/** @deprecated */
basicWindow
constructor(){
super("localhost:8080")
@ -35,9 +38,9 @@ export default class WebDesktopEnvironment extends AbstractWebDesktopEnvironment
}
async loadWDE(){
await this.Open("/Applications/Finder.app", ["/","--desktop", "desktop-layer"])
// await this.Open("/Applications/Finder.app", ["/", "desktop-layer"])
await this.Open("/Applications/AboutMe.app", ["/", "desktop-layer"])
await this.Open("/Applications/Finder.app", ["/home/user/.Desktop","--desktop", "desktop-layer"])
await this.Open("/Applications/Finder.app", ["/", ""])
// await this.Open("/Applications/AboutMe.app", [])
return
let autoStart = document.body.querySelector("wde-autostart")
@ -84,6 +87,7 @@ export default class WebDesktopEnvironment extends AbstractWebDesktopEnvironment
}
/**
* @deprecated
* @param {string} html
*/
static SetBasicWindow(html){
@ -91,6 +95,7 @@ export default class WebDesktopEnvironment extends AbstractWebDesktopEnvironment
}
/**
* @deprecated
* @returns {string}
*/
static GetBasicWindow(){
@ -100,15 +105,15 @@ export default class WebDesktopEnvironment extends AbstractWebDesktopEnvironment
/**
* @param {string} alertText
*/
static Alert(alertText){
WebDesktopEnvironment.CreateAlertWindow(alertText)
Alert(alertText){
this.#createAlertWindow(alertText)
console.log(alertText)
}
/**
* @param {string} alertText
*/
static CreateAlertWindow(alertText){
#createAlertWindow(alertText){
let newWindow = document.createElement("div")
newWindow.setAttribute("class", "WindowFrameless")
newWindow.setAttribute("windowId", "SuperUniqUUID") //TODO:

View File

@ -97,6 +97,11 @@ export default class AbstractWebDesktopEnvironment{
WebFS(){
return this.#webFS
}
/**
* @param {string} alertText
*/
Alert(alertText){}
}
/**

View File

@ -129,7 +129,7 @@ export default class WDEFileView{
const response = await fetch(`/system/wde/widgets/file-tile-view?` + params)
if (response.status != 200){
//TODO Error text message
WebDesktopEnvironment.Alert("TODO") //TODO
this.#wde.Alert("Error in render folder view") //TODO
return
}
let html = await response.text()

View File

@ -4,14 +4,7 @@
<div class="PersPropsContent">
<div class="PropsView">
<div class="PropertiesList">
<div class="Links">
{{ range $link := .Links }}
<a href="{{$link.Url}}" target="_blank">
<div class="link-lable">{{$link.Text}}</div>
<img class="Link" src="/system/libs/img/get?path={{$link.Icon}}" >
</a>
{{ end }}
</div>
<div class="ShortBio">
<img class="Image" src="/system/libs/img/get?path={{ .HeaderProps.IconPath }}" alt="My Photo">
<div class="Text">
@ -19,6 +12,14 @@
<div>{{ .HeaderProps.Value1 }}</div>
<div>{{ .HeaderProps.Value2 }}</div>
</div>
<div class="Links">
{{ range $link := .Links }}
<a href="{{$link.Url}}" target="_blank">
<div class="link-lable">{{$link.Text}}</div>
<img class="Link" src="/system/libs/img/get?path={{$link.Icon}}" >
</a>
{{ end }}
</div>
</div>
{{ range $island := .Islands }}
<!-- FIXME -->

View File

@ -5,7 +5,9 @@
{{end}}
<div id="Drag" class="visual-drag-area"></div>
<!-- TODO:Disable dragging of icon -->
<img class="icon">
{{if .HasIcon}}
<img class="icon" src="/system/libs/img/icon/get?path={{.IconPath}}&size={{.IconSize}}">
{{ end }}
<div class="lable">
{{.Lable}}
</div>

View File

@ -3,4 +3,7 @@ package wde
type TitleBarConfig struct {
Lable string
CloseButton bool
HasIcon bool
IconPath string
IconSize string
}