With this new version we use $OSTYPE bash env var to query what OS
are we running on.
- On Linux, ex: Fedora, we use `xdg-open`
- On Windows, ex: msys, we use `start`
- For other other variants we try to use `open`
We should update this script when we notice that `open` is not
available on a particular platform.
Added `tab_moves_focus()` to `TextEdit` so we can opt-in to the
"tab-as-character" behaviour.
Also because we decided to lock the tab size to 4 spaces, we gave
up on the `tab_size` property, but we kept the opt-in for the
"tab-as-spaces" behaviour.
An updated example of how to use `TextEdit` with those two opt-in
behaviours can be found in the "Misc Demos" demo.
When we load a string in `TextEdit` we keep the tabs as they are.
Now depending on `tab_as_spaces` and `tab_size` properties of the
`TextEdit` we have the following situations:
- When `tab_as_spaces` is false, then when we press `TAB` a `TAB`
char in added to the string.
- When `tab_as_spaces` is true, then when we press `TAB` a chunck
of `tab_size` spaces is added to the string.
To config `tab_as_spaces` and `tab_size` to the values we want we
can use the folliwing helper functions:
- `TextEdit::tab_as_spaces()`
- `TextEdit::tab_size()`
Example usage:
```rust
ui.add(egui::TextEdit::multiline(&mut self.multiline_text_input)
.tab_as_spaces(self.tab_as_spaces)
.tab_size(self.tab_size));
```
Demo:
A better demo of this new functionality was implemented in the
misc widgets demo
What's left to do:
- Render actual `TAB` as a rect the size of `tab_size` spaces.
- Without default parameters values it seems a pain to implement.
I need to think if it is possible to avoid API breaking changes
for the font system. From my checks so far I need to pass at
least `tab_size` to the fonts system to know how big the glyph
for `TAB` will be.
* add texture registering function
* fmt
* Revert "add texture registering function"
This reverts commit f9b4db12
* make get_texture public to get render target owned by Painter .
* revert egui_web painter.rs change