-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong documentation for opacity #7377
Comments
Thanks for the Bug report. The documentation is indeed wrong. I edited the description. |
Thanks. Is there another way to ignore an element in the layout? I want to create a pseudo element (like the timer) import { Permission, UserManagement } from "...";
export struct MethodResponse {
// random number to ensure, that property changed event is fired
rand: int,
success: bool,
}
export global Methods {
callback flow_start_calibration(calibrationType: string);
out property<Permission> flow_start_calibration_permission: Permission.None;
in-out property<MethodResponse> flow_start_calibration_response;
in-out property<bool> flow_start_calibration_in_progress: false;
}
export component flow_start_calibration {
visible: false;
public function call(calibrationType: string) {
// if method is currently called by this or from somewhere else, do not call it again
if root.in_progress {
return;
}
root.called_by_this = true;
Methods.flow_start_calibration(calibrationType);
}
callback call_completed(success: bool);
out property <bool> in_progress: Methods.flow_start_calibration_in_progress;
out property <bool> has_permission: UserManagement.has_permission(UserManagement.permissions, Methods.flow_start_calibration_permission);
changed response => {
if root.called_by_this {
call_completed(root.response.success);
root.called_by_this = false;
}
}
property <bool> called_by_this;
property <MethodResponse> response: Methods.flow_start_calibration_response;
}
We have dozens of these methods which do not immediatly return a response. These methods/components are all autogenereted and I think the pseudo-element would be a nice way to allow for different reactions on method completion. |
The docs for the
opacity
andvisible
properties contains mistake.https://docs.slint.dev/latest/docs/slint/reference/common/#opacity
Compared to the ones in 1.8: https://releases.slint.dev/1.8.0/docs/slint/src/language/builtins/elements.html
if ...:
construct) does it.Original description
Bug Description
If I understand the docs correctly, then an element with
visible: false
should not take any space in a layout?https://docs.slint.dev/latest/docs/slint/reference/common/#opacity
But this seems not to be the case. The element still takes its space in the layout. Even if the size is 0px it counts as extra element, which causes extra spacing, if defined in the layout.
Reproducible Code (if applicable)
Environment Details
Product Impact
No response
The text was updated successfully, but these errors were encountered: