Commit Graph
91 Commits
Author SHA1 Message Date
Nathan Sobo 29d8390743 Fix formatting 2023-11-02 12:28:58 -06:00
Nathan Sobo 1dd20d4c0a Merge remote-tracking branch 'origin/main' into gpui2-image-reborrow 2023-11-02 12:25:06 -06:00
Marshall Bowers 0e1d2fdf21 Checkpoint: Narrow down error 2023-11-02 12:47:06 -04:00
Marshall Bowers 66e4d75e6f Checkpoint: Reproduction with Avatar story 2023-11-02 12:34:40 -04:00
Marshall Bowers ec0cff0e1a 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 d0975aacac Merge branch 'main' into n/t2 2023-11-01 16:52:43 -04:00
Nate ButlerandMarshall Bowers 229ba0744e 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 be3cc6458c Implement Notifications
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-01 16:34:42 -04:00
Nate Butler 3f74f75dee WIP 2023-11-01 16:19:49 -04:00
Marshall Bowers b910bbf002 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 8dafd5f1f3 Allow ListHeader to take a meta 2023-11-01 12:43:25 -04:00
Nate Butler bfb1f5ecf0 Continue refining theme, update tabs & tab bar 2023-11-01 01:41:33 -04:00
Nate Butler 0efd69c60f Refine default colors 2023-11-01 00:51:57 -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
30dffbb409 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 14d24a9ac6 Remove references to old_theme 2023-10-30 14:36:49 -04:00
Marshall Bowers 61694bba6a Remove unneeded constructors for stories 2023-10-26 16:46:49 +02: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 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 437d147935 Rename player to players 2023-10-25 16:39:06 +02:00
Marshall Bowers e1032c5341 Remove ThemeColor in favor of theme2::Theme 2023-10-25 16:32:44 +02:00
Marshall Bowers 258496700f Rename theme getter to old_theme 2023-10-25 16:02:47 +02:00
Nate Butler bfb37bbe94 Merge branch 'n/elevation' into zed2 2023-10-24 08:34:54 -04:00
Marshall Bowers bb35583998 Merge branch 'gpui2' into zed2 2023-10-24 14:11:13 +02:00
Marshall Bowers 171db00f6e Fix stack overflow 2023-10-24 11:39:15 +02:00
Marshall Bowers 6f5cf10acb Comment out .state setting 2023-10-24 11:39:10 +02:00
Nate Butler e99d862f3f WIP Button Refactor 2023-10-23 14:50:53 -04: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 4dc2440024 Enable text wrapping for Details 2023-10-20 16:13:54 -04:00
Marshall Bowers 901af8de3f Remove Clone bound from Avatar 2023-10-20 11:13:13 -04:00
Nate Butler 32028fbbb1 Checkpoint – Notifications Panel 2023-10-19 20:04:21 -04:00
Antonio Scandurra 296fc92721 Checkpoint 2023-10-19 23:47:32 +02:00
Antonio Scandurra 21b4ae3fdc Merge 2023-10-19 23:40:38 +02:00
Antonio Scandurra dd7e1c505c Checkpoint 2023-10-19 23:00:19 +02:00
Marshall Bowers 94f0140f62 Assign each IconButton an ID based on the icon 2023-10-19 16:50:33 -04:00
Marshall Bowers e1e8b63eb5 Remove Clone bound from IconElement 2023-10-19 16:37:15 -04:00
Marshall Bowers a1aba32209 Remove Clone bound from Button and Details 2023-10-19 16:35:44 -04:00
Marshall Bowers fa3916d1bf Remove Clone bound for HighlightedLabel 2023-10-19 16:34:08 -04:00
Marshall Bowers 3ac7ef90ef Remove Clone bound for Input 2023-10-19 16:32:48 -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
Marshall Bowers 2189983323 Add missing Clone bounds 2023-10-19 15:02:00 -04:00
Nate Butler 58650b7d2d Checkpoint - Still Broken 2023-10-19 14:38:01 -04:00