Various color picker fixes

This commit is contained in:
barsdeveloper
2022-11-07 21:44:46 +01:00
parent b86d952e3a
commit c8c365313d
17 changed files with 638 additions and 343 deletions

View File

@@ -1,6 +1,6 @@
import { html } from "lit"
import Configuration from "../Configuration"
import IDraggablePositionedTemplate from "./IDraggablePositionedTemplate"
import MouseClickAction from "../input/mouse/MouseClickAction"
import MouseMoveDraggable from "../input/mouse/MouseMoveDraggable"
/** @typedef {import("../element/WindowElement").default} WindowElement */
@@ -23,22 +23,12 @@ export default class WindowTemplate extends IDraggablePositionedTemplate {
})
}
createInputObjects() {
return [
...super.createInputObjects(),
new MouseClickAction(this.element.querySelector(".ueb-window-close"), this.element.blueprint, {},
undefined,
() => this.element.remove()
),
]
}
render() {
return html`
<div class="ueb-window">
<div class="ueb-window-top">
<div class="ueb-window-name ueb-ellipsis-nowrap-text">${this.renderWindowName()}</div>
<div class="ueb-window-close">
<div class="ueb-window-close" @click="${() => this.element.remove()}">
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<line x1="2" y1="2" x2="30" y2="30" stroke="currentColor" stroke-width="4" />
<line x1="30" y1="2" x2="2" y2="30" stroke="currentColor" stroke-width="4" />
@@ -59,4 +49,14 @@ export default class WindowTemplate extends IDraggablePositionedTemplate {
renderContent() {
return html``
}
apply() {
this.element.dispatchEvent(new CustomEvent(Configuration.windowApplyEventName))
this.element.remove()
}
cancel() {
this.element.dispatchEvent(new CustomEvent(Configuration.windowCancelEventName))
this.element.remove()
}
}