Commit Graph
327 Commits
Author SHA1 Message Date
Nate Butler bdbb7bcb3b Extend tooltip to take meta + kb 2023-11-14 12:59:53 -05:00
Antonio Scandurra c4a5f47bc3 Merge remote-tracking branch 'origin/main' into editor2-blocks 2023-11-14 17:16:58 +01:00
Nate Butler 3ceadaa609 Allow a button to take a color (#3315)
[[PR Description]]
- Allows a button to take a color and resolve it into `IconColor` and
`LabelColor`
- Extend `IconColor` and `LabelColor` to allow them to take a
`Player(i)`
- `impl From<LabelColor> for IconColor`

Release Notes:

- N/A
2023-11-14 10:36:52 -05:00
Antonio ScandurraandJulia d4b9bd4ec8 Render block elements
Co-Authored-By: Julia <julia@zed.dev>
2023-11-14 16:03:06 +01:00
Antonio Scandurra 0d6d776a8b WIP 2023-11-14 14:48:59 +01:00
Conrad Irwin 0bbd5b0775 Allow clicking on commands in the command palette 2023-11-13 21:42:27 -07:00
Conrad Irwin bb2477eb42 Add Text::styled() and use it in command palette
Prevents jumping while typing
2023-11-13 19:53:55 -07:00
Nate Butler 9624355db1 Allow a button to take a color 2023-11-13 19:46:15 -05:00
Marshall Bowers 8e2a7b803f Merge branch 'main' into one-themes 2023-11-13 18:16:45 -05:00
Conrad Irwin 45966b2960 Add KeyBindings to CommandPalette 2023-11-13 15:40:49 -07:00
Nate Butler 98916f54d2 WIP 2023-11-13 17:38:44 -05:00
Conrad Irwin 235edc51c8 Merge branch 'main' into dispatch-tree 2023-11-13 13:21:57 -07:00
Marshall Bowers 940cb582b5 Remove unnecessary map 2023-11-13 11:10:08 -05:00
Marshall Bowers 44f67a2763 Move Sized bound to StyledExt trait 2023-11-13 11:10:00 -05:00
Nathan Sobo a3ec1048fd WIP 2023-11-10 14:47:45 -07:00
Nate ButlerandMarshall Bowers 61fe4fdebd Add ui::Divider component
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-10 16:12:32 -05:00
Nate ButlerandMarshall Bowers 2725e39675 Add elevation to StyledExt
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-10 16:12:14 -05:00
Antonio Scandurra 03050a8dc1 Merge remote-tracking branch 'origin/main' into code-actions-2 2023-11-10 11:01:23 +01:00
Antonio ScandurraandNathan 9d6d2c59e3 Render code actions indicator
Co-Authored-By: Nathan <nathan@zed.dev>
2023-11-09 18:43:26 +01:00
Nate Butler 71a1b131cd Merge branch 'main' into update-workspace-styles 2023-11-09 00:38:06 -05:00
Conrad Irwin 800a7adcf2 go to line2 (#3261)
- MODAL
- center a div
- MOAR CODE
- Beautiful go to line modal


Release Notes:
- N/A
2023-11-08 17:16:00 -07:00
Nate Butler 75dcde53e9 WIP 2023-11-08 16:43:32 -05:00
Nate ButlerandMarshall Bowers 7cab4b8784 Update usages of text_size_* to text_ui in ui components
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:28:38 -05:00
Nate ButlerandMarshall Bowers 30d837f5ca Update StyledExt to impl over I & F as well as V for Div
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:25:44 -05:00
Nate ButlerandMarshall Bowers 55abfc6eca Remove the Stack trait, update StyledExt to include stacks
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:00:47 -05:00
Nate Butler f396e9d48f Remove unused code in avatar 2023-11-08 14:46:47 -05:00
Nate Butler ed6dbf0861 Update StyledExt to use more idiomatic method naming 2023-11-08 14:42:56 -05:00
Mikayla 738ca57aba Merge branch 'main' into go-to-line2 2023-11-08 11:32:36 -08:00
Nate Butler 7a7cc4d086 BROKEN: Checkpoint 2023-11-08 14:29:38 -05:00
Nate Butler e6dabbda75 add ui_text_size functions 2023-11-08 12:57:24 -05:00
Marshall Bowers 9f7bef63b3 Port the picker and uniform list (#3248)
This adds a `UniformList` element and partially implements `Picker` as a
component, using `UniformList`. Because editor2 isn't fully implemented
yet, the picker doesn't have filtering logic yet. We want to merge this
for now though, to make the UniformList element available for other
crates.

Release Notes:

- N/A
2023-11-08 17:45:23 +01:00
Marshall Bowers 8f89c1e77b Replace GitStatusColors with StatusColors (#3268)
This PR removes `GitStatusColors` in favor of just using `StatusColors`
instead.

Release Notes:

- N/A
2023-11-08 11:32:32 -05:00
Conrad Irwin 5132635ad2 Merge branch 'main' into go-to-line3 2023-11-07 14:44:45 -07:00
Nate Butler b931301d81 center a div 2023-11-07 16:23:41 -05:00
Conrad Irwin 11579331d3 MODAL 2023-11-07 13:23:27 -07:00
Mikayla Maki a729ad29f1 Merge branch 'main' into picker 2023-11-07 11:44:02 -08:00
Nate Butler 723ac00cbf Begin documenting theme colors 2023-11-07 13:36:01 -05:00
Max Brunsfeld 30580b8abb Merge branch 'main' into picker 2023-11-07 09:34:57 -08:00
Antonio Scandurra ccdb5b2857 Merge remote-tracking branch 'origin/main' into editor2-paint 2023-11-07 13:09:48 +01:00
490c08a10a wip: picker
co-authored-by: nathan <nathan@zed.dev>
co-authored-by: max <max@zed.dev>
2023-11-06 17:09:38 -08:00
Nate Butler b2c874f0d7 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 a914935a6e Use gpui instead of gpui2 consistenytly 2023-11-06 11:50:33 -07:00
Conrad Irwin a8dca1cac8 editor2 rendering (#3244)
- Make tab bar visible
- Fix tab text colors
- Ensure panes cover the available space
- Make the close button close
- Fix bug when unsubscribe called after remove
- WIP: start on editor element
- Add hover behaviour to tabs
- Add PointingHand on tabs
- gpui2: Add on_hover events
- Tooltip on tabs
- MOAR TOOLTIPS
- Use an `IconButton` for the tab close button
- Remove unneeded type qualification
- Tooltips in mouse event handler & fix executor timer
- Move more tooltip logic into gpui2 & fix tooltip moving on paint
- Update tooltip code a bit
- Allow multiple subscriptions from one entity handle

Release Notes:

- N/A
2023-11-06 11:29:42 -07:00
Marshall Bowers 4a6516a2ab Add interactivity to Checkbox component (#3240)
This PR adds interactivity to the `Checkbox` component.

They can now be checked and unchecked by clicking them.

Release Notes:

- N/A
2023-11-06 13:22:25 -05:00
Conrad Irwin 20eb31b450 Merge branch 'main' into editor2-rendering 2023-11-06 11:06:43 -07:00
Conrad Irwin d7f608c1e2 tooltip2 (#3237)
- Fix executor.timer() in gpui2
- Add support for tooltips 

[[PR Description]]

Release Notes:

- N/A
2023-11-06 10:51:01 -07:00
Marshall Bowers 31cfb83723 Merge branch 'main' into import-theme 2023-11-06 12:08:46 -05:00
c905d4f66d 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 09fd938c2c Add checkboxes and their stories 2023-11-05 01:06:41 -05:00
Nate Butler e59bf2ad35 Simplify toggle, do some reorganization 2023-11-04 11:24:31 -04:00