Commit Graph
404 Commits
Author SHA1 Message Date
Mikayla 324d1d119b Add some context to assert 2024-01-12 12:40:37 -08:00
Conrad Irwin 551fd9ba7e Boop 2024-01-12 12:40:09 -07:00
Antonio Scandurra 94293b3bf9 Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/gpui/src/window.rs
2024-01-12 14:31:13 +01:00
Piotr Osiewicz a1049546a2 gpui: Validate font contents at load time.
During layout of EditorElement we use 'm' character from current font to calculate sizes, panicking with fonts that do not have that character (e.g. Arabic fonts). It's not really EditorElement's fault, as it assumes that the font it's dealing with is gonna have that character available.
To prevent a crash, I added validation while loading a family that a given font contains the glyphs we're gonna use down the line.
2024-01-11 23:23:10 +01:00
Conrad Irwin a8b8be47e0 Don't hold platform lock while calling user callbacks
Inspired by a bug where using Edit -> Copy from the menu created a
deadlock.
2024-01-11 13:52:50 -07:00
Conrad Irwin 23fe720ca6 Fix multi-key shortcuts
An old fix was ported over from gpui1, and the two fixes could not exist
side-by-side. Delete this code and let the keymap handle it
2024-01-11 11:24:55 -07:00
Antonio Scandurra 50ccdf5c16 Reuse input handler when reusing a view tree 2024-01-11 13:22:59 +01:00
MikaylaandConrad 38396d4281 Add remaining tests
co-authored-by: Conrad <conrad@zed.dev>
2024-01-10 19:39:43 -08:00
Mikayla 1932a298cb Add back ime_key 2024-01-10 16:29:00 -08:00
Antonio Scandurra 1c260e6dfd Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/copilot/src/sign_in.rs
#	crates/gpui/src/window.rs
#	crates/workspace/src/pane_group.rs
2024-01-10 22:58:52 +01:00
Mikayla 7ef88397c9 Fix seg fault when using the WindowContext::on_window_should_close() API 2024-01-10 11:26:11 -08:00
Kirill Bulatov 6809b92e34 Disable synthetic drag on drag and drop
Otherwise, conflicting MouseMove events are generated and page regions start to flicker.
2024-01-10 11:18:45 +02:00
Marshall Bowers 74dadd68d2 Clean up references in doc comments (#3983)
This PR cleans up a number of references in doc comments so that
`rustdoc` will link and display them correctly.

Release Notes:

- N/A
2024-01-09 14:48:48 -05:00
Antonio Scandurra 0c6d107740 Introduce on_request_frame 2024-01-09 18:21:10 +01:00
Piotr Osiewicz d475f1373a gpui: Further docs refinement & moved some reexports into 'private' module (#3935)
This commit mostly fixes invalid URLs in docstrings. It also
encapsulates crates we reexport (serde stuff + linkme) into a public
module named "private" in order to reduce the API surfaced through docs.
Moreover, I fixed up a bunch of crates that were pulling serde_json in
through gpui explicitly instead of using Cargo manifest.

Release Notes:
- N/A
2024-01-07 14:14:21 +01:00
Kirill Bulatov 8ff05c6a72 Prepare for external file drop in pane 2024-01-07 01:17:49 +02:00
Piotr Osiewicz dc7f9bbc54 gpui: Sweep through cargo doc output and mark dubious items as non-public (#3932)
I essentially went through the publicly exported items and marked these
that are e.g. leaky reexports as pub(crate). I expect that'd be done on
Tuesday anyways.

Release Notes:
- N/A
2024-01-06 23:47:51 +01:00
Max Brunsfeld 7e810d7e0d Restore the ability to disable key bindings by setting them to null in your keymap (#3921)
* Fix an incorrect use of `Any::type_id` that prevented the disabling of
key bindings
* Restructured the representation of disabled key bindings so that they
handle context predicates correctly. Previously, to disable key binding,
you needed to supply the exact same context predicate (e.g. `Editor &&
mode == "full"`) as the binding that you are trying to disable. Now, the
context predicates of disabled key bindings are evaluated just like any
other context predicate (with the current context) to see if they apply.

Release Notes:

- Fixed an issue where disabling key bindings didn't work. To disable a
key binding, set it to `null` in your keymap.
2024-01-05 13:51:47 -08:00
Max Brunsfeld 8a96562adf Handle contexts correctly for disabled key bindings 2024-01-05 13:06:59 -08:00
Piotr Osiewicz a984a158fc gpui: Use async-task 4.7 2024-01-05 11:42:28 +01:00
Antonio Scandurra 3ab2062614 Fix border rendering
After implementing it a while ago, our previous interpolation scheme
didn't really make sense to me and was causing borders to be rendered
incorrectly. We don't really draw backgrounds and borders as part of
the same draw call anymore, but it seemed reasonable to have a correct
implementation in the shader anyway.

This commit uses Porter-Duff compositing (i.e., `over`) to produce
a color that is the result of superimposing the border on top of the
background. Then, we linearly interpolate towards the background color
as we slide out of the border and into the background.
2024-01-04 16:27:20 +01:00
Max BrunsfeldandMikayla f5ba22659b Remove 2 suffix from gpui
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:59:39 -08:00
Piotr Osiewicz 576d8806f5 Fix up gpui1 2024-01-02 13:18:56 +01:00
Joseph T. Lyons 98d03f6e7a Revert "Add activity_indicator2"
This reverts commit 88a3a57789.
2023-10-26 17:13:40 +02:00
Joseph T. Lyons 88a3a57789 Add activity_indicator2 2023-10-26 16:49:39 +02:00
Conrad Irwin 51aa0d6a94 Clearer error on importing both gpui and gpui2 2023-10-26 10:39:52 +02:00
Antonio Scandurra 23f11fcd5e Merge branch 'main' into gpui2 2023-10-12 10:55:17 +02:00
Conrad Irwin 5dbda70235 Fix ./script/bundle to allow passing key 2023-10-09 08:59:25 -06:00
Marshall Bowers f6a4151f60 Merge branch 'main' into gpui2 2023-10-07 10:50:05 -04:00
Conrad Irwin 34b7537948 Add universal links support to mac platform 2023-10-06 23:15:37 -06:00
Nathan Sobo c57e19c8fa Checkpoint: Glyphs rendering how I'd like 2023-10-03 17:29:36 -06:00
Nathan Sobo 550d9a9f71 Checkpoint 2023-10-03 16:17:25 -06:00
Nathan Sobo 4208ac2958 WIP 2023-10-03 15:17:45 -06:00
Nathan Sobo 45429b5400 WIP 2023-10-03 14:25:29 -06:00
Nathan Sobo 5b0e333967 Checkpoint 2023-09-20 12:16:26 -06:00
Nathan Sobo 83dae46ec6 Checkpoint 2023-09-20 10:17:29 -06:00
Conrad Irwin 4667110d0f Fix multi-key shortcuts with modifiers
To make this work we need to move the handling of multiple possible key
events into the keyboard shortcut system.

This was broken in #2957.
2023-09-14 14:35:17 -06:00
Conrad Irwin 0c2bc6e553 Fix some international keybindings (#2957)
This adds primitive interaction with the IME system for keyboard
shortcuts in zed.

- Consult the IME functionality when handling keyboard shortcuts. This
allows you to bind to characters (like " on a Brazillian keybaord, or $
on a Czech keyboard) that aren't typed with an unmodified key.
([#1981](https://github.com/zed-industries/community/issues/1981))
([#1913](https://github.com/zed-industries/community/issues/1913))

Co-authored-with: Antonio Scandurra <me@as-cii.com>
2023-09-11 11:56:57 -06:00
Conrad Irwin e017dc6a5e Fix ctrl-` on Brazillian too 2023-09-11 11:33:04 -06:00
Conrad Irwin 0a6e577e10 Fix some international keybindings
This adds primitive interaction with the IME system for keyboard
shortcuts in zed.

For zed-industries/community#1981
For zed-industroes/community#1913
2023-09-11 10:35:42 -06:00
Nathan Sobo 5a778fbde6 Checkpoint 2023-09-06 14:16:15 -06:00
Nathan SoboandConrad Irwin 684db11afd Use platform API to request mouse position
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
2023-08-23 13:10:41 -06:00
Nathan Sobo 569d99a5a1 Add hover styling support 2023-08-23 09:08:05 -06:00
Nathan Sobo d375f7992d Merge branch 'main' into divs 2023-08-22 16:35:56 -06:00
Max Brunsfeld cd2ef784ea Translate coordinates using the primary screen not the main screen 2023-08-17 16:12:52 -07:00
Max Brunsfeld d9ef987b04 Fix AppKit screen coordinate conversion leading to wrong window bounds 2023-08-17 15:23:28 -07:00
Nathan Sobo 812d3f6af6 Get basic mouse_down and mouse_up working 2023-08-16 22:21:27 -06:00
Nathan Sobo 65123e6eed Allow individual corner radii on drop shadows 2023-08-12 10:58:08 -06:00
Nathan Sobo 40f478937e Allow distinct corner radii for images 2023-08-12 10:50:04 -06:00
Nathan Sobo 84dc4090bd Wire up per corner radii for quad
Still need to expose this in the styling layer and allow images
to have per corner radii.
2023-08-12 10:40:23 -06:00