Commit Graph
275 Commits
Author SHA1 Message Date
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
Nate Butler c6b1ef2c38 Merge branch 'main' into add-ui-docs 2023-11-03 18:20:17 -04:00
Nate Butler 7080241479 Add some initial docs 2023-11-03 18:19:54 -04:00
Marshall Bowers 49922ece21 ui2: Reorganize components (#3228)
This PR reorganizes the components in the `ui2` crate.

The distinction between "elements" and "components" is now gone, with
all of the reusable components living under `components/`.

The components that we built while prototyping but will eventually live
in other crates currently reside in the `to_extract/` module.

Release Notes:

- N/A
2023-11-03 17:34:11 -04:00
Nate ButlerandMarshall Bowers 5426d44499 Add docs burndown list
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-03 16:37:22 -04:00
Nate ButlerandMarshall Bowers 7782368831 Start on ui root doc
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-03 16:28:54 -04:00
Nate Butler 7d5e80d90a Merge branch 'main' into import-theme 2023-11-02 20:16:09 -04:00
Nate Butler 0685483f99 Add terminal colors to ThemeColors, add _background to some color names. 2023-11-02 19:53:52 -04:00
Nathan Sobo 12fe5d7d49 Fix formatting 2023-11-02 12:28:58 -06:00
Nathan Sobo 2cb2794a7b Merge remote-tracking branch 'origin/main' into gpui2-image-reborrow 2023-11-02 12:25:06 -06:00
Marshall Bowers fb4132cd65 Checkpoint: Narrow down error 2023-11-02 12:47:06 -04:00
Marshall Bowers 071112b838 Checkpoint: Reproduction with Avatar story 2023-11-02 12:34:40 -04:00
Nate Butler 22d9ca9a3f Document format_distance
Adds docs for:
- distance_in_seconds
- distance_string
- naive_format_distance
- naive_format_distance_from_now
2023-11-02 11:53:20 -04:00
Marshall Bowers 77bb709e42 Add map method to Components (#3210)
This PR adds a `map` method to the `Component` trait.

`map` is a fully-generalized form of `when`, as `when` can be expressed
in terms of `map`:

```rs
div().map(|this| if condition { then(this) } else { this })
```

This allows us to take advantage of Rust's pattern matching when
building up conditions:

```rs
// Before
div()
    .when(self.current_side == PanelSide::Left, |this| this.border_r())
    .when(self.current_side == PanelSide::Right, |this| {
        this.border_l()
    })
    .when(self.current_side == PanelSide::Bottom, |this| {
        this.border_b().w_full().h(current_size)
    })

// After
div()
    .map(|this| match self.current_side {
        PanelSide::Left => this.border_r(),
        PanelSide::Right => this.border_l(),
        PanelSide::Bottom => this.border_b().w_full().h(current_size),
    })
```

Release Notes:

- N/A
2023-11-02 11:39:40 -04:00
Nate Butler 708091c82c Remove unused import 2023-11-02 11:04:04 -04:00
Nate Butler 4482d528dc Merge branch 'main' into n/t2 2023-11-02 11:02:55 -04:00
Nate Butler 931d6f0b61 Remove unused import 2023-11-02 11:02:46 -04:00
Nate Butler eddf9edda1 Use naive_format_distance_from_now in Notifications 2023-11-02 11:02:17 -04:00
Nate Butler 1b5160f0e1 Update naive_format_distance and tests 2023-11-02 10:37:33 -04:00
Nate Butler abce383ba0 Checkpoint - impl format_distance 2023-11-02 10:11:25 -04:00
Nathan Sobo c5a361d12b Merge remote-tracking branch 'origin/main' into gpui2-no-send 2023-11-01 21:10:31 -06:00
Nathan Sobo d2d9430fc8 Get project2 tests green 2023-11-01 20:14:40 -06:00
Nate Butler 76e0bdc7f0 Merge branch 'main' into n/t2 2023-11-01 16:52:43 -04:00
Nate ButlerandMarshall Bowers 73578fa334 Add additional notifications and style tweaks
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-01 16:50:59 -04:00
Nate ButlerandMarshall Bowers 7de3c470b0 Implement Notifications
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-01 16:34:42 -04:00
Nate Butler b52624eb51 WIP 2023-11-01 16:19:49 -04:00
Marshall Bowers 3a6d95b185 Add ui_font_size setting (#3199)
This PR adds a new `ui_font_size` setting that can be used to control
the scale of the entire UI.

We use the value in this setting to set the base rem size of the window.

Release Notes:

- N/A
2023-11-01 13:11:12 -04:00
Nate Butler 95ebec7f46 Allow ListHeader to take a meta 2023-11-01 12:43:25 -04:00
Marshall Bowers ecd3d7d02d Remove unused impl 2023-11-01 10:52:25 -04:00
Nate Butler ed603b3b45 Update notifications panel 2023-11-01 02:10:23 -04:00
Nate Butler 048f0bc2b4 Continue refining theme, update tabs & tab bar 2023-11-01 01:41:33 -04:00
Nate Butler a8519a8cc4 Refine default colors 2023-11-01 00:51:57 -04:00
766d5959be 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
badfb586e6 Introduce a Render trait, make views implement it
Don't pass a render function separately from the view.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Antonio <as-cii@zed.dev>
2023-10-30 15:19:40 -07:00
Marshall Bowers 8fc8f80403 Remove old theme constructs 2023-10-30 14:47:44 -04:00
Antonio Scandurra 3895aba120 Rename Handle to Model 2023-10-30 19:44:01 +01:00
Marshall Bowers be81b7d0d8 Remove references to old_theme 2023-10-30 14:36:49 -04:00
Marshall Bowers 38cea1c93b Remove themed wrapper 2023-10-30 14:28:25 -04:00
Nathan Sobo 19e39bb578 Add View::update which provides a ViewContext 2023-10-26 19:41:42 +02:00
Antonio Scandurra 3135db57c8 WIP 2023-10-26 17:15:19 +02:00
Marshall Bowers 2cfbcb3db7 ui2: Remove dependency on theme crate 2023-10-26 16:50:04 +02:00
Marshall Bowers 2db19e3d6e ui2: Remove dependency on settings crate 2023-10-26 16:50:04 +02:00
Marshall Bowers 2aa6fc3c20 Remove unneeded constructors for stories 2023-10-26 16:46:49 +02:00
Max BrunsfeldandMarshall Bowers 11b184fe16 Represent theme's syntax colors with string keys
Co-authored-by: Marshall Bowers <marshall@zed.dev>
2023-10-26 16:38:50 +02:00
Marshall Bowers 9c2f086847 ui2: Remove ElementExt trait 2023-10-26 15:59:18 +02:00
Marshall Bowers 1965d5b13d Rename S type to V 2023-10-26 15:54:43 +02:00
Marshall Bowers 5881f3e761 Remove unused state_type 2023-10-26 15:45:08 +02:00