diff --git a/apps/aboutme/personalprops.go b/apps/aboutme/personalprops.go index be53fb5..d4098d6 100644 --- a/apps/aboutme/personalprops.go +++ b/apps/aboutme/personalprops.go @@ -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, } diff --git a/apps/finder/finder.go b/apps/finder/finder.go index a4a9226..c63aa1b 100644 --- a/apps/finder/finder.go +++ b/apps/finder/finder.go @@ -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, } diff --git a/front/src/apps/about-me/about-me.less b/front/src/apps/about-me/about-me.less index c4aa470..2ef0430 100644 --- a/front/src/apps/about-me/about-me.less +++ b/front/src/apps/about-me/about-me.less @@ -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; diff --git a/front/src/apps/finder/finder-window.js b/front/src/apps/finder/finder-window.js index d7f3011..19bb8ba 100644 --- a/front/src/apps/finder/finder-window.js +++ b/front/src/apps/finder/finder-window.js @@ -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")) diff --git a/front/src/apps/finder/finder.js b/front/src/apps/finder/finder.js index 7c5c035..87cac89 100644 --- a/front/src/apps/finder/finder.js +++ b/front/src/apps/finder/finder.js @@ -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) }) } } \ No newline at end of file diff --git a/front/src/wde/wde-desktop.js b/front/src/wde/wde-desktop.js index 4e1c100..8c41e8a 100644 --- a/front/src/wde/wde-desktop.js +++ b/front/src/wde/wde-desktop.js @@ -17,10 +17,13 @@ export default class WebDesktopEnvironment extends AbstractWebDesktopEnvironment Decorat /** @type {Object} */ 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: diff --git a/front/src/wde/wde.js b/front/src/wde/wde.js index 234bdb3..374c746 100644 --- a/front/src/wde/wde.js +++ b/front/src/wde/wde.js @@ -97,6 +97,11 @@ export default class AbstractWebDesktopEnvironment{ WebFS(){ return this.#webFS } + + /** + * @param {string} alertText + */ + Alert(alertText){} } /** diff --git a/front/src/wde/widgets/file-view/file-view.js b/front/src/wde/widgets/file-view/file-view.js index d1b255a..10fa0b8 100644 --- a/front/src/wde/widgets/file-view/file-view.js +++ b/front/src/wde/widgets/file-view/file-view.js @@ -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() diff --git a/templates/personal-properties/app.html b/templates/personal-properties/app.html index 8a67335..6f78d48 100644 --- a/templates/personal-properties/app.html +++ b/templates/personal-properties/app.html @@ -4,14 +4,7 @@
- +
My Photo
@@ -19,6 +12,14 @@
{{ .HeaderProps.Value1 }}
{{ .HeaderProps.Value2 }}
+
{{ range $island := .Islands }} diff --git a/templates/wde-widgets/window-title-bar.html b/templates/wde-widgets/window-title-bar.html index 13beba3..e17c7c3 100644 --- a/templates/wde-widgets/window-title-bar.html +++ b/templates/wde-widgets/window-title-bar.html @@ -5,7 +5,9 @@ {{end}}
- + {{if .HasIcon}} + + {{ end }}
{{.Lable}}
diff --git a/wde/titlebar.go b/wde/titlebar.go index 15e6699..979bb34 100644 --- a/wde/titlebar.go +++ b/wde/titlebar.go @@ -3,4 +3,7 @@ package wde type TitleBarConfig struct { Lable string CloseButton bool + HasIcon bool + IconPath string + IconSize string }