Commit graph

1937 commits

Author SHA1 Message Date
Tobias Hunger
8b022cd917 Janitor: Fix remaining instance of clippy::iter_cloned_collect 2021-07-21 19:44:57 +02:00
Tobias Hunger
f02ab4d8c3 Janitor: Remove some unnecessary & 2021-07-21 19:44:57 +02:00
Tobias Hunger
a8b2aa2f2d Janitor: Fix cspell complaining about toint 2021-07-21 19:44:57 +02:00
Tobias Hunger
56fea6e6c3 Janitor: Fix clippy::many_single_char_names 2021-07-21 19:44:57 +02:00
Simon Hausmann
1c285694d7 internal cleanup: Remove the use of ComponentWindow in the interpreter 2021-07-21 17:41:12 +02:00
Simon Hausmann
ef184f7f1a internal cleanup: Remove the rest of the ComponentWindow API
Now it just remains a wrapper around the Rc, and it can soon be moved to
the API crate hopefully.
2021-07-21 17:41:12 +02:00
Simon Hausmann
77ea5b7a15 API cleanup: hide the rest of the ComponentWindow "internals" 2021-07-21 17:41:12 +02:00
Simon Hausmann
4c1d9dc03e internal cleanup: Remove the poup functions from ComponentWindow
Use WindowHandleAccess instead. Also the clone()
isn't needed anymore since the function take a self reference instead of an Rc<Self> by value.
2021-07-21 17:41:12 +02:00
Simon Hausmann
e005058285 internal cleanup: remove free_graphics_resource from the public ComponentWindow API
Use the WindowHandleAccess backdoor instead.
2021-07-21 17:41:12 +02:00
Simon Hausmann
e4717824f8 internal cleanup: Prepare for more Window internals encapsulation
Hide access to the internals behind a trait that won't be re-exported
into the public Rust API. This allows removing as_any() again.
2021-07-21 17:41:12 +02:00
Simon Hausmann
e902395d09 Trim the Rust ComponentWindow API a little bit more
* Remove some public wrapper functions that are crate internal
2021-07-21 17:41:12 +02:00
Simon Hausmann
2553dd1459 Trim the Rust ComponentWindow API and implementation a little bit
* Remove the `new` function from the main impl and use the slightly
  less visible From conversion trait
* Make the inner Rc<Window> pub(crate) instead of pub
* Instead, provide a public as_any() accessor that the Qt backend can use
2021-07-21 17:41:12 +02:00
Simon Hausmann
492af0f67c Rename the implementation of the Window item to WindowItem
If we were to add `sixtyfps:🪟:Window` to the re_exports, then
this clashes. We might rename the former, but this is a cleaner naming
in any case.

Relates to #333
2021-07-20 17:50:17 +02:00
Olivier Goffart
b194c62c22 GL backend: Use the cache for the Window icon 2021-07-20 17:02:24 +02:00
Olivier Goffart
1360f1e26e Added icon property to the Window element 2021-07-20 16:34:19 +02:00
Simon Hausmann
68626e27fb internal cleanup: simplify free_graphics_resources trait signature
This allows then routing the call through window::Window's Deref impl
2021-07-20 16:19:45 +02:00
Olivier Goffart
673c0ce81c Add a as_any to the Model trait to allow getting a reference to the original model 2021-07-20 15:38:10 +02:00
Simon Hausmann
457ae53cde qt renderer: Fix difference between font metrics and rendering
When the widget itself is part of a hierarchy and some parent widget defines
font properties (such as weight, etc.) that aren't defined in .60, we would
inherit those for rendering, but not when measuring.

Since when measuring we don't have a widget, this patch disables all font
property merging from the widget hierarchy.
2021-07-20 13:33:25 +02:00
Simon Hausmann
1273391f3a Don't show non-existent glyph boxes for emojis on macOS
Instead, include the emoji font in the fallback list.
Once femtovg learns to render color fonts, they will show up.
2021-07-20 08:45:10 +02:00
Simon Hausmann
f4ffbd3d3d Fix panic when editing text after programmatically replacing it
When replacing the text, it may happen that the cursor position becomes outdated.
As per #331 we should make sure that this is handled also on an API level,
but this patch at least avoids the panic triggered by using editing.
2021-07-19 18:30:06 +02:00
Olivier Goffart
07c1504627 Ammend previous commit
The test for empty text in NativeButton was meant for the sizeHint call,
not the render call.

Also fix a warning about unused variable
2021-07-16 22:30:38 +02:00
Olivier Goffart
ee53866afb Native style: fix sizing of the ComboBox 2021-07-16 22:15:51 +02:00
Tobias Hunger
efc0d63e8b Janitor: iter().cloned().collect() on a slice to create a Vec == to_vec()
This is clippy::iter_cloned_collect
2021-07-15 07:55:06 +02:00
Simon Hausmann
91e2154a66 Remove the freetype dependency on Windows and macOS
It's not needed and this would fix #315
2021-07-13 19:29:49 +02:00
Olivier Goffart
cc8249212d Fix name conflict when having two global with the same name in different files
Give globals an unique id so two global with the same name imported
from different file don't clash

Fixes #159
2021-07-13 14:36:38 +02:00
Olivier Goffart
1eb54a4743 The clip property now clips the mouse events
Fixes #180

Note that there is still a small issue that the clipped element may
not recieve the MouseExit event because it is still considered
having the mouse.
2021-07-12 15:39:39 +02:00
Tobias Hunger
5b37521e0a Janitor: Allow warning about unnecessary closures 2021-07-12 15:01:19 +02:00
Tobias Hunger
b29360dc5c Janitor: a = a % b is a %= b 2021-07-12 15:01:19 +02:00
Tobias Hunger
a5f4645640 Janitor: Spelling fixes
Work around cspell not liking words ending in `'s` :-)
2021-07-12 15:01:19 +02:00
Tobias Hunger
58cbfa780d Janitor: Spell out argument 2021-07-12 15:01:19 +02:00
Tobias Hunger
9608825eb2 Janitor: Use if let over Option::map returning () 2021-07-12 15:01:19 +02:00
Tobias Hunger
b24e52e0fa Janitor: Remove useless addition on 0
This quietens a clippy warning, but also breaks symmetry:-(
2021-07-12 15:01:19 +02:00
Tobias Hunger
ede172b758 Janitor: Spell out local variable names 2021-07-12 15:01:19 +02:00
Tobias Hunger
925afb2ba4 Janitor: Remove unnecessary lifetimes 2021-07-12 15:01:19 +02:00
Tobias Hunger
5f488bd7fc Janitor: Spell out local variable name 2021-07-12 15:01:19 +02:00
Tobias Hunger
70f4eff2d5 Janitor: !(a > 0) is a <= 0 2021-07-12 15:01:19 +02:00
Tobias Hunger
d68ac7a664 Janitor: CSpell ignore coord in document 2021-07-12 15:01:19 +02:00
Simon Hausmann
9b4752bdfa Silence cSpell on window.rs :) 2021-07-12 14:14:12 +02:00
Simon Hausmann
6e12b00b3f Re-add new constructor functions for ComponentCompiler and CompilerConfiguration
Amends commit dc51d4ccda

As discussed in #310
2021-07-12 13:26:17 +02:00
Tobias Hunger
dc51d4ccda Use impl Default instead of new() constructors 2021-07-12 13:22:25 +02:00
Tobias Hunger
b105d6add3 Janitor: Do the float comparision dance
I think it is actually makes sense in this case!
2021-07-09 17:00:46 +02:00
Tobias Hunger
ad98137c17 Janitor: Mark up float comparisons where we want bitwise identity
Mark up test cases where we want bitwise identity of float values and
use `assert_eq!` since that produces better output in the error case.
2021-07-09 17:00:46 +02:00
Simon Hausmann
c40f3a57ee Add support for debug() in .60 logging to console.log in the online editor
In non-wasm builds debug_log! sends to eprintln!, so there should be no
change. For wasm debug_log! hoever goes to the console.
2021-07-09 11:08:23 +02:00
Tobias Hunger
2fdfbae33e Janitor: Remove unnecessary lifetimes 2021-07-08 20:43:38 +02:00
Tobias Hunger
35dd3ed282 Janitor: Remove redundant clone() calls 2021-07-08 20:43:38 +02:00
Tobias Hunger
b57c27cf04 Janitor: Allow nonstandard_macro_braces in SixtyFPSElement macro 2021-07-08 20:43:38 +02:00
Tobias Hunger
f24df0f94f Janitor: Typo fixes 2021-07-08 20:43:38 +02:00
Tobias Hunger
3f5ad42683 Janitor: Fix typo in comment 2021-07-08 06:47:05 +02:00
Olivier Goffart
a987b225b5 Collect all used components before inlining
And do some passes before inlining

We will need the list of components before inlining in order to generate
them if we disable inlining

So we can do some passes on each component before they are inlining

I tried to put the flickable pass in that list, but it did not work
if the Flickable itself is the root of a component
2021-07-07 17:58:43 +02:00
Tobias Hunger
e5bdeaa804 Janitor: Remove unnecessary & 2021-07-07 08:42:28 +02:00