Commit Graph
275 Commits
Author SHA1 Message Date
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 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
Mikayla Maki 40030f32d9 Fix two mouse event bugs (#2835)
This PR fixes two bugs we discovered in Zed's mouse event handling while
investigating an interesting and mysterious bug we we were seeing, where
spurious `MouseMoved` events would continuously be dispatched after
control-clicking.

Release Notes:

- Fixed a rendering glitch that could occur after control-clicking
certain elements.
2023-08-09 09:04:32 -07:00
Max BrunsfeldandMikayla 0b93a30821 Terminate synthetic drag state on mouse up w/ ctrl held
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-08 17:39:45 -07:00
Nathan Sobo 0dc70e6cbf Rename mac platform Window to MacWindow for clarity 2023-08-08 17:21:06 -06:00
Nathan Sobo 8e49d1419a Minimize window id usage 2023-08-08 16:38:46 -06:00
Nathan Sobo afd89b256a Store AnyWindowHandles instead of usizes 2023-08-08 16:06:53 -06:00
Julia 2e3aa703d9 In macOS platform layer map a ctrl-click to a right click 2023-07-19 15:43:45 -04:00
Kirill Bulatov eaa8224076 Use id instead of type_id for actions
Currently, both are the same thing, so the logic is not changed.
2023-07-17 12:24:56 +03:00
Antonio Scandurra 318deed25b Skip key down event if preceded by its key equivalent version
Previously, we would only track whether the previous key down event
was a key equivalent. However, this could cause issues when pressing
certain keystrokes in rapid succession, e.g.:

- Pressing `shift-right` (to select a character)
- Pressing a character (with or without `shift` held down)

This would cause GPUI to ignore the second event because it was
preceded by a key equivalent event. With this commit, we track the
last key equivalent event, and skip the key down event only if it
matches the last key equivalent event.
2023-07-07 12:02:08 +02:00
Nathan SoboandAntonio Scandurra 8f8a99d788 Bind cmd-? to assistant::toggle_focus
Bypass system help menu shortcut at the app delegate level to achieve this.

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-28 11:43:24 +02:00
JuliaandAntonio Scandurra dc07b60e40 Avoid assigning NSCursor style when it already is that style
This avoids a high cost which appears to be the system rasterizing the
cursor every time we call this, fixes a slowdown when scrolling rapidly
while mouse motion continually attempted to assign the style

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-06-20 09:31:30 -04:00
JuliaandNathan Sobo 31516b7863 TextStyle::default() ask system for known existing font family
Rather than assuming a specific family exists, try a set of specific
names and if they fail, just grab any old font that the system reports
as existing

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-05-30 14:46:27 -04:00
Antonio Scandurra 146809eef0 Merge branch 'main' into panels 2023-05-22 14:10:17 +02:00
Antonio Scandurra 5a8fb18c20 Show workspace only after initializing it 2023-05-19 19:35:00 +02:00
Kirill Bulatov f12dffa60c Reintroduce more accesible modal keybindings
Brings commit 475fc409232775d83797215870256fd5772e299f back
2023-05-11 20:59:10 +03:00
Joseph Lyons 0ab94551f4 Revert "More keybindings in macOs modals with buttons"
This reverts commit 1398a12062.
2023-05-11 11:37:34 -04:00
Kirill BulatovandAntonio Scandurra 1398a12062 More keybindings in macOs modals with buttons
Closes https://github.com/zed-industries/community/issues/1095
by forcing the non-Cancel button to get a focus.
Due to the way macOs handles buttons on modals, the focus gain had to be
achieved via certain button addition order, rather than conventional
"setFocus"-ish API, see the related comment for details.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-05-02 21:10:20 +03:00
Antonio ScandurraandNathan Sobo 0d5eea8169 Track active window id in test platform
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-20 17:22:11 +02:00
Nathan Sobo 7536645eea WIP 2023-04-08 08:01:05 -06:00
Nathan Sobo 2615a11f7c Don't export platform::* from gpui
I'd like to avoid cluttering the top-level namespace with all the platform-
specific types.
2023-04-07 11:45:53 -06:00
Nathan Sobo de9bf6dfbd Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was
still learning Rust. But now it's just &mut AppContext vs &AppContext.
2023-04-06 15:49:03 -06:00
Julia 6e3bf7fed4 Hesitant possible fix for lock screen crash
This may cause issues in this situations but as I cannot repro this I'm
making the call to try something and see how it plays out
2023-04-05 14:01:54 -04:00
Mikayla Maki 81411b9114 Merge branch 'main' into copilot 2023-03-30 16:57:18 -07:00
Max Brunsfeld b5f762ab25 Open a new window when activating Zed from the dock w/ no windows open 2023-03-29 17:24:44 -07:00
Antonio Scandurra 2f95510a2e Start integrating Copilot with editor
There's still a bit to do in terms of reusing the previous suggestion
when the prefix matches, but we're getting there.
2023-03-28 09:42:01 -07:00
Antonio ScandurraandMikayla Maki 9713d1bb31 Fix invalid translation between bottom/top left coordinate spaces
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-28 09:42:01 -07:00
Antonio Scandurra 99cca59c84 Restructure verification code prompting to open a window instead
Also, prevent multiple calls to `sign_in` from racing with each other.
2023-03-28 09:42:01 -07:00
Antonio Scandurra f9d793cb4a Honor more OpenType features 2023-03-17 13:40:00 +01:00
Antonio Scandurra 9181ac9872 Honor the calt font feature 2023-03-17 12:01:27 +01:00
Antonio Scandurra b2c733baab WIP: Allow specifying font features in the editor
This just lays the foundation for threading through a `fonts::Features`
struct, but it's not used yet.
2023-03-17 09:51:36 +01:00
Max Brunsfeld d69868fa44 Make restart action more reliable 2023-03-15 17:44:50 -07:00
Mikayla MakiandMax adf94a1681 Switch from using the key window to the main window mac platform API
When the help menu is open, the help menu's search field is the key window, and this was causing menu item action resolution to fail

co-authored-by: Max <max@zed.dev>
2023-03-10 14:43:28 -08:00
Antonio Scandurra 0ec984f924 Tidy up SpriteCache::render_glyph 2023-03-06 17:08:35 +01:00
JuliaandAntonio Scandurra 9311e01271 Avoid wrapping to the 0th glyph variant when the 4th should be used
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-03-03 10:04:44 -08:00
Mikayla Maki 8656708de4 Revert "Remove borrow from reveal_path()" 2023-02-24 09:39:52 -08:00
Mikayla Maki 89ddf14b0e Remove borrow from reveal_path() 2023-02-23 21:36:17 -08:00
Max Brunsfeld fbc934b884 Adjust window's traffic light position when setting its title 2023-02-23 14:44:45 -08:00
Mikayla MakiandAntonio 4798b72cb8 Fixed keyboard shortcuts in mac os native panels
co-authored-by: Antonio <antonio@zed.dev>
2023-02-22 09:10:16 -08:00
Mikayla MakiandAntonio 71d8ead318 Introduce an OSAction that can be associated with menu items for mac platform compatibility.
Co-authored-by: Antonio <antonio@zed.dev>
2023-02-22 09:02:31 -08:00
Mikayla Maki 14488619a3 Merge pull request #2196 from zed-industries/open_urls
Fix open URLs, restarts, and make bundling easier to use
2023-02-21 15:36:50 -08:00
Mikayla MakiandMax cf4e719484 Fixes a race condition in the restart implementation
Fixes open_urls racing workspace initialization and causing a double-open (community#927)
Adds a -d flag to the bundle script to compile in debug mode

Co-Authored-by: Max <max@zed.dev>
2023-02-21 15:28:16 -08:00
Petros AmoiridisandAntonio Scandurra 4bb986b3be Move reveal_path to ForegroundPlatform
So that we can use spawn to use the OS API call.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-02-20 18:57:37 +02:00
Mikayla Maki ff2fb06b2c Used the pre-existing app_path call in the GPUI platform 2023-02-17 10:30:28 -08:00
Mikayla Maki 6e33f33da1 Switch to open based restarting 2023-02-16 16:47:43 -08:00
Julia e56dfd9177 Tell OS about window title 2023-02-15 15:55:55 -05:00
Petros Amoiridis fbd23986e3 Merge pull request #2161 from zed-industries/community/3-reveal-in-finder
Introduce Reveal in Finder
2023-02-15 16:11:04 +02:00