mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
Frontend fixed to render changes to working colors when changed from backend (#180)
* Backend and Frontend modification to show working color mods * Remove comments & change precedence for tool and doc actions * Add keybind for resetting work colors * Minor Frontend changes
This commit is contained in:
committed by
GitHub
parent
0e488d99ff
commit
e867f4d7fc
@@ -70,6 +70,7 @@ import { rgbToDecimalRgb } from "@/lib/utils";
|
||||
import { defineComponent } from "vue";
|
||||
import ColorPicker from "../floating-menus/ColorPicker.vue";
|
||||
import FloatingMenu, { MenuDirection, MenuType } from "../floating-menus/FloatingMenu.vue";
|
||||
import { ResponseType, registerResponseHandler, Response, UpdateWorkingColors } from "../../../response-handler";
|
||||
|
||||
const wasm = import("../../../../wasm/pkg");
|
||||
|
||||
@@ -127,6 +128,14 @@ export default defineComponent({
|
||||
mounted() {
|
||||
this.$watch("primaryColor", this.updatePrimaryColor, { immediate: true });
|
||||
this.$watch("secondaryColor", this.updateSecondaryColor, { immediate: true });
|
||||
|
||||
registerResponseHandler(ResponseType.UpdateWorkingColors, (responseData: Response) => {
|
||||
const colorData = responseData as UpdateWorkingColors;
|
||||
if (!colorData) return;
|
||||
const { primary, secondary } = colorData;
|
||||
this.primaryColor = { r: primary.red, g: primary.green, b: primary.blue, a: primary.alpha };
|
||||
this.secondaryColor = { r: secondary.red, g: secondary.green, b: secondary.blue, a: secondary.alpha };
|
||||
});
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user