Commit Graph
56 Commits
Author SHA1 Message Date
Conrad Irwin 9d742b90c3 Allow you to click on a context menu item 2023-11-17 11:57:51 -07:00
Conrad Irwin 074a221e0f Progress on ContextMenu 2023-11-16 16:59:27 -07:00
Kirill BulatovandPiotr ab0a3f19ab Add an actual context menu into terminal-2
(click the text, not the pane!)

Co-Authored-By: Piotr <piotr@zed.dev>
2023-11-16 16:36:44 +02:00
Marshall Bowers 76c15229c1 Combine LabelColor and IconColor into TextColor 2023-11-14 13:48:01 -05:00
Marshall Bowers 3654dd8da0 Remove unnecessary map 2023-11-13 11:10:08 -05:00
Nate Butler 99a57d922f Add theme importer (#3246)
[[PR Description]]

Thanks @maxdeviant for all the help with this one 🫂 

- Adds the `theme_importer` crate
- Adds the ability to import themes in VSCode Format.
- Adds the `assets/themes/src` folder with source files for imported
themes
- Adds an initial set of themes: `andromeda`, `ayu`, `dracula`,
`gruvbox`, `night-owl`, `noctis`, `palenight`, `rose-pine`, `solarized`,
`synthwave-84`.

From the README:

## Usage

- `cargo run -p theme_importer` - Import the context of
`assets/themes/src`

---

## Troubleshooting

As the importer generates rust files, you may need to manually do some
cleanup in `registry.rs` and `themes/mod.rs` if you remove themes or
delete the `themes` folder in the theme crate.

---

## Required Structure

To import a theme or series of themes 3 things are required:

- `family.json`: A JSON file containing the theme family metadata and
list of theme variants
- `{theme_name}.json`: One theme json for each theme variant
- `LICENSE`: A license file for the theme family

### `family.json`

#### `name`

The name of the theme family. Avoid special characters.

This will be used for the theme family directory name (lowercased) and
the theme family name in the Zed UI.

Good:

- `Rose Pine`
- `Synthwave 84`
- `Monokai Solarized`

Bad:

- `Rosé Pine`
- `Synthwave '84`
- `Monokai (Solarized)`

#### `author`

The author of the theme family. This can be a name or a username.

This will be used for the theme family author in the Zed UI.

#### `themes`

A list of theme variants.

`appearance` can be either `light` or `dark`. This will impact which
default fallback colors are used, and where the theme shows up in the
Zed UI.

### `{theme_name}.json`

Each theme added to the family must have a corresponding JSON file. This
JSON file can be obtained from the VSCode extensions folder (once you
have installed it.) This is usually located at `~/.vscode/extensions`
(on macOS).

You can use `open ~/.vscode/extensions` to open the folder in Finder
directly.

Copy that json file into the theme family directory and tidy up the
filenames as needed.

### `LICENSE`

A LICENSE file is required to import a theme family. Failing to provide
a complete text license will cause it to be skipped when the import is
run.

If the theme only provices a license code (e.g. MIT, Apache 2.0, etc.)
then put that code into the LICENSE file.

If no license is provided, either contact the theme creator or don't add
the theme.

---

### Complete Example:

An example family with multiple variants:

```json
{
  "name": "Ayu",
  // When both name and username are available
  // prefer the `username (name)` format
  "author": "dempfi (Ike Ku)",
  "themes": [
    {
      "name": "Ayu Light",
      "file_name": "ayu-light.json",
      "appearance": "light"
    },
    {
      "name": "Ayu Mirage",
      "file_name": "ayu-mirage.json",
      "appearance": "dark"
    },
    {
      "name": "Ayu Dark",
      "file_name": "ayu-dark.json",
      "appearance": "dark"
    }
  ]
}
```

An example single variant family:

```json
{
  "name": "Andromeda",
  "author": "Eliver Lara (EliverLara)",
  "themes": [
    {
      "name": "Andromeda",
      "file_name": "andromeda.json",
      "appearance": "dark"
    },
    {
      "name": "Andromeda Bordered",
      "file_name": "andromeda-bordered.json",
      "appearance": "dark"
    }
  ]
}
```


Release Notes:

- N/A
2023-11-06 16:08:05 -05:00
Conrad Irwin 496518f3e8 Use gpui instead of gpui2 consistenytly 2023-11-06 11:50:33 -07:00
Marshall Bowers f8504c349c Merge branch 'main' into import-theme 2023-11-06 12:08:46 -05:00
bf80c1da5b Rename fields in ThemeColors (#3242)
This PR applies a number of field renames in the `ThemeColors` struct
from the `import-theme` branch.

This will help prevent this branch from diverging too far from `main`.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-06 11:53:27 -05:00
Nate Butler b125cc279f Simplify toggle, do some reorganization 2023-11-04 11:24:31 -04:00
Nate Butler 2b0c959137 Add terminal colors to ThemeColors, add _background to some color names. 2023-11-02 19:53:52 -04:00
Nate Butler 3f74f75dee WIP 2023-11-01 16:19:49 -04:00
Nate Butler 8dafd5f1f3 Allow ListHeader to take a meta 2023-11-01 12:43:25 -04:00
Nate Butler 3bcc2fa17b Update notifications panel 2023-11-01 02:10:23 -04:00
18431051d9 Rework theme2 with new theme structure (#3194)
This PR reworks the theme definition in the `theme2` crate to be based
off of the new theme work that @iamnbutler has been working on.

We're still developing the new theme system, but it is complete enough
that we can now load the default theme and use it to theme the storybook
(albeit with some further refining of the color palette required).

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Marshall Bowers <marshall@zed.dev>
2023-10-31 22:23:00 -04:00
Marshall Bowers 1887f3b594 Rename S type to V 2023-10-26 15:54:43 +02:00
Marshall Bowers eb19071d84 ui2: Clean up takes 2023-10-26 15:44:39 +02:00
Marshall Bowers 7b4a895ab9 ui2: Clean up drains 2023-10-26 15:41:29 +02:00
Marshall Bowers 88ef74ec8f Checkpoint: Compiling after view type removal 2023-10-26 15:20:38 +02:00
Nathan Sobo 0285284ae1 Rename IntoAnyElement trait to Component 2023-10-26 12:46:52 +02:00
Nathan Sobo 8ecfea55cd Replace derive Element with derive IntoAnyElement everywhere 2023-10-26 12:38:23 +02:00
Nathan Sobo 927278e20d Remove IntoAnyElement bound from Element trait 2023-10-26 11:49:36 +02:00
Marshall Bowers 9fb9885931 Checkpoint: Compiling 2023-10-26 10:08:39 +02:00
Marshall Bowers e1032c5341 Remove ThemeColor in favor of theme2::Theme 2023-10-25 16:32:44 +02:00
Marshall Bowers cf380a9f62 Remove set_ prefix for List setters 2023-10-24 14:18:51 +02:00
Marshall Bowers bb35583998 Merge branch 'gpui2' into zed2 2023-10-24 14:11:13 +02:00
Nate Butler 3a326bfa7e 🤦 Remove references to system_color 2023-10-23 11:05:17 -04:00
Nate ButlerandMikayla Maki cc445f7cef Start scaffolding out the Copilot Modal UI
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-10-23 10:00:02 -04:00
Antonio Scandurra e4fe9538d7 Checkpoint 2023-10-21 16:01:47 +02:00
Marshall Bowers 7719ed0d6c Remove unnecessary iterator 2023-10-20 16:34:33 -04:00
Marshall Bowers cbdd1d6d6c Use children instead of when 2023-10-20 16:30:52 -04:00
Nate Butler 0609628645 List actions for ListDetailsEntries 2023-10-19 20:17:41 -04:00
Nate Butler 32028fbbb1 Checkpoint – Notifications Panel 2023-10-19 20:04:21 -04:00
Marshall Bowers 4050bf43c4 Remove Clone bound for Label 2023-10-19 16:31:24 -04:00
Marshall Bowers 3932c1064e Merge branch 'gpui2' into gpui2-theme-to-color 2023-10-19 16:10:44 -04:00
Nate Butler 58650b7d2d Checkpoint - Still Broken 2023-10-19 14:38:01 -04:00
Nate Butler bca97f7186 Checkpoint – Broken 2023-10-19 12:58:17 -04:00
Marshall Bowers 61e09ff532 Checkpoint: Thread WindowContext through to user_settings 2023-10-19 12:58:17 -04:00
Nate ButlerandMarshall Bowers 7b2782c0f6 Use ui_size to set relative font sizes
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-10-18 17:02:57 -04:00
Nate Butler a6a50113da Merge branch 'n/gpui2ui-settings' into gpui2 2023-10-18 16:17:57 -04:00
Nate ButlerandMarshall Bowers 8b637e194e Update approach to settings
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-10-18 16:16:58 -04:00
Nate Butler 289255d67a Update UI elements and implement user settings for customization 2023-10-18 15:42:10 -04:00
Marshall Bowers 8dad3ad8ea Use SharedString for Lists 2023-10-18 14:19:26 -04:00
Antonio Scandurra 296a2b8e5d Rename fill to bg 2023-10-18 09:39:23 +02:00
Antonio Scandurra 4db0350f06 Checkpoint 2023-10-17 22:16:48 +02:00
Marshall Bowers c8b452d411 Merge branch 'gpui2-ui' into gpui2 2023-10-16 16:54:40 -04:00
Marshall Bowers 708034d1d3 Call is_toggled as a method 2023-10-16 15:55:43 -04:00
Nate Butler 603765732e Checkpoint 2023-10-13 14:50:37 -04:00
Antonio Scandurra 2044ccdc0b WIP 2023-10-12 19:40:13 +02:00
Marshall Bowers 262f5886a4 Checkpoint 2023-10-12 12:18:35 -04:00