This patch adds a `close()` function that can be called to close a popup
window, and a `close-to-click` boolean that can be set to false to
disable the default behavior.
The added functions enable mixing colors and manipulating the opacity
of colors and brushes.
They enable the behavior of some of the available functions from SASS and are
added for future use for adding the Adwaita style (future PR).
In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.
Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
This simplifies the logic for how to apply window related requests as
they can be applied to the winit window immediately.
It also simplifies the state handling in the WinitWindowAdapter, as
there's no more distinction between mapped and unmapped. We always map
now (winit does).
One related change in core is that the window properties are now sent to
the backend before calling show(), instead of after.
The creation of the renderer might fail, for example if we tried to
create an OpenGL renderer on a display that doesn't support OpenGL. We
should catch that in the future and fall back to the software renderer.
For .slint files that are included, we canonicalize the path before
adding it into the import stack, to avoid duplicates. We didn't do that
for images in the global_embedded_resources.
Ensure this by canonicalizing as early as possible.
Fixes#2608
We need to check whether we wrapped around in the main part of the
logic: find_next can be called repeatedly in one walk of a tree, so it
fails if there are two or more items that are all sorted out later.
* 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
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
Don't try to install a callback handler that captures an invalid
expression. The llr pass has an invalid expression guard, and so does
the rest of this handle_property_bindings_init callback.
Fixes#2319
This commit can be reverted when we want to introduce it again.
There is a few bugs with the editable property:
- The text is not in sync with the model if the model changes after an
edit. (can be seen by making an edit and then sort)
- The highlight of the current row doesn't work properly
- We should probably only edit on double click or some shortcut instead
of just clicking
- The editable field exist but does nothing for the StandardListView
This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
Make sure that we return an unsigned for row_count() in C++ and Rust by ensuring an unsigned int model at creation time.
For the interpreter this "worked" by chance as casting a negative floating
number to usize automatically caps at zero, and all values are stored as f64. For safety this patch
applies the same fix though, to be on the safe side.
* Text only StandardTableView with column and rows
* Text editing of cells
* Sort by column ascending and descending
* Variants of the TableView for native, fluent and material