I misread the spec about the name conversion for the DOMStringMap used in JS for the dataset
attribute and the name used in the DOM.
Both, the setting in preview_widget.ts as well as
reading it in windowadapter.rs counts as JavaScript access, so use camel case.
The old variant happened to work in Safari.
Amends 43234dafc5
Commit 893983e8d3 "fixed" it to be 0 based as it was
documented. But that's a change of behavior so restore the previous behavior and
document it properly
* compiler: Make mapping from source offset to line/column more reusable
* compiler: Improve mapping of offset to line/column
* Fix unit tests after line mapping update
* interpreter: Add code to have a element picker mode
* slintpad: Add picker mode to the preview
* slintpad: Do not try to highlight "empty" highlight requests
* Slintpad: Cycle through all the possible elements in design mode
* Slintpad: Ignore builtins and eat less clicks
* Slintpad: Highlight the element selected in design mode
* Slintpad: Do not use static mut variable in design mode
* slintpad: Rename `set_current_element_information_callback`
* Interpreter: Do not use unsafe in design mode code
Done with: @ogoffart and @tronical
When for example only a maximum height is set, but no maximum width,
avoid passing -1 or 0 to winit for the width. Instead use the same large
value was for Qt.
cc #2562
This happens e.g. in firefox in private browsing mode. So suggest to
disable private browsing mode when this happens.
I think that is the best I can do in this circumstance: Without the
service worker a lot of stuff just breaks.
Closes: #2548
We used to end the file with the component without any newline.
But previous commit added eof in the document, so we end with the \n\n after the
component. Override that to only have one newline before the end
The old parser always try first to find `Foo :=` from the old syntax so it
would error saying it expect an identifier or `:=`
But if we don't find a component, don't try to parse it as a component too early
This way we get better error and better auto-completions
That way the error for an expression is at a better location, and
this also prevent the formater that removes space in expressions to
remove the spaces before the expression that shouldn't be removed
Add explicit enum values for repr(C) enums that have attributes like
cfg, so that even if there's a cfg gap in an enum (say cfg(feature =
"svg")) it won't break the ABI.
See also 004dce6c0b
The previous code was only re-creating the layout properties for these
that had a binding, but that wasn't done if the property was just read,
leading to access to non-existing properties later.
Fixes#2483
Large C++ files generated from .slint files can cause link problems with MSVC.
When that happens, MSVC itself suggests /bigobj as remedy.
It's not apparent that there's a downside to using this option, apart from
backwaords binary compatibility - which is not a concern for us.
The discussion at https://developercommunity.visualstudio.com/t/Enable-bigobj-by-default/1031214 suggests that perhaps this
will become the default one day.
To simplify our examples and avoid users running into this, let's enable it by default.
The Furo theme by default generates a "on this page" contents list in
the right column. The breathe output for C++ namespace and file pages
also includes a ::contents:: RST directive, to summarize the available
headings. The duplication of these two is warned about by furo with a
big fat red warning.
Solve this by not making breathe generate the contents directive
anymore. According to
https://exhale.readthedocs.io/en/latest/reference/configs.html?highlight=contentsspecifier#exhale.configs.kindsWithContentsDirectives
it's by default used for files and namespace, so make it empty in our
config.
Fixes#2505
We need to take in account that the items might be clipped when sending
mouse exit events to items.
Note that the test needed a fix to use the actual windows state.
The ImageCacheKey enum has a gap when not targeting wasm:
```
pub enum ImageCacheKey {
/// This variant indicates that no image cache key can be created for the image.
/// For example this is the case for programmatically created images.
Invalid,
/// The image is identified by its path on the file system.
Path(SharedString),
/// The image is identified by a URL.
#[cfg(target_arch = "wasm32")]
URL(SharedString),
/// The image is identified by the static address of its encoded data.
EmbeddedData(usize),
}
```
In the C++ generated header, that cfg was not mapped, and thus the URL
variant was always there, while in a regular slint-cpp build it's not.
Consequently tag value 2 in Rust was used to represent the EmbeddedData
variant, while in the C++ generated code that become variant 3 and 2 was
interpreted as a URL. So the receiving code in C++ tried to interpret
the cache key as URL variant, while Rust created it as EmbeddedData.
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>