From b72df660baf943ceb2001cc2abe2d0bd4e5f3203 Mon Sep 17 00:00:00 2001 From: Fatih Erikli Date: Mon, 4 Sep 2023 20:37:35 +0300 Subject: [PATCH 1/4] Add icons --- src/fontra/client/tabler-icons/circle-dot-filled.svg | 4 ++++ src/fontra/client/tabler-icons/circle-dot.svg | 5 +++++ src/fontra/client/tabler-icons/eye-closed.svg | 8 ++++++++ src/fontra/client/tabler-icons/eye.svg | 5 +++++ 4 files changed, 22 insertions(+) create mode 100644 src/fontra/client/tabler-icons/circle-dot-filled.svg create mode 100644 src/fontra/client/tabler-icons/circle-dot.svg create mode 100644 src/fontra/client/tabler-icons/eye-closed.svg create mode 100644 src/fontra/client/tabler-icons/eye.svg diff --git a/src/fontra/client/tabler-icons/circle-dot-filled.svg b/src/fontra/client/tabler-icons/circle-dot-filled.svg new file mode 100644 index 000000000..363acba63 --- /dev/null +++ b/src/fontra/client/tabler-icons/circle-dot-filled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/fontra/client/tabler-icons/circle-dot.svg b/src/fontra/client/tabler-icons/circle-dot.svg new file mode 100644 index 000000000..37d3b2200 --- /dev/null +++ b/src/fontra/client/tabler-icons/circle-dot.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/fontra/client/tabler-icons/eye-closed.svg b/src/fontra/client/tabler-icons/eye-closed.svg new file mode 100644 index 000000000..20e833b6f --- /dev/null +++ b/src/fontra/client/tabler-icons/eye-closed.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/fontra/client/tabler-icons/eye.svg b/src/fontra/client/tabler-icons/eye.svg new file mode 100644 index 000000000..7712a774d --- /dev/null +++ b/src/fontra/client/tabler-icons/eye.svg @@ -0,0 +1,5 @@ + + + + + From 8f7464b7f5b1f40638398488a94e314e58eb4d22 Mon Sep 17 00:00:00 2001 From: Fatih Erikli Date: Fri, 8 Sep 2023 19:53:30 +0300 Subject: [PATCH 2/4] Add circleDotListCell --- .../editor/panel-designspace-navigation.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/fontra/views/editor/panel-designspace-navigation.js b/src/fontra/views/editor/panel-designspace-navigation.js index 2b8c2a8df..eceb20765 100644 --- a/src/fontra/views/editor/panel-designspace-navigation.js +++ b/src/fontra/views/editor/panel-designspace-navigation.js @@ -21,6 +21,8 @@ import { import { showMenu } from "/web-components/menu-panel.js"; import { dialogSetup } from "/web-components/modal-dialog.js"; import { IconButton } from "/web-components/icon-button.js"; +import { InlineSVG } from "/web-components/inline-svg.js"; + import { NumberFormatter } from "/web-components/ui-list.js"; import Panel from "./panel.js"; @@ -169,7 +171,7 @@ export default class DesignspaceNavigationPanel extends Panel { { title: "on", key: "active", - cellFactory: checkboxListCell, + cellFactory: circleDotListCell, width: "2em", }, { key: "name", title: "Source name", width: "12em" }, @@ -859,6 +861,26 @@ function suggestedSourceNameFromLocation(location) { ); } +function circleDotListCell(item, colDesc) { + const value = item[colDesc.key]; + return html.div( + { + style: "width: 1.2em; height: 1.2em;", + ondblclick: (event) => { + item[colDesc.key] = !item[colDesc.key]; + event.stopImmediatePropagation(); + }, + }, + [ + html.createDomElement("inline-svg", { + src: value + ? "/tabler-icons/circle-dot.svg" + : "/tabler-icons/circle-dot-filled.svg", + }), + ] + ); +} + function checkboxListCell(item, colDesc) { const value = item[colDesc.key]; return html.input({ From 42f119a023acf5ab260714c4fa972864abb1aa9d Mon Sep 17 00:00:00 2001 From: Fatih Erikli Date: Fri, 8 Sep 2023 20:41:10 +0300 Subject: [PATCH 3/4] Add eyeOnOffListCell --- .../editor/panel-designspace-navigation.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/fontra/views/editor/panel-designspace-navigation.js b/src/fontra/views/editor/panel-designspace-navigation.js index eceb20765..9402e5a98 100644 --- a/src/fontra/views/editor/panel-designspace-navigation.js +++ b/src/fontra/views/editor/panel-designspace-navigation.js @@ -178,7 +178,7 @@ export default class DesignspaceNavigationPanel extends Panel { { title: "bg", key: "visible", - cellFactory: checkboxListCell, + cellFactory: eyeOnOffListCell, width: "2em", }, ]; @@ -310,6 +310,7 @@ export default class DesignspaceNavigationPanel extends Panel { delete backgroundLayers[layerName]; } this.sceneController.backgroundLayers = backgroundLayers; + this._updateSources(); }); sourceController.addKeyListener("status", async (event) => { await this.sceneController.editGlyphAndRecordChanges((glyph) => { @@ -881,6 +882,27 @@ function circleDotListCell(item, colDesc) { ); } +function eyeOnOffListCell(item, colDesc) { + const value = item[colDesc.key]; + return html.div( + { + style: "width: 1.2em; height: 1.2em;", + onclick: (event) => { + item[colDesc.key] = !item[colDesc.key]; + event.stopImmediatePropagation(); + }, + ondblclick: (event) => { + event.stopImmediatePropagation(); + }, + }, + [ + html.createDomElement("inline-svg", { + src: value ? "/tabler-icons/eye.svg" : "/tabler-icons/eye-closed.svg", + }), + ] + ); +} + function checkboxListCell(item, colDesc) { const value = item[colDesc.key]; return html.input({ From f956fbe0fbae1ee059013e9a3593694225aa0243 Mon Sep 17 00:00:00 2001 From: Fatih Erikli Date: Mon, 11 Sep 2023 21:52:02 +0300 Subject: [PATCH 4/4] Replace circle-dot-filled with circle-dotted --- .../client/tabler-icons/circle-dot-filled.svg | 4 ---- src/fontra/client/tabler-icons/circle-dotted.svg | 15 +++++++++++++++ .../views/editor/panel-designspace-navigation.js | 4 +--- 3 files changed, 16 insertions(+), 7 deletions(-) delete mode 100644 src/fontra/client/tabler-icons/circle-dot-filled.svg create mode 100644 src/fontra/client/tabler-icons/circle-dotted.svg diff --git a/src/fontra/client/tabler-icons/circle-dot-filled.svg b/src/fontra/client/tabler-icons/circle-dot-filled.svg deleted file mode 100644 index 363acba63..000000000 --- a/src/fontra/client/tabler-icons/circle-dot-filled.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/fontra/client/tabler-icons/circle-dotted.svg b/src/fontra/client/tabler-icons/circle-dotted.svg new file mode 100644 index 000000000..9fd73511a --- /dev/null +++ b/src/fontra/client/tabler-icons/circle-dotted.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/fontra/views/editor/panel-designspace-navigation.js b/src/fontra/views/editor/panel-designspace-navigation.js index 9402e5a98..b23335a96 100644 --- a/src/fontra/views/editor/panel-designspace-navigation.js +++ b/src/fontra/views/editor/panel-designspace-navigation.js @@ -874,9 +874,7 @@ function circleDotListCell(item, colDesc) { }, [ html.createDomElement("inline-svg", { - src: value - ? "/tabler-icons/circle-dot.svg" - : "/tabler-icons/circle-dot-filled.svg", + src: value ? "/tabler-icons/circle-dot.svg" : "/tabler-icons/circle-dotted.svg", }), ] );