mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 05:28:12 +08:00
Refactor frontend input components to use the v-model Vue pattern (#224)
* Use v-model for inputs * Add opacity to LayerTree * Fix FloatingMenu typing
This commit is contained in:
committed by
Keavon Chambers
parent
3b5cc535ee
commit
a0c1d7f898
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div class="right side">
|
||||
<RadioInput :initialIndex="0" @changed="viewModeChanged">
|
||||
<RadioInput v-model:index="viewModeIndex">
|
||||
<IconButton :icon="'ViewModeNormal'" :size="24" title="View Mode: Normal" />
|
||||
<IconButton :icon="'ViewModeOutline'" :size="24" title="View Mode: Outline" />
|
||||
<IconButton :icon="'ViewModePixels'" :size="24" title="View Mode: Pixels" />
|
||||
@@ -236,6 +236,7 @@ export default defineComponent({
|
||||
select_tool(toolName);
|
||||
},
|
||||
async viewModeChanged(toolIndex: number) {
|
||||
console.log(toolIndex);
|
||||
function todo(_: number) {
|
||||
return _;
|
||||
}
|
||||
@@ -269,6 +270,8 @@ export default defineComponent({
|
||||
|
||||
window.addEventListener("keyup", (e: KeyboardEvent) => this.keyUp(e));
|
||||
window.addEventListener("keydown", (e: KeyboardEvent) => this.keyDown(e));
|
||||
|
||||
this.$watch("viewModeIndex", this.viewModeChanged);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -278,6 +281,7 @@ export default defineComponent({
|
||||
SeparatorDirection,
|
||||
SeparatorType,
|
||||
modeMenuEntries,
|
||||
viewModeIndex: 0,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
||||
Reference in New Issue
Block a user