Keyboard shortcuts for the image editor

This commit is contained in:
JeLuF 2023-07-02 20:31:38 +02:00
parent d17ee88ced
commit 0118c7c808
2 changed files with 9 additions and 5 deletions

View File

@ -1611,6 +1611,14 @@ body.wait-pause {
color: red;
}
.image-editor-button-label {
display: inline-block;
}
.image-editor-button-label::first-letter {
text-decoration: underline;
}
@keyframes slideInRight {
from {
right: -300px;
@ -1642,6 +1650,3 @@ body.wait-pause {
}
}
.image-editor-button-label::first-letter {
text-decoration: underline;
}

View File

@ -212,7 +212,7 @@ var IMAGE_EDITOR_SECTIONS = [
var icon = document.createElement("i")
tool_info.icon.split(" ").forEach((c) => icon.classList.add(c))
sub_element.appendChild(icon)
var label_element = document.createElement("span")
var label_element = document.createElement("div")
label_element.classList.add("image-editor-button-label")
label_element.textContent=tool_info.name
sub_element.appendChild(label_element)
@ -792,7 +792,6 @@ class ImageEditor {
return this.options && section_name in this.options ? this.options[section_name] : section.default
}
selectOption(section_name, option_index) {
console.log("SELECT", section_name, option_index)
var section = IMAGE_EDITOR_SECTIONS.find((s) => s.name == section_name)
var value = section.options[option_index]
this.options[section_name] = value == "custom" ? section.getCustom(this) : value