From 73b8dc28f66cb5a5c5882bb7bce3f47be5b3dc78 Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Sun, 1 Dec 2024 07:15:27 +0100 Subject: [PATCH 1/3] switch no clickable area --- nodes/widgets/locales/en-US/ui_switch.html | 1 + nodes/widgets/ui_switch.html | 3 ++- ui/src/widgets/ui-switch/UISwitch.vue | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nodes/widgets/locales/en-US/ui_switch.html b/nodes/widgets/locales/en-US/ui_switch.html index 75a1e65f9..a9502df52 100644 --- a/nodes/widgets/locales/en-US/ui_switch.html +++ b/nodes/widgets/locales/en-US/ui_switch.html @@ -78,6 +78,7 @@

Dynamic Properties (Inputs)

  • switch: only the switch icon is clickable
  • label: both the label text and the switch icon are clickable
  • line: the entire line is clickable
  • +
  • none: neither the label text nor the switch icon are clickable
  • diff --git a/nodes/widgets/ui_switch.html b/nodes/widgets/ui_switch.html index e447e8839..ca07432ee 100644 --- a/nodes/widgets/ui_switch.html +++ b/nodes/widgets/ui_switch.html @@ -193,6 +193,7 @@ +
    @@ -349,4 +350,4 @@ display: none; } - \ No newline at end of file + diff --git a/ui/src/widgets/ui-switch/UISwitch.vue b/ui/src/widgets/ui-switch/UISwitch.vue index 4a4e7181c..7633f9d2f 100644 --- a/ui/src/widgets/ui-switch/UISwitch.vue +++ b/ui/src/widgets/ui-switch/UISwitch.vue @@ -18,10 +18,11 @@ v-if="!icon" v-model="status" :disabled="!state.enabled" :class="{'active': status}" + :style="{cursor: switchClickable ? 'pointer' : 'inherit'}" hide-details="auto" color="primary" :loading="loading ? (status === true ? 'secondary' : 'primary') : null" readonly - @click="toggle" + @click="switchClickable ? toggle() : null" /> @@ -87,6 +88,9 @@ export default { lineClickable: function () { return this.getProperty('clickableArea') === 'line' }, + switchClickable: function () { + return this.getProperty('clickableArea') !== 'none' + }, textClickable: function () { return this.getProperty('clickableArea') === 'label' || this.getProperty('clickableArea') === 'line' }, From 71de81b93f9e42d879e4b06df15cd1bdaf5ccd39 Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Sun, 1 Dec 2024 07:35:08 +0100 Subject: [PATCH 2/3] switch all cursors default --- ui/src/widgets/ui-switch/UISwitch.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/widgets/ui-switch/UISwitch.vue b/ui/src/widgets/ui-switch/UISwitch.vue index 7633f9d2f..2982924e2 100644 --- a/ui/src/widgets/ui-switch/UISwitch.vue +++ b/ui/src/widgets/ui-switch/UISwitch.vue @@ -18,7 +18,7 @@ v-if="!icon" v-model="status" :disabled="!state.enabled" :class="{'active': status}" - :style="{cursor: switchClickable ? 'pointer' : 'inherit'}" + :style="{cursor: switchClickable ? 'pointer' : 'default'}" hide-details="auto" color="primary" :loading="loading ? (status === true ? 'secondary' : 'primary') : null" readonly From 0079d23246e2753d9ee0ddeaccabc72ab46f1b87 Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Mon, 2 Dec 2024 23:16:07 +0100 Subject: [PATCH 3/3] CSS fix --- ui/src/widgets/ui-switch/UISwitch.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ui/src/widgets/ui-switch/UISwitch.vue b/ui/src/widgets/ui-switch/UISwitch.vue index 2982924e2..6c1ae2ac0 100644 --- a/ui/src/widgets/ui-switch/UISwitch.vue +++ b/ui/src/widgets/ui-switch/UISwitch.vue @@ -1,10 +1,13 @@