Fix out of sync propeties with new pickers (#8183)

This commit is contained in:
Nigel Breslaw 2025-04-16 17:59:55 +03:00 committed by GitHub
parent efafb9d8b6
commit 076e933515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 37 deletions

View file

@ -100,34 +100,16 @@ export component PropertyValueWidget inherits VerticalLayout {
code-action() => {
root.code-action();
}
init => {
// Floating editors need to know the current property details. Call the update if something changes.
if WindowManager.showing-color-picker && WindowManager.current-property-information.name == root.property-name {
self.update-floating-editor();
}
}
}
// if root.property-value.kind == PropertyValueKind.brush: BrushWidget {
// // enabled <=> root.enabled;
// property-name <=> root.property-name;
// property-value <=> root.property-value;
// preview-data <=> root.preview-data;
// // has-code-action: root.has-code-action;
// // has-reset-action: root.has-reset-action;
// test-brush-binding(kind, angle, color, stops) => {
// return root.test-brush-binding(kind, angle, color, stops);
// }
// set-brush-binding(kind, angle, color, stops) => {
// root.set-brush-binding(kind, angle, color, stops);
// }
// update-display-string(value) => { root.update-display-string-impl(value); }
// reset-action() => {
// root.reset-action();
// }
// code-action() => {
// root.code-action();
// }
// }
if root.property-value.kind == PropertyValueKind.code: CodeWidget {
enabled <=> root.enabled;
property-name <=> root.property-name;

View file

@ -290,17 +290,9 @@ export component InlineColorWidget inherits VerticalLayout {
}
changed property-value => {
if self.property-value.kind != PropertyValueKind.color && self.property-value.kind != PropertyValueKind.brush {
return;
}
if !self.has-focus {
apply-value();
}
// Floating editors need to know the current property details. Call the update if something changes.
if WindowManager.showing-color-picker && WindowManager.current-property-information.name == root.property-name {
root.update-floating-editor();
}
}

View file

@ -44,12 +44,12 @@ export component PreviewUi inherits Window {
init => {
WindowGlobal.window-width = self.width;
WindowGlobal.window-height = self.height;
initial-floating-x = (self.width - PickerStyles.picker-width - 300px).max(0);
initial-floating-x = (self.width - PickerStyles.picker-width - 350px).max(0);
}
changed width => {
WindowGlobal.window-width = self.width;
initial-floating-x = (self.width - PickerStyles.picker-width - 300px).max(0);
initial-floating-x = (self.width - PickerStyles.picker-width - 350px).max(0);
}
changed height => {
WindowGlobal.window-height = self.height;
@ -184,7 +184,7 @@ export component PreviewUi inherits Window {
color-stop-mode: true;
init => {
self.initial-x = root.initial-floating-x - 200px;
self.initial-x = root.initial-floating-x - 240px;
self.initial-y = 50px;
}
close => {