Commit Graph

157 Commits

Author SHA1 Message Date
Mikayla
a41c857855
Merge branch 'main' into welcome2 2023-11-28 15:38:51 -08:00
Nate Butler
f33cd3d463 Merge branch 'main' into refine-keybindings 2023-11-28 14:00:09 -05:00
Mikayla
8faa1f6e58
Merge branch 'main' into welcome 2023-11-27 18:55:23 -08:00
Nate Butler
c40ab3c3da Update theme2.rs 2023-11-27 09:11:51 -05:00
Nate Butler
48a9f2be4c Update one theme colors 2023-11-24 16:57:35 -05:00
Mikayla
663bbb06d9
WIP 2023-11-21 12:40:00 -08:00
Marshall Bowers
1b05aad30c
Extract Story into separate story crate (#3378)
This PR extracts the `Story` component into a separate `story` crate so
that it can be shared among various crates that define stories.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2023-11-21 13:42:00 -05:00
Marshall Bowers
6cd0bcc578
Fix panic when opening settings in zed2 (#3375)
This PR fixes a panic that occurs when opening the settings in zed2.

We store the `ThemeRegistry` as a global without wrapping it in an
`Arc`, so we need to retrieve it the same way.

Release Notes:

- N/A
2023-11-21 10:58:52 -05:00
Mikayla
2c4d83c9af
WIP
co-authored-by: conrad <conrad@zed.dev>
co-authored-by: Nathan <nathan@zed.dev>
2023-11-20 14:46:01 -08:00
Conrad Irwin
0798cfd58c Merge branch 'main' into derive-element-redux 2023-11-20 09:15:38 -07:00
Nate Butler
176a68f90f kb 2023-11-20 10:46:23 -05:00
Nathan Sobo
adc355a1e6 Element refinement passing on ui2 2023-11-18 20:05:47 -07:00
Nathan Sobo
23ffce9fbe WIP: Work toward eliminating Component trait
This refactor enhances the overall design by promoting reusable and composable UI component structures within the Zed project codebase.
2023-11-18 00:03:23 -07:00
Julia
3655a96e54 Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:32:35 -05:00
Julia
c6d22af416 Get diagnostic2 tests building and running 2023-11-17 16:32:35 -05:00
Nate Butler
a526f23c81
Add ui_font settings and set default rem size accordingly (#3346)
[[PR Description]]
- Adds ui_font_family, ui_font_features, ui_font_size to settings and
default settings
- Use the new ui font settings to set the rem size when the workspace is
created.

Release Notes:

- N/A
2023-11-16 15:40:33 -05:00
Marshall Bowers
b559bfd80f
Parameterize theme2::init to allow loading just the base theme (#3345)
This PR adds a parameter to the `theme2::init` method to indicate what
the theme-loading behavior should be.

This allows us to indicate when we want to load all of the additional
built-in user themes (like in the Zed binary and in the storybook), and
when we don't want to load the user themes (like in tests).

We're using an enum over just a `bool` here for clarity at the call
site.

Release Notes:

- N/A
2023-11-16 13:03:30 -05:00
Nate Butler
c71e522b4e Allow users to set UI font properties in their settings
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-16 11:37:46 -05:00
Mikayla
7f72df6dcf
Merge branch 'main' into element-types 2023-11-14 15:49:10 -08:00
Mikayla
6b25841e2a
WIP 2023-11-14 14:48:34 -08:00
Nathan Sobo
364e3e7de5 Merge remote-tracking branch 'origin/main' into element-types 2023-11-14 01:55:58 -07:00
Nathan Sobo
c6e8a097a3 Rename back to div 2023-11-14 01:41:55 -07:00
Nathan Sobo
27fb381cca Checkpoint 2023-11-14 01:15:48 -07:00
Marshall Bowers
0430e8fbf2 Use "One Dark" as default theme 2023-11-13 18:44:17 -05:00
Marshall Bowers
53117eb5e5 Merge branch 'main' into one-themes 2023-11-13 18:16:45 -05:00
Nate Butler
fea5436ba9 Remove unused imports 2023-11-13 17:54:22 -05:00
Nate Butler
dd434588ee WIP 2023-11-13 17:38:44 -05:00
Nate Butler
97d6e7f2f5 Add one syntax theme 2023-11-13 17:09:55 -05:00
Nate Butler
c1887747b7 Add one_dark theme 2023-11-13 15:48:05 -05:00
Nate Butler
e0547d9acd Allow arrays of colors to be passed in 2023-11-13 15:47:57 -05:00
Nate Butler
916df3c614 Add color converter util 2023-11-13 15:28:20 -05:00
Marshall Bowers
04ad19d01b Choose appropriate player colors based on theme appearance 2023-11-13 15:07:13 -05:00
Nate Butler
889d20d046 Reorganize theme2 crate 2023-11-13 13:58:23 -05:00
Nate Butler
7be12cb7b1 Checkpoint Broken 2023-11-13 12:44:50 -05:00
Nate Butler
5361a499ae Checkpoint 2023-11-13 12:09:31 -05:00
Nate Butler
521972ed9e Update Status Colors 2023-11-13 11:56:42 -05:00
Marshall Bowers
6bc1cf0fae
Re-import the Synthwave 84 theme (#3297)
This PR re-imports the Synthwave 84 theme now that we support 3-value
hex colors.

Release Notes:

- N/A
2023-11-09 18:56:42 -05:00
Marshall Bowers
8bd02fdadc
Extend RGBA hex color parsing to support 3-value and 4-value variants (#3295)
This PR extends our support for parsing hex color codes to `Rgba` to
additionally support 3-value (`#rgb`) and 4-value (`#rgba`) formats.

See [here](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)
for more details on these hex color variants.

Release Notes:

- N/A
2023-11-09 18:27:47 -05:00
Marshall Bowers
8f5adeb9c3 Improve error conditions when parsing hex colors 2023-11-09 18:00:17 -05:00
Nate Butler
2347576fb5
Extend theme converter to allow multimatching against vscode colors (#3294)
[[PR Description]]

Adds the ability to specify a vec of VScode syntax scopes to match
against for a given syntax style.

Example:

```rust
pub fn to_vscode(&self) -> Vec<&'static str> {
        use ZedSyntaxToken::*;

        match self {
            SyntaxAttribute => vec!["entity.other.attribute-name"],
            SyntaxBoolean => vec!["constant.language"],
            SyntaxComment => vec!["comment"],
            SyntaxCommentDoc => vec!["comment.block.documentation"],
            SyntaxConstant => vec!["constant.character"],
            SyntaxConstructor => vec!["entity.name.function.definition.special.constructor"],
            SyntaxEmbedded => vec!["meta.embedded"],
            SyntaxEmphasis => vec!["markup.italic"],
            SyntaxEmphasisStrong => vec![
                "markup.bold",
                "markup.italic markup.bold",
                "markup.bold markup.italic",
            ],
            SyntaxEnum => vec!["support.type.enum"],
            SyntaxFunction => vec![
                "entity.name.function",
                "variable.function",
                "support.function",
            ],
            SyntaxKeyword => vec!["keyword"],
            SyntaxLabel => vec![
                "label",
                "entity.name",
                "entity.name.import",
                "entity.name.package",
            ],
            // .. more styles
}}
```

Useful `settings.json` for testing themes:

```json5
{
  // --- Dark Themes ---
  "theme": "Ayu Dark"
  // "theme": "Ayu Mirage"
  // "theme": "Dracula"
  // "theme": "Gruvbox Dark Hard"
  // "theme": "Gruvbox Dark Medium"
  // "theme": "Gruvbox Dark Soft"
  // "theme": "Night Owl"
  // "theme": "Noctis Obscuro"
  // "theme": "Noctis"
  // "theme": "Nord"
  // "theme": "Palenight (Mild Contrast)"
  // "theme": "Palenight Operator"
  // "theme": "Palenight"
  // "theme": "Rose Pine Moon"
  // "theme": "Rose Pine"
  // "theme": "Solarized Dark"
  // "theme": "Synthwave 84"
  // --- Light Themes ---
  // "theme": "Ayu Light"
  // "theme": "Gruvbox Light Hard"
  // "theme": "Gruvbox Light Medium"
  // "theme": "Gruvbox Light Soft"
  // "theme": "Noctis Lux"
  // "theme": "Rose Pine Dawn"
  // "theme": "Solarized Light"
}
```

Release Notes:

- N/A
2023-11-09 17:40:10 -05:00
Max Brunsfeld
b6eef26f91 Merge branch 'main' into search-query-suggestion-fixes 2023-11-09 14:18:17 -08:00
Nate Butler
6b65acaa99 regenerate themes, format 2023-11-09 16:48:35 -05:00
Nate Butler
4cd37e6e62 Extend theme converter to allow multimatching against vscode colors 2023-11-09 16:38:48 -05:00
Max Brunsfeld
28d3d21108 Generalize Refineable derive macro to derive arbitrary traits on the refinement type 2023-11-09 13:23:31 -08:00
Marshall Bowers
7b489f5e2e Allow user-theme related methods to be unused 2023-11-09 15:16:59 -05:00
Nate Butler
1c6a960bbf Deal with special case where a VSCode theme doesn't have a foreground color
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 14:53:04 -05:00
Nate Butler
54157eb99a Finish passing Syntax from VSCode themes to Zed Themes
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 14:41:26 -05:00
Nate Butler
ff053890cf Extend UserSyntax to allow font_style and font_weight to be specified
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 13:46:08 -05:00
Marshall Bowers
978cff8095 Use IndexMap for a deterministic order when importing syntax colors 2023-11-09 13:12:36 -05:00
Marshall Bowers
34e31fd489 Properly emit UserHighlightStyles 2023-11-09 12:59:20 -05:00