From 6ce8bba6b7e9ccbb6a0e8ebdf9b158ca4a2a161f Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 9 Apr 2022 15:58:40 +0200 Subject: [PATCH] Start working on the edit box for crop settings --- src/csui/src/PlayerUiPanels/VideoSettings.vue | 73 ++++++++++++++++++- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/src/csui/src/PlayerUiPanels/VideoSettings.vue b/src/csui/src/PlayerUiPanels/VideoSettings.vue index 87ce150..55f7aaa 100644 --- a/src/csui/src/PlayerUiPanels/VideoSettings.vue +++ b/src/csui/src/PlayerUiPanels/VideoSettings.vue @@ -11,7 +11,7 @@
Exit edit mode
@@ -20,7 +20,7 @@
Edit ratios and shortcuts
@@ -44,11 +44,56 @@ :key="index" :label="command.label" :shortcut="getKeyboardShortcutLabel(command)" - @click="execAction(command)" + @click="editMode ? editAction(command, 'crop') : execAction(command)" > + +
+
+ Editing options for {{editModeOptions?.crop?.selected?.label}} +
+ + + + + +
+ -- todo: edit keyboard shortcut -- +
+ +
+ ------------
> + present items:
> + editModeOptions? {{!!editModeOptions}}
+ .crop? {{!!editModeOptions?.crop}}
+ .selected? {{!!editModeOptions?.crop?.selected}}
+
+ selected action:
{{editModeOptions?.crop?.selected}} +
+ + +
+
Default for this site
@@ -274,6 +319,7 @@ export default { y: 0 }, editMode: true, + editModeOptions: {}, resizerConfig: { crop: null, stretch: null, @@ -455,7 +501,26 @@ export default { //#endregion cropping //#region edit mode + enableEditMode() { + this.editMode = true; + this.editModeOptions = {}; + }, + disableEditMode() { + this.editMode = false; + }, + + editAction(command, actionType) { + try { + if (!this.editModeOptions[actionType]) { + this.editModeOptions[actionType] = {selected: command} + } else { + this.editModeOptions[actionType].selected = command; + } + } catch (e) { + console.error(`[Ultrawidify] there's a problem with VideoSettings.vue::editAction():`, e); + } + }, //#endregion //#region comms and bus @@ -488,7 +553,7 @@ export default { if (! command.shortcut) { return ''; } - return KeyboardShortcutParser.getKeyboardShortcutLabel(command.shortcut); + return KeyboardShortcutParser.parseShortcut(command.shortcut); }, } }