Commit Graph
433 Commits
Author SHA1 Message Date
Nathan Sobo 808920cc34 Merge branch 'pre-merge' into clean-up-doc-elements 2024-01-01 12:21:33 -07:00
Nathan Sobo 5a75996184 Attempt to return impl Element from render. 3 errors. 2024-01-01 14:23:02 +01:00
Nathan Sobo b0db37a5b7 Clean up Element API and start on docs 2023-12-31 08:33:40 -07:00
Piotr Osiewicz b611d478c1 Remove #[allow(unused)] annotations in zed2 crates (#3798)
Release Notes:

- N/A
2023-12-25 12:23:44 +01:00
Marshall Bowers 37c893a47e Style inlay hints (#3806)
This PR styles the inlay hints after the changes to the themes.

Release Notes:

- N/A
2023-12-22 23:06:30 -05:00
Kirill Bulatov 31b3139494 Properly color file labels in project panel (#3794)
Also fixes an error with mouse listeners placement in
https://github.com/zed-industries/zed/pull/3792

Release Notes:

- N/A
2023-12-23 02:01:55 +02:00
Marshall Bowers 4368e313a4 Use extra small label for tab descriptions (#3797)
This PR adjusts the size of the tab descriptions to use the extra small
label size.

This makes it easier to distinguish between the filename and the
description:

<img width="320" alt="Screenshot 2023-12-22 at 6 49 11 PM"
src="https://github.com/zed-industries/zed/assets/1486634/451d4cd0-666c-43c2-b5df-6d9cf91dacda">

It's also more in line with how things look in Zed1.

Release Notes:

- N/A
2023-12-22 18:56:17 -05:00
Kirill Bulatov 938bf6bc6e Fix mouse listeners' z-index for editor 2023-12-23 01:55:40 +02:00
Marshall Bowers f0592995ce Map additional text colors from Zed1 themes (#3796)
This PR maps additional text colors from the Zed1 themes to the Zed2
themes.

Release Notes:

- N/A
2023-12-22 18:45:58 -05:00
Kirill Bulatov 3c1047558f Fix multibuffer scroll by reordering z-index of its elements
1. Blocks (with their headers) and mouse listeners should be drawn together otherwise either starts to loose mouse events.

2. Scrollbar should be above all to match zed1 look and avoid buffer headers popping slightly to the right of the scrollbar.
2023-12-22 22:56:35 +02:00
Antonio Scandurra cc12ff10cb Fix panic in completions menu (#3778)
We were shifting all the positions while keeping the original string,
which caused problems later when combining highlighted ranges with
matched indices.

Release Notes:

- N/A
2023-12-22 12:27:52 +01:00
Antonio Scandurra 9278f5cce5 Fix panic in completions menu
We were shifting all the positions while keeping the original
string, which caused problems later when combining highlighted
ranges with matched indices.
2023-12-22 12:12:39 +01:00
Kirill Bulatov 004fa540b0 Fix the tests 2023-12-22 12:14:53 +02:00
Kirill BulatovandAntonio Scandurra e3179189fa Move multibuffer "go to file" button into the buffer header
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-22 12:02:44 +02:00
Kirill Bulatov 9b589acf3d Remove the warnings from element.rs 2023-12-22 12:02:44 +02:00
Marshall Bowers 733d995264 Scale down status bar items (#3766)
This PR scales down the sizes of items in the status bar.

This brings us more in line with Zed1.

Release Notes:

- N/A
2023-12-21 17:42:54 -05:00
Nathan Sobo c3b2fadcec Correctly compute placeholder text for buffer search query editor (#3749)
Rather than relying on the focused element, instead explicitly pass the
focus handle for the query editor when determining the prev/next
bindings. Only compute these values once.

Release Notes:

- N/A
2023-12-20 20:48:31 -07:00
Nathan Sobo 3f994735ff Only compute placeholder text once 2023-12-20 14:47:56 -07:00
Nathan Sobo 0421bfe734 Compute the query editor placeholder text with a focus handle
So we're not beholden to the current focus.
2023-12-20 13:00:52 -07:00
Kirill Bulatov da8c4e8ae3 Apply more fixes to the visual part 2023-12-20 18:23:08 +02:00
Antonio Scandurra d80c00a981 Use InteractiveBounds everywhere we change the cursor style 2023-12-20 13:59:52 +01:00
Max Brunsfeld a321beb15e Fix layout of diagnostic blocks (#3729)
Previously, all of the lines in a multi-line error message were painted
on top of each other. I also simplified the logic for highlighting
backtick-enclosed ranges in a diagnostic message.
2023-12-19 15:49:56 -08:00
Max Brunsfeld e7d7c4b055 Fix layout of diagnostic blocks 2023-12-19 15:41:00 -08:00
Marshall Bowers 38a30560ff Use link_text_hover for go-to-definition links 2023-12-19 18:24:52 -05:00
Julia 9867940dce Allow editor mouse drag selection outside interactive bounds (#3716)
Release Notes:

- N/A
2023-12-19 13:07:31 -05:00
Julia 45da851599 Match zed1 scrollbar drag behavior (#3715)
Still not ideal, but we need to ship and this is more than reasonable

Release Notes:

- N/A
2023-12-19 13:00:26 -05:00
JuliaandAntonio Scandurra 38c2a4c897 Allow editor mouse drag selection outside interactive bounds
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 13:00:21 -05:00
JuliaandAntonio Scandurra 1464b2c928 Match zed1 scrollbar drag behavior
Still not ideal, but we need to ship and this is more than reasonable

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-12-19 12:50:06 -05:00
Max Brunsfeld f5e3825dc1 Don't stop propagation on mouse move over editor gutter 2023-12-19 09:02:25 -08:00
Antonio Scandurra d1817197d6 Fix janky editor scrollbar dragging
We can receive multiple events before computing the next frame, and
in that case we want to compute a drag delta between the position for the
previous mouse event and the current one.
2023-12-19 15:32:42 +01:00
Marshall Bowers 4b59ded300 Remove unimplemented toggling for project search entries (#3695)
This PR removes the unimplemented toggling of search results in the
project search.

This is new functionality that didn't exist in Zed1, and it's likely
that we won't be adding it before launch, so removing it for now.

Release Notes:

-  N/A
2023-12-18 12:53:08 -05:00
Nate Butler dd03f4aaa0 Editor UI Cleanup (#3676)
[[PR Description]]

TODO: 
- [x] Style fold marker
- [x] Editor - Code action icon too large, should use muted color,
should have tooltip
- [ ] Style inline assistant
    - Prompt text gets cut off veritcally
- [x] Line height on inline assist editor isn't tall enough
- Nate: This is my fault due to the line height (relative: 1) we are
setting on non-buffer editors. I'll look into this.
- [ ] Style diagnostic hover (right now it's an opaque box on some
themes)
    - Nate: This needs status tints, we are working on it
- [ ] Hovering over a symbol shows a dialogue that appears underneath
the scroll-bar

Release Notes:

- N/A
2023-12-15 15:49:55 -05:00
Nate Butler 54e65e465a Style fold control 2023-12-15 15:41:53 -05:00
Mikayla 118894f502 Fix editor mouse event dispatch 2023-12-15 10:26:41 -08:00
Nate Butler 103bddafd6 Update size of code action indicator and show when active 2023-12-15 12:29:33 -05:00
Nate Butler 6a78cd7bc6 Revert change to single line editor height 2023-12-15 12:22:33 -05:00
Nate Butler 5407216c11 Update fold_indicator render 2023-12-15 12:09:06 -05:00
Kirill Bulatov 26292d4df2 Adjust copy/paste buffer only on the copy error action trigger 2023-12-15 11:34:00 +02:00
Kirill Bulatov 8a5c5a5707 Remove extra nits, do not panic on clicking the buffer separator 2023-12-15 11:28:48 +02:00
Nathan Sobo bde23a78d3 Rename draw2 -> draw_and_update_state 2023-12-14 17:20:27 -07:00
Nathan Sobo 88f0572bad Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 16:56:36 -07:00
Marshall Bowers 3fbef5ff2c Use editor_foreground color in editor 2023-12-14 17:34:07 -05:00
Nathan Sobo 336acd490e Don't move in paint 2023-12-14 15:15:18 -07:00
Conrad Irwin 1640668f61 Refactor editor to be more clear about stacking 2023-12-14 10:48:15 -07:00
Conrad Irwin da8b21382b Fix z-indexes in editor element
* Ensure that scroll events from blocks scroll the editor
* Ensure that scroll bars show behind hover things
2023-12-14 10:36:16 -07:00
Mikayla 626ed06f86 Merge branch 'main' into fix-splits-bugs 2023-12-13 18:29:48 -08:00
Marshall Bowers 45a30238e9 Implement VisibleOnHover for IconButton (#3642)
This PR implements the `VisibleOnHover` trait for `IconButton`s.

I noticed that in a lot of places we were wrapping an `IconButton` in an
extra `div` just so we could call `visible_on_hover` on it. By
implementing the trait on `IconButton` directly it allows us to avoid
the interstitial `div` entirely.

Release Notes:

- N/A
2023-12-13 20:42:27 -05:00
Marshall Bowers 9d2708c71e Add .visible_on_hover helper method (#3639)
This PR adds a `.visible_on_hover` helper method that can be used to
make an element only visible on hover.

I noticed we were repeating this similar stanza in a bunch of different
spots:

```rs
some_element
    .invisible()
    .group_hover("", |style| style.visible())
``` 

so it seemed like a nice thing to factor out into a reusable utility.

Release Notes:

- N/A
2023-12-13 19:12:20 -05:00
Mikayla de754ed76f Add fluent quad API 2023-12-13 13:21:48 -08:00
Marshall Bowers 1a2584222c Don't show empty documentation labels in completions menu (#3632)
This PR fixes an issue where we would sometimes have extra blank lines
in the completions menu.

This was due to some items including documentation labels that were
empty strings.

Release Notes:

- N/A
2023-12-13 14:15:03 -05:00