Commit Graph
465 Commits
Author SHA1 Message Date
9cfb14dd35 gpui: Add support for window transparency & blur on macOS (#9610)
This PR adds support for transparent and blurred window backgrounds on
macOS.

Release Notes:

- Added support for transparent and blurred window backgrounds on macOS
([#5040](https://github.com/zed-industries/zed/issues/5040)).
- This requires themes to specify a new `background.appearance` key
("opaque", "transparent" or "blurred") and to include an alpha value in
colors that should be transparent.

<img width="913" alt="image"
src="https://github.com/zed-industries/zed/assets/2588851/7547ee2a-e376-4d55-9114-e6fc2f5110bc">
<img width="994" alt="image"
src="https://github.com/zed-industries/zed/assets/2588851/b36fbc14-6e4d-4140-9448-69cad803c45a">
<img width="1020" alt="image"
src="https://github.com/zed-industries/zed/assets/2588851/d70e2005-54fd-4991-a211-ed484ccf26ef">

---------

Co-authored-by: Luiz Marcondes <luizgustavodevergennes@gmail.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-29 11:10:47 -04:00
Marshall Bowers e7ccd91ade Add support for specifying both light and dark themes in settings.json (#7404)
This PR adds support for configuring both a light and dark theme in
`settings.json`.

In addition to accepting just a theme name, the `theme` field now also
accepts an object in the following form:

```jsonc
{
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  }
}
```

Both `light` and `dark` are required, and indicate which theme should be
used when the system is in light mode and dark mode, respectively.

The `mode` field is optional and indicates which theme should be used:
- `"system"` - Use the theme that corresponds to the system's
appearance.
- `"light"` - Use the theme indicated by the `light` field.
- `"dark"` - Use the theme indicated by the `dark` field.

Thank you to @Yesterday17 for taking a first stab at this in #6881!

Release Notes:

- Added support for configuring both a light and dark theme and
switching between them based on system preference.
2024-02-05 15:39:01 -05:00
953f5c9d35 gpui: Add Global marker trait (#7095)
This should prevent a class of bugs where one queries the wrong type of
global, which results in oddities at runtime.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-30 14:08:20 -05:00
Marshall Bowers 665993a423 Add support for loading user themes (#7027)
This PR adds support for loading user themes in Zed.

Themes are loaded from the `themes` directory under the Zed config:
`~/.config/zed/themes`. This directory should contain JSON files
containing a `ThemeFamilyContent`.

Here's an example of the general structure of a theme family file:

```jsonc
{
  "name": "Vitesse",
  "author": "Anthony Fu",
  "themes": [
    {
      "name": "Vitesse Dark Soft",
      "appearance": "dark",
      "style": {
        "border": "#252525",
        // ...
      }
    }
  ]
}
```

Themes placed in this directory will be loaded and available in the
theme selector.

Release Notes:

- Added support for loading user themes from `~/.config/zed/themes`.
2024-01-29 21:32:45 -05:00
Marshall Bowers 063b371adb Add a newtype wrapper around the global ThemeRegistry (#7025)
This PR adds a newtype wrapper around the global `ThemeRegistry`.

This allows us to limit where the `ThemeRegistry` can be accessed
directly via `cx.global` et al., without going through the dedicated
methods on the `ThemeRegistry`.

Release Notes:

- N/A
2024-01-29 18:09:37 -05:00
Marshall Bowers 4349322198 Rework access to ThemeRegistry global (#7023)
This PR reworks how we access the `ThemeRegistry` global.

Previously we were making calls directly on the context, like
`cx.global::<ThemeRegistry>`. However, one problem with this is that it
spreads out the knowledge of exactly what type is stored in the global.

In order to make it easier to adjust the type we store in the context
(e.g., wrapping the `ThemeRegistry` in an `Arc`), we now call methods on
the `ThemeRegistry` itself for accessing the global.

It would also be interesting to see how we could prevent access to the
`ThemeRegistry` without going through one of these dedicated methods 🤔

Release Notes:

- N/A
2024-01-29 17:51:34 -05:00
Marshall Bowers 44e5e86913 Remove old themes using UserTheme constructs (#6897)
This PR removes the themes defined using the `UserTheme` types, as we're
now loading the themes via JSON.

The `theme_importer` has also been reworked to read in a VS Code theme
and output a new JSON theme.

Release Notes:

- N/A
2024-01-27 16:55:37 -05:00
Marshall Bowers baa2112621 Load JSON themes (#6893)
This PR changes the theme loading to use the JSON themes bundled with
the binary rather then the Rust theme definitions.

### Performance

I profiled this using `cargo run --release` to see what the speed
differences would be now that we're deserializing JSON:

**Before:** `ThemeRegistry::load_user_themes` took 16.656666ms
**After:** `ThemeRegistry::load_user_themes` took 18.784875ms

It's slightly slower, but not by much. There is probably some work we
could do here to bring down the theme loading time in general.

Release Notes:

- N/A
2024-01-27 16:03:04 -05:00
Marshall Bowers 230c5e0d38 Add experimental.theme_overrides to settings file (#6791)
This PR adds **experimental** support for overriding theme values in the
current theme.

Be advised that both the existence of this setting and the structure of
the theme itself are subject to change.

But this is a first step towards allowing Zed users to customize or
bring their own themes.

### How it works

There is a new `experimental.theme_overrides` setting in
`settings.json`.

This accepts an object containing overrides for values in the theme. All
values are optional, and will be overlaid on top of whatever theme you
currently have set by the `theme` field.

There is JSON schema support to show which values are supported.

### Example

Here's an example of it in action:


https://github.com/zed-industries/zed/assets/1486634/173b94b1-4d88-4333-b980-8fed937e6f6d

Release Notes:

- Added `experimental.theme_overrides` to `settings.json` to allow for
customizing the current theme.
  - This setting is experimental and subject to change.
2024-01-26 13:42:58 -05:00
Kirill Bulatov 6415aed70c Fix previous theme not being applied on startup 2024-01-16 11:23:34 +02:00
Max Brunsfeld 461334cad4 Put back logic for resetting buffer font adjustment on settings change. 2024-01-15 17:03:02 -08:00
Nate ButlerandAntonio Scandurra 0521c1f80e Start documenting Theme crate
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2024-01-09 12:49:56 -05:00
Marshall Bowers 0800789caf theme: Removed commented-out ActiveTheme impl (#3950)
This PR removes a commented-out implementation for the `ActiveTheme`
trait on the `WindowContext`.

We don't need this implementation as we can go through the
`AppContext`'s implementation.

Release Notes:

- N/A
2024-01-08 13:51:18 -05:00
Max BrunsfeldandMikayla ee573f7906 Remove 2 suffix for theme
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:41:01 -08:00
Nate ButlerandMarshall Bowers e5da901599 Start using base theme in zed1 theme importer
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2024-01-02 14:21:20 -05:00
Max Brunsfeld 7f767a024c Set up UI to allow dragging a channel to the root 2023-10-25 15:39:02 +02:00
Piotr OsiewiczandMax 88e617c9d5 Account for markdown styling in mentions offset calculation.
This also means that we can support smart punctuation.

Co-authored-by: Max <max@zed.dev>
2023-10-23 12:50:57 +02:00
Max Brunsfeld 03b25e2d27 Start styling notification panel 2023-10-22 16:03:33 +02:00
Piotr Osiewicz d9e8e4ba2b Highlight mentions in the Saved chat messages 2023-10-20 15:30:36 +02:00
Max Brunsfeld 256ef99284 Merge branch 'main' into notifications 2023-10-18 17:20:04 -07:00
Max Brunsfeld 1b89d99654 Start work on chat mentions 2023-10-17 17:59:42 -07:00
Conrad Irwin 58950c1d11 Start writing role to database (#3120)
Scaffolding for guest members in channels

Release notes:
- You can now set channels to "public" which will allow anyone to join
and become a member. In a future release guests joining public channels
will have reduced permissions.
2023-10-17 13:40:58 -06:00
Max Brunsfeld f8e8340b84 Display invite response buttons inline in notification panel 2023-10-17 09:12:55 -07:00
Conrad Irwin 9029a2807b Merge branch 'main' into guests 2023-10-17 09:54:17 -06:00
KCaverly 5cba986cee catchup with main 2023-10-16 09:47:07 -04:00
Conrad Irwin a4e960f73a Wire through public access toggle 2023-10-13 16:59:30 -06:00
Julia 09cbfcb608 Fixup layout 2023-10-11 13:41:58 -04:00
Julia 326a103d4e Start hacking in autocomplete docs 2023-10-06 13:26:38 -04:00
KCaverly e30c75f1a9 catchup with main 2023-10-06 16:30:31 +02:00
Mikayla 320f369536 Improve chat rendering 2023-10-05 11:58:41 -07:00
KCaverly 133450eeb9 moved status to icon with additional information in tooltip 2023-10-05 16:49:25 +03:00
KCaverly 4506756333 added initial working status in inline assistant prompt 2023-10-05 13:01:11 +03:00
Mikayla 8c16b13329 Adjust channel rendering to group related messages 2023-10-04 14:29:08 -07:00
Max Brunsfeld 6f6460a858 Merge branch 'main' into channel-changes 2023-10-03 17:52:28 -07:00
KCaverly c77509e25b catching up with main 2023-10-03 12:05:00 +03:00
KCaverly 7219206f35 add placeholder button for retrieving additional context 2023-10-02 19:50:57 +03:00
Mikayla 30ae808ce1 Add channel note indicator and clear changed status 2023-10-01 22:32:10 -07:00
Mikayla 2a02ec0b87 Channel notifications from the server works 2023-10-01 22:30:21 -07:00
Conrad IrwinandMax Brunsfeld 7cda6fa956 Show host in titlebar
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-09-29 16:37:00 -06:00
Max BrunsfeldandConrad 13f4957210 Rename color_index to participant_index
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:22 -07:00
0976bdc78d Assign unique color indices to room participants, use those instead of replica_ids
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2023-09-28 11:06:09 -07:00
Max Brunsfeld 5a2c3c4393 Add buttons for opening channel notes and joining call, in chat panel header 2023-09-14 18:05:44 -07:00
Max Brunsfeld 1965c351e3 Style the chat panel further 2023-09-14 17:19:08 -07:00
Max Brunsfeld 27c098addd Merge branch 'main' into chat-again 2023-09-12 11:26:54 -07:00
Piotr Osiewicz c4e0bcb99e Z 1200/replace in buffer (#2922)
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.

I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:

- Added "Replace" functionality to buffer search.
2023-09-12 18:46:54 +02:00
Nathan Sobo 7695bbf44c Merge remote-tracking branch 'origin/main' into chat-again 2023-09-11 12:08:01 -06:00
Max Brunsfeld 5cbc1e947d Restore channel chat model and panel view 2023-09-07 11:38:27 -07:00
Nathan Sobo 563e18712c Merge branch 'main' into storybook 2023-09-07 07:56:57 -06:00
Nathan Sobo 4f7a2ff0ac Checkpoint 2023-09-06 14:16:15 -06:00
Nathan Sobo fad5e69b3c Merge remote-tracking branch 'origin' into storybook 2023-09-01 10:08:48 -06:00