Commit Graph
83 Commits
Author SHA1 Message Date
Antonio Scandurra d43e8b270a Add unit test for ViewContext::observe_window_activation 2022-07-05 17:51:01 +02:00
Max Brunsfeld 6f49f4a9cf Recalculate Metal layer's drawable size when window's scale factor changes 2022-07-04 15:14:08 -07:00
Antonio Scandurra 9a6092dd1b Support hitting enter on numpad 2022-07-04 10:01:56 +02:00
Keith Simmons 92ab107fc9 working jump to definition with tests 2022-06-24 15:09:31 -07:00
Keith Simmons 848445455d Working underline based on symbol origin 2022-06-24 15:05:35 -07:00
Antonio Scandurra 2dae0ddcdb Add test to verify closing window via the mouse 2022-06-23 14:18:53 +02:00
Antonio Scandurra 06033d7fa9 Introduce ViewContext::on_window_should_close
This is a new callback that can be used to interrupt closing the window
when the user has unsaved changes.
2022-06-23 11:43:19 +02:00
Antonio Scandurra ca8ddcdeec Set window's edited = true when there are unsaved changes 2022-06-23 10:59:50 +02:00
Antonio Scandurra a35d7c5e15 Use BOOL instead of Rust booleans in handle_key_equivalent 2022-06-17 17:19:18 +02:00
Antonio Scandurra 8f6d081de8 Override performKeyEquivalent to handle key events
This lets us bypass the application menu and invoke the event handler
in Zed first. If that doesn't handle the event, the application menu
item corresponding to the shortcut will be actioned. Prior to this
commit the opposite would happen, which would dramatically limit the
throughput at which we could handle events.
2022-06-17 17:12:56 +02:00
Antonio Scandurra 607903eed5 Return true in the Window::on_event callback if event was handled 2022-06-17 17:09:16 +02:00
Max Brunsfeld a3b17ffd15 Allow creating application menus with submenus 2022-06-16 17:47:39 -07:00
Antonio Scandurra 22dd68fbfb Add keystroke for menu item only when action is equal to binding
This fixes a bug where we would show `cmd-e` instead of `cmd-f` for
`Edit -> Find` because both bindings would have the `buffer_search::Deploy`
action and we were mistakenly selecting the former.
2022-06-06 09:26:33 +02:00
Antonio Scandurra 20e1044d49 Merge branch 'main' into project-panel-with-new-mouse-events 2022-05-30 18:29:46 +02:00
Max Brunsfeld 04bd57b2c7 Add an API for setting a window's title
This controls how the window appears in the Window menu.
2022-05-27 10:45:55 -07:00
Nathan Sobo b110fd5fb7 Render a context menu when right-clicking in project panel
It doesn't currently do anything, but I managed to get it rendering in an absolutely positioned way.
2022-05-26 09:59:25 +02:00
Max Brunsfeld fbd589b589 Start work on handling multibuffers properly when closing unsaved buffers 2022-05-22 16:48:33 -07:00
Max Brunsfeld b72d97ce78 Disable menu item key equivalents while there are pending keystrokes 2022-05-20 10:04:43 -07:00
Max Brunsfeld 21862faa58 Convert function keys to the correct macOS codes for menu items 2022-05-19 17:37:46 -07:00
Max Brunsfeld ea85473f4f Enable and disable application menu items based on the active view 2022-05-19 16:50:40 -07:00
Max Brunsfeld 7445197f4d Derive application menu key equivalents from the keymap 2022-05-19 10:04:01 -07:00
Max Brunsfeld 8445eaab85 Fix crash when emptying atlases
Previously, when an atlas was emptied, we would move it into a different
vector: free_atlases. This removal could cause existing atlas ids to
refer to the wrong atlases.
2022-05-05 17:52:47 -07:00
Antonio Scandurra 61346f734d WIP 2022-05-05 15:15:58 +02:00
Antonio Scandurra 7ec5c04fdf Correctly alpha-blend border and background in quad SDF 2022-04-28 13:54:18 +02:00
Max Brunsfeld e8d263274c Remove duplication between windowDid{Become,Resign}Key callbacks 2022-04-22 15:06:50 -07:00
Max Brunsfeld 6b9e93ac6d Fix double-borrow crash by calling window activated callback asynchronously 2022-04-22 15:01:19 -07:00
Max Brunsfeld 7f64076f8d Focus/blur views when application windows become active/inactive 2022-04-22 14:18:50 -07:00
Nathan SoboandAntonio Scandurra 92f040df00 Apply cursor styles during paint
This makes the editor's cursor an IBeam and properly deals with nested cursor styles.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-22 10:54:18 -06:00
Antonio Scandurra fb87bacc7e Merge branch 'main' into auto-update 2022-04-21 09:53:06 +02:00
Antonio ScandurraandNathan Sobo a210b05d00 Remove App::on_open_files, as it's a subset of on_open_urls
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:36:27 +02:00
Max Brunsfeld fbd1afc51f Add a command for installing the CLI 2022-04-20 17:27:33 +02:00
Nathan SoboandMax Brunsfeld 75f0326e54 Use ipc_channel crate to communicate between cli and app
We still aren't handling CLI requests in the app, but this lays the foundation for bi-directional communication.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-04-20 17:15:46 +02:00
Antonio ScandurraandNathan Sobo 01eb2dce24 WIP: Start on a new cli crate
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:15:45 +02:00
Keith Simmons 4b55b578b2 Don't panic when allocating tiny_skia pixmap 2022-04-13 14:57:16 -07:00
Antonio ScandurraandNathan Sobo 8e89074714 Reduce allocations when caching fonts
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-13 19:06:34 +02:00
Antonio ScandurraandNathan Sobo cdcdccfb89 Render emojis
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-13 17:31:10 +02:00
Antonio Scandurra fff1d9c631 Implement glyph scaling in a way that works with emojis as well 2022-04-13 15:56:32 +02:00
Keith SimmonsandMax Brunsfeld 4249b5687e Implement font fallback in layout_line
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-04-13 11:42:19 +02:00
Antonio Scandurra 6cc9306f00 Make room for font subpixel variants correctly 2022-04-13 11:36:54 +02:00
Antonio Scandurra 6b629dfa5c Use CTFont::draw_glyphs to rasterize glyphs
This API supports rendering emojis in addition to normal glyphs.
2022-04-12 19:37:26 +02:00
Keith Simmons 0ca4c9946a Add logging when atlas allocator fails to allocate 2022-04-11 10:31:38 -07:00
Keith Simmons 7abd3a98a8 Make atlas allocation fallable and skip rendering icons and paths when it fails 2022-04-11 10:15:49 -07:00
5242a3a6dc Restructure action macro to assign a namespace to every action
Also, allow arbitrary types to be used as Actions via the impl_actions macro

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-07 16:20:49 -07:00
Nathan Sobo 0214bec7f4 Don't dispatch events to flex children outside of parent flex's bounds 2022-04-06 10:59:03 -06:00
Nathan Sobo aeb0b42c7a Report more information when we panic due to an allocation failure 2022-04-05 13:53:13 -06:00
Antonio Scandurra 61c479ebc8 Pass an NSString to objectForInfoDictionaryKey 2022-04-05 10:02:37 +02:00
Max Brunsfeld e566a8335f Find path to running app using [NSBundle bundlePath] 2022-04-04 20:53:46 -07:00
Nathan SoboandKeith Simmons 66544d54f2 Drop borrow to window state before calling beginSheetModalForWindow
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-04-04 16:18:28 -06:00
38e902b241 WIP: Start on auto-update
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-04-04 18:59:57 +02:00
Antonio Scandurra dee416bdbe Avoid text insertion when holding down the fn key 2022-04-04 11:13:35 +02:00