From 4a9e686816507c36ec80b1a133a981089d7cca70 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Mon, 27 Jun 2022 01:41:18 +1000 Subject: Clean up code in SettingsModal Add reduced-versions of developer options Add input-range value indicators --- src/components/SettingsModal.vue | 278 +++++++++++++++++++++------------------ src/components/Tile.vue | 10 +- 2 files changed, 153 insertions(+), 135 deletions(-) (limited to 'src/components') diff --git a/src/components/SettingsModal.vue b/src/components/SettingsModal.vue index a54fa58..83b42af 100644 --- a/src/components/SettingsModal.vue +++ b/src/components/SettingsModal.vue @@ -1,164 +1,182 @@ diff --git a/src/components/Tile.vue b/src/components/Tile.vue index 9983749..608938e 100644 --- a/src/components/Tile.vue +++ b/src/components/Tile.vue @@ -327,7 +327,7 @@ export default defineComponent({ watch: { // For setting transition state (allows external triggering, like via search and auto-mode) pos: { - handler(newVal, oldVal){ + handler(newVal: [number, number], oldVal: [number, number]){ let valChanged = newVal[0] != oldVal[0] || newVal[1] != oldVal[1]; if (valChanged && this.uiOpts.transitionDuration > 100 && !this.inTransition){ this.inTransition = true; @@ -336,7 +336,7 @@ export default defineComponent({ deep: true, }, dims: { - handler(newVal, oldVal){ + handler(newVal: [number, number], oldVal: [number, number]){ let valChanged = newVal[0] != oldVal[0] || newVal[1] != oldVal[1]; if (valChanged && this.uiOpts.transitionDuration > 100 && !this.inTransition){ this.inTransition = true; @@ -349,7 +349,7 @@ export default defineComponent({ this.triggerAnimation(this.isLeaf ? 'animate-expand-shrink' : 'animate-shrink-expand'); }, // Scroll to focused child if overflownRoot - hasFocusedChild(newVal, oldVal){ + hasFocusedChild(newVal: boolean, oldVal: boolean){ if (newVal && this.isOverflownRoot){ let focusedChild = this.layoutNode.children.find(n => n.hasFocus)! let bottomY = focusedChild.pos[1] + focusedChild.dims[1] + this.lytOpts.tileSpacing; @@ -358,14 +358,14 @@ export default defineComponent({ } }, // Allow overflow temporarily after being unhidden - hidden(newVal, oldVal){ + hidden(newVal: boolean, oldVal: boolean){ if (oldVal && !newVal){ this.justUnhidden = true; setTimeout(() => {this.justUnhidden = false;}, this.uiOpts.transitionDuration); } }, // Used to 'flash' the tile when focused - hasFocus(newVal, oldVal){ + hasFocus(newVal: boolean, oldVal: boolean){ if (newVal != oldVal && newVal){ this.inFlash = true; setTimeout(() => {this.inFlash = false;}, this.uiOpts.transitionDuration); -- cgit v1.2.3