forked from linebender/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update Local fork #2
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…#1602) Because they aren't laid out, the needs_layout flag of their widget pod gets merged up and eventually causes over invalidation of the window handle. On macOS 10.15, this is inexplicably segfault worthy.
It has taken me a large number of hours to decide on this particular one-line fix, and I'm still not 100% sure what's going on. That said, the logic now feels more correct: if we're invalidating everything then that necessarily means we're invalidating whatever rects were in the list, and we can ignore them. More concretely, I think this was a bug; by leaving the invalid rects in place, a subsequent call to `invalidate_and_finalize` would see the left over rects and invalidate again, unnecessarily. I do *not* know why this bug caused (or was a factor in) #1593. My best guess is that there was a change to how macOS handles setNeedsDisplayInRect: when it is called from viewWillDraw:; my guess is that if you call this method after having previously called setNeedsDisplay: it will assume that the new rect is more accurate than the previous blanket invalidation, and will only redraw the new rect. I'm not convinced of this explanation, though. In particular, it looks like our drawRect call is still being passed the expected rect, the pixels just end up not the ones we expect. Okay, here's my *revised* theory; the additional invalidation is triggering a second paint call before the frame deadline, and so the initial paint work, which covered the entire window, is discarded; the second paint call does not update the regions that weren't explicitly invalidated, and so we end up failing to repaint portions of the view. I think that might be it.
* move spacers away from being widget backed * small cleanup * other implementation * fix?? * small performance improvements * undo changes in example * undo changes in example * undo changes in example * fmt * add changelog * mode to struct fields and add `.widget{_mut}` method on flex children * fmt * _even better_ nice looking stuff * Update druid/src/widget/flex.rs Co-authored-by: Colin Rofls <colin@cmyr.net> * Update druid/src/widget/flex.rs Co-authored-by: Colin Rofls <colin@cmyr.net> * Update druid/src/widget/flex.rs Co-authored-by: Colin Rofls <colin@cmyr.net> * Apply suggestions from code review Co-authored-by: Colin Rofls <colin@cmyr.net>
* Use correct fill rule when rendering SVG paths * Update CHANGELOG.md
* Implement HasRawWindowHandle trait for win/mac Implement the HasRawWindowHandle trait for Windows and macOS platforms, to allow access to native window handles for interop. * Remove libc dependency * Fix typo in HWND * Return empty handle and log error on fail * Fix typo
* More Cursors * Fix example * Remove Busy Cursor * Deprecate Cursor::OpenHand * Fix example
This breaks up the impl blocks a bit so that fewer methods require the `W: Widget<T>` bound. It also includes a few small tweaks to the docs and the order of method declarations.
This adds a flag that forces the child to be at least as large as the parent, which is a common behaviour for scroll views. I'm playing around with using this with the textbox, instead of having our own manual scroll implementation.
These make it possible to configure a few more aspects of the scrollview's behaviour after it is created. This will be used for upcoming changes to the textbox.
Signed-off-by: Christopher N. Hesse <raymanfx@gmail.com>
Adds APIs for cross-platform text input, and an initial implementation of text input on macOS that allows for dead keys, IME input for Chinese, Japanese, etc. On other platforms, the text input method calls are simulated from key_down events, as a temporary measure until we can properly implement input methods on those platforms. Also adds a new druid-shell example, `edit_text`, which is a rough, LTR and single-line only implementation of the text input APIs to demonstrate that they work correctly. A massive thanks to yvt's library tcw3 (https://github.com/yvt/Stella2), which was a fantastic blueprint for the structure of this API, as well as indispensable reference when implementing the macOS text input interfaces.
Co-authored-by: Colin Rofls <colin@cmyr.net>
Also contains various small API renamings in response to code review comments.
This started out as me wanting to just rewrap everything to 80 columns, and then turned into a few little additional touchups.
We'll need something like this in druid, because we need to know when we have to update the app data.
This isn't great, but it adds tab/return/delete, which feels like the bare minimum; we can implement more as future work.
And implement WidgetWrapper. This is another small thing I wanted for the textbox rework.
Menus are now updated semi-automatically from the app data. The public menu API has been substantially changed. Fixes #965
Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
This was PR'd before 1.51, but merged after, so we missed this.
Not a lot of breakage here, although there might be a bit more upstream.
This implements the behaviour where the selection behaviour of a drag gesture varies depending on whether the drag starts from a single, double, or triple-click. - closes #1570
Movement that lands on the end of a line can result in visually unexpected results because of our not correctly handling affinity.
Semi-transparency cleanup
* Ignore all /target/ folders * Update Data impl for RoundedRect * Just ignore all folders matching **/target, which matches Piet's gitignore * Bump kurbo version to 0.8.0 * Update CHANGELOG.md Co-authored-by: Joshua Wade <joshua_wade@selinc.com>
We were returning `None` in this case; the apple docs expect us to return A zero-width rectange.
Previously some of these were exposed at the root, and some of them existed only in druid_shell or in submodules; this reexports all text-related types from the module root, which should make finding text-related types much simpler.
…properly at startup).
const generics for Data :)
* Fix code * change changelog * change pr number * Add links to the bottom of file
Allow the `Application` to be restarted after it finished running, by ensuring it releases to false the atomic check for app initialization. On Windows platform, additionally ensure the window class is only registered once per process run, as duplicate registration will fail. This enables writing unit tests for druid-shell, which otherwise cannot be run in batch. This however still require the use of `--test-threads=1` to prevent parallel testing, which this change does not cover. Bug: #771
* updating FlexParams to protect against flex values <= 0.0 - there is still more work to do to figure out how Flex children use 0.0 flex value * protecting from invalid values for flex space and fixed space * fixing up some of the debug messages and a doc comment * fixing incorrect debug assertion * updating `with_child` to use `add_child` * adding tests that work in release and debug * removing unnecessary comments * updating with suggested fixes * removing wrong doc comment * fixing new test case * adding a little formatting to warning message * updating changelog * removing instrument macro Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
* - added LifeCycle::DisabledChanged and InternalLifeCycle::RouteDisabledChanged - implemented the disabled state in WidgetPod - changed call to focus_change from event to post event processing - implemented disabled handling in window.rs and core.rs * created tests for disable * fixed tests * fixed tests * updated core.rs and event.rs * fixed focus-chain bug: - the focus chain was cleared, if the widget was disabled * fix disabled update * update tests * fixed code (all tests succeed) * refactored core.rs and tests/mod.rs * updated tests * fixed focus-chain bug * make clippy happy (i hope) * make clippy happy #2 * Apply suggestions from code review Update Documentation Co-authored-by: Colin Rofls <colin@cmyr.net> * Update druid/src/contexts.rs Update documentation Co-authored-by: Colin Rofls <colin@cmyr.net> * refactor DisabledChanged * refactor DisabledChanged * fixed error, revered change of focus_chain * refactored tests * reordered lifecycle events * reverted changes to the focus_chain * implemented new focus-chain using LifeCycle::BuildFocusChain * update tests * fixed problems * updated texts * clippy fix * fixed documentation * Update druid/src/event.rs Co-authored-by: Colin Rofls <colin@cmyr.net> * fixed documentation * made logic simpler * refactored post_event_processing * updated CHANGELOG.md * fixed docs * make clippy happy Co-authored-by: xarvic <xarvix@web.de> Co-authored-by: Colin Rofls <colin@cmyr.net>
* updating viewswitcher doc to be more accurate * Update druid/src/widget/view_switcher.rs * updating changelog Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com> Co-authored-by: Colin Rofls <colin@cmyr.net>
xarvic
added a commit
that referenced
this pull request
May 3, 2021
* - added LifeCycle::DisabledChanged and InternalLifeCycle::RouteDisabledChanged - implemented the disabled state in WidgetPod - changed call to focus_change from event to post event processing - implemented disabled handling in window.rs and core.rs * created tests for disable * fixed tests * fixed tests * updated core.rs and event.rs * fixed focus-chain bug: - the focus chain was cleared, if the widget was disabled * fix disabled update * update tests * fixed code (all tests succeed) * refactored core.rs and tests/mod.rs * updated tests * fixed focus-chain bug * make clippy happy (i hope) * make clippy happy #2 * Apply suggestions from code review Update Documentation Co-authored-by: Colin Rofls <colin@cmyr.net> * Update druid/src/contexts.rs Update documentation Co-authored-by: Colin Rofls <colin@cmyr.net> * refactor DisabledChanged * refactor DisabledChanged * fixed error, revered change of focus_chain * refactored tests * reordered lifecycle events * reverted changes to the focus_chain * implemented new focus-chain using LifeCycle::BuildFocusChain * update tests * fixed problems * updated texts * clippy fix * fixed documentation * Update druid/src/event.rs Co-authored-by: Colin Rofls <colin@cmyr.net> * fixed documentation * made logic simpler * refactored post_event_processing * updated CHANGELOG.md * fixed docs * make clippy happy * implemented DisabledIf * reformat * updated CHANGELOG.md * fix issue * updated example Signed-off-by: xarvic <xarvix@web.de> * added License, updated documentation Signed-off-by: xarvic <xarvix@web.de> * reformat Signed-off-by: xarvic <xarvix@web.de> * reformat Signed-off-by: xarvic <xarvix@web.de> * implement disabled state for button Signed-off-by: xarvic <xarvix@web.de> * updated visuals of controls when disabled Signed-off-by: xarvic <xarvix@web.de> * reformat Signed-off-by: xarvic <xarvix@web.de> * run clippy Signed-off-by: xarvic <xarvix@web.de> * run cargo fmt Signed-off-by: xarvic <xarvix@web.de> * Update CHANGELOG.md * implemented disabled-text-color Signed-off-by: xarvic <xarvix@web.de> * changed background Signed-off-by: xarvic <xarvix@web.de> * reformat Signed-off-by: xarvic <xarvix@web.de> * Changed label. Signed-off-by: xarvic <xarvix@web.de> * added deprecation note Signed-off-by: xarvic <xarvix@web.de> Co-authored-by: xarvic <xarvix@web.de> Co-authored-by: Colin Rofls <colin@cmyr.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.