diff --git a/public/assets/window/close.svg b/public/assets/window/close.svg deleted file mode 100644 index a7ce7ea6..00000000 --- a/public/assets/window/close.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/public/assets/window/maximize.svg b/public/assets/window/maximize.svg deleted file mode 100644 index fa13cc92..00000000 --- a/public/assets/window/maximize.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/public/assets/window/minimize.svg b/public/assets/window/minimize.svg deleted file mode 100644 index 10593831..00000000 --- a/public/assets/window/minimize.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/public/assets/window/restore.svg b/public/assets/window/restore.svg deleted file mode 100644 index 27ea7fa6..00000000 --- a/public/assets/window/restore.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/AliceWM.css b/src/AliceWM.css index ec1e16da..181f75ba 100644 --- a/src/AliceWM.css +++ b/src/AliceWM.css @@ -23,6 +23,11 @@ opacity: 1; } +.aliceWMwin svg { + fill: var(--theme-fg); + height: 12px; +} + .scaletransition { transition: visibility 0s, diff --git a/src/AliceWM.tsx b/src/AliceWM.tsx index d87c0f4d..d309c5ea 100755 --- a/src/AliceWM.tsx +++ b/src/AliceWM.tsx @@ -81,7 +81,9 @@ class WMWindow extends EventTarget implements Process { this.state.title = title; } - maximizeImg: HTMLImageElement; + maximizeImg: HTMLOrSVGElement; + maximizeSvg: HTMLOrSVGElement; + restoreSvg: HTMLOrSVGElement; constructor( wininfo: WindowInformation, public app?: App, @@ -98,6 +100,42 @@ class WMWindow extends EventTarget implements Process { } this.clampWindows = !!anura.settings.get("clampWindows"); + this.maximizeSvg = ( + + + + + + ); + + this.restoreSvg = ( + + + + + + ); + this.element = (
- + viewBox="0 0 12 12" + version="1.1" + > + + + +
{ @@ -599,7 +649,7 @@ class WMWindow extends EventTarget implements Process { this.element.classList.remove("scaletransition"); }, 200); - this.maximizeImg.src = "/assets/window/restore.svg"; + this.maximizeImg = this.restoreSvg; this.justresized = true; this.maximized = true; @@ -631,7 +681,7 @@ class WMWindow extends EventTarget implements Process { WMSplitBar.prototype.cleanup(); - this.maximizeImg.src = "/assets/window/maximize.svg"; + this.maximizeImg = this.maximizeSvg; this.element.setAttribute("style", this.oldstyle!); this.justresized = true; @@ -655,7 +705,7 @@ class WMWindow extends EventTarget implements Process { this.element.classList.remove("maxtransition"); this.element.classList.remove("scaletransition"); }, 200); - this.maximizeImg.src = "/assets/window/maximize.svg"; + this.maximizeImg = this.maximizeSvg; await sleep(10); // Race condition as a feature this.justresized = true; @@ -952,7 +1002,7 @@ class WMWindow extends EventTarget implements Process { ); this.onresize(this.width, this.height); - this.maximizeImg.src = "/assets/window/restore.svg"; + this.maximizeImg = this.restoreSvg; this.snapped = true; }