Commit graph

837 commits

Author SHA1 Message Date
Conrad Irwin
4ab5fa564d Fix overlay position calculation
(but keep rounding)
2024-01-02 18:17:26 -07:00
Marshall Bowers
d637657a99
Revert "Round tooltip co-ordinates (#3836)" (#3853)
This reverts commit 09951208a7, reversing
changes made to 93a818d018.

I noticed an issue where context menus were appearing in the wrong
location (shifted to the right) as a result of this change.

Release Notes:

- N/A
2024-01-02 20:04:11 -05:00
Conrad Irwin
12f06a96d0 Merge branch 'main' into overlay-rounding 2024-01-02 12:35:38 -07:00
Nathan Sobo
cb6652e7bf
Clippy fixes for gpui2 (#3826)
It's not quite complete, but we gotta start somewhere.
Release Notes:

- N/A
2024-01-02 11:38:25 -07:00
Nathan Sobo
30624b9899
Fix anti-aliasing artifacts in GPUI 2 borders (#3818)
Previously, we changed borders to be drawn after content, so they are no
longer part of the same quads as the background. In our change, we gave
the background quad a transparent black border and the border quads
transparent black backgrounds. However, this caused the other channels
to blend toward that black color before becoming fully transparent,
causing them to become darker.

In this PR, I source the "placeholder" color by duplicating the values
for the other channels and only adjust the alpha down to zero.

Release Notes:

- N/A
2024-01-02 10:32:23 -07:00
Conrad Irwin
2e349a806a Round tooltip co-ordinates 2024-01-02 10:12:57 -07:00
Nathan Sobo
6b14f2fd08
Rename build_view to new_view and build_model to new_model (#3823)
The word "new" is shorter and blends in with `new` constructors that are
common in Rust. Been meaning to do this for a while.

Release Notes:

- N/A
2024-01-02 08:11:53 -07:00
Piotr Osiewicz
388c2d8e7f cargo fmt 2024-01-02 13:15:57 +01:00
Piotr Osiewicz
4af6ac25e9 gpui2: Another round of fixups 2024-01-02 13:11:36 +01:00
Piotr Osiewicz
945dba8099 gpui2: redundant_locals 2024-01-02 12:59:40 +01:00
Piotr Osiewicz
bcff7a8631 gpui2: Fix instance of map_entry lint 2024-01-02 12:56:53 +01:00
Piotr Osiewicz
1a03cf3268 Merge branch 'main' into clippy-fixes-for-zed2 2024-01-02 12:21:15 +01:00
Piotr Osiewicz
d185fca80c
Another pass of #[allow()] removal (#3825)
We still have a bunch of leftovers in ui2/theme2 and in gpui2
display_link module.

Release Notes:

- N/A
2024-01-02 12:17:30 +01:00
Nathan Sobo
47071605a1 Merge remote-tracking branch 'origin/main' into new-view-new-model-rename 2024-01-01 17:42:12 -07:00
Nathan Sobo
db1cf8f6e1 Rename build_view to new_view and build_model to new_model
The word "new" is shorter and blends in with `new` constructors that are common
in Rust. Been meaning to do this for a while.
2024-01-01 17:42:01 -07:00
Piotr Osiewicz
a3759f9a33 Another batch of fixups 2024-01-02 00:24:11 +01:00
Piotr Osiewicz
2621efebea Rest of fixups for gpui2 2024-01-02 00:09:24 +01:00
Piotr Osiewicz
7d420edb84 Start fixing up gpui2 2024-01-02 00:04:51 +01:00
Nathan Sobo
f836873764 Fix merge 2024-01-01 12:23:42 -07:00
Nathan Sobo
bcf0e3fb05 Merge branch 'pre-merge' into clean-up-doc-elements 2024-01-01 12:21:33 -07:00
Nathan Sobo
81b03d379e Rearrange to hopefully make merging easier 2024-01-01 12:21:17 -07:00
Nathan Sobo
c6ae885c5d Add more docs 2024-01-01 11:35:40 -07:00
Nathan Sobo
51d1d92d66 Attempt to return impl Element from render. 3 errors. 2024-01-01 14:23:02 +01:00
Nathan Sobo
83923fd6d5 Clean up Element API and start on docs 2023-12-31 08:33:40 -07:00
Nathan Sobo
21f0409e3b Fix anti-aliasing artifacts in borders
Previously, we changed borders to be drawn after content, so they are no longer
part of the same quads as the background. In our change, we gave the background
quad a transparent black border and the border quads transparent black
backgrounds. However, this caused the other channels to blend toward that black
color before becoming fully transparent, causing them to become darker.

In this PR, I source the "placeholder" color by duplicating the values for
the other channels and only adjust the alpha down to zero.
2023-12-29 08:49:01 -07:00
Piotr Osiewicz
16626592db
Remove allow unused from gpui2, vim2 tests and terminal_view2 (#3813)
Release Notes:

- N/A
2023-12-26 01:23:08 +01:00
Marshall Bowers
dc64411cca
Extend theme_importer in preparation for importing Zed1 themes (#3791)
This PR extends the `theme_importer` with the overall structure required
to support importing themes from Zed1.

Release Notes:

- N/A
2023-12-22 13:47:30 -05:00
Antonio Scandurra
c34a81152f
Fix panic when deploying emoji picker (character palette) (#3790)
The panic was caused by Cocoa synchronously invoking the
`selected_text_range` method on the registered input handler while we
already had a borrow of the app.

This pull request fixes this issue by showing the character palette on
the next tick of the loop (we've had this problem in other spots too and
used the same technique).

Release Notes:

- N/A
2023-12-22 18:52:35 +01:00
Marshall Bowers
7ef2ddd7a5
Disambiguate GPUI2 macOS class names (#3789)
This PR disambiguates the macOS class names used in GPUI2 from the ones
used in GPUI1.

Right now if you happen to end up with a copy of both `gpui` and `gpui2`
in the dependency tree you get an unhelpful `unwrap` error when we try
to build the class names.

By giving them different names we are able to get to our more helpful
error that informs you that both GPUI1 and GPUI2 are in the module tree.

We can change these names back once we do the big "un-2-ing".

Release Notes:

- N/A
2023-12-22 12:46:06 -05:00
Antonio Scandurra
9a6688bdfb Fix panic when deploying emoji picker (character palette)
The panic was caused by Cocoa synchronously invoking the `selected_text_range`
method on the registered input handler while we already had a borrow of the
app.

This commit fixes this issue by showing the character palette on the next tick
of the loop (we've had this problem in other spots too and used the same technique).
2023-12-22 18:41:43 +01:00
Antonio Scandurra
dd093477a3 Allow horizontal scrolling of tab bar on vertical mouse wheel
Now, if we receive a scroll event for an axis, but that axis can't be scrolled
(overflow != scroll), we will apply it to the opposite axis instead
if that axis supports scrolling.
2023-12-22 15:56:37 +01:00
Antonio Scandurra
68cf631cfc Reveal item even if project panel was closed while active entry changed
The project panel was actually working just fine, the problem was due to
`UniformList` not re-hydrating the element state's scroll offset when
being rendered again.
2023-12-22 14:39:16 +01:00
Antonio Scandurra
01ce204491 Avoid painting a background quad if it is fully transparent 2023-12-22 09:29:56 +01:00
Antonio Scandurra
2a516ec1e0 Honor PrimitiveKind ordering when order is the same
This was a bug in the previous implementation that was being masked by
how we were using BSP.
2023-12-22 09:24:01 +01:00
Antonio Scandurra
48ad53badd Revert "Revert "Optimize order rendering and border drawing"" 2023-12-22 09:12:18 +01:00
Julia
051bad734e
Some terminal bugs (#3767)
Fixes:
 - drag and drop into terminal element does not change its style
 - drag and drop terminal tab into main pane then back panics
 - can drop non-terminal items into the terminal pane

Release Notes:

- N/A
2023-12-21 18:05:14 -05:00
Julia
f3fda8018f Prevent drag-dropping non-terminal item into terminal pane 2023-12-21 17:52:29 -05:00
Antonio Scandurra
7cfea09019
Revert "Optimize order rendering and border drawing" 2023-12-21 19:40:03 +01:00
Antonio Scandurra
53a4b711dd Delete stray comment 2023-12-21 17:55:26 +01:00
Antonio Scandurra
c03c0d50d5 Use smaller quads to draw borders
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-12-21 17:54:13 +01:00
Antonio Scandurra
67f76468f1 Replace BspSplitter with brute-force sorting of primitives 2023-12-21 16:58:36 +01:00
Antonio Scandurra
01947ed730 Use existing AnyElement::draw 2023-12-21 15:32:05 +01:00
Antonio Scandurra
176a022b10 Correctly clamp scroll offset vertically 2023-12-21 15:23:16 +01:00
Antonio Scandurra
e2a4474200 Allow scrolling saved conversations 2023-12-21 15:22:49 +01:00
Antonio Scandurra
b0ee7b2fb9 Fix clicking on "+" button not working when a tab was underneath
We were mistakenly pushing an opaque layer without intersecting it
with the content mask. Also, we were pushing two opaque layers for
the same div unnecessarily.
2023-12-21 14:28:06 +01:00
Antonio Scandurra
b38a09526c Fix stale scroll position in tab bar 2023-12-21 10:03:15 +01:00
Antonio Scandurra
c7933a6ad8 Remove stray dbg 2023-12-21 09:44:54 +01:00
Antonio Scandurra
73682daf38 Provide mut access to allocated arena struct via non-cloneable ArenaBox
This commit also allows turning an `ArenaBox` into an `ArenaRef` when
non-mutable access is required, which makes `ArenaRef: Clone`. This fixes
a bug that prevented the command palette from reading all the available
actions while the `command_palette::Toggle` action was being dispatched.
2023-12-21 09:41:48 +01:00
Nathan Sobo
e5ce5e8692
Clear pending keystrokes when an action is dispatched (#3750)
This prevents the `cmd-k` keystroke, which clears the terminal, from
staying around as a pending keystroke on the parent workspace.

Release Notes:

- N/A
2023-12-20 20:50:59 -07:00
Nathan Sobo
5747c9b7a1 Clear pending keystrokes when an action is dispatched 2023-12-20 20:41:36 -07:00