Antonio Scandurra
be73dd852d
Move Arena
to a thread-local and use it to allocate AnyElement
2023-12-15 16:18:05 +01:00
Nathan Sobo
ad8165ae79
Rename draw2 -> draw_and_update_state
2023-12-14 17:20:27 -07:00
Nathan Sobo
d13a21c238
Don't move in paint
2023-12-14 15:15:18 -07:00
Mikayla
a807e798ec
Add new drag API
2023-12-13 13:40:19 -08:00
Joseph T. Lyons
7c19650a40
Remove when_else
...
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-12-07 12:37:07 -05:00
Joseph T. Lyons
d2362d7f12
Merge branch 'main' into feedback-2
2023-12-06 23:16:54 -05:00
Joseph T. Lyons
8fc15c05c5
Introduce when_else()
2023-12-06 22:34:14 -05:00
Mikayla
ab140ee4c2
Add event based drag API to GPUI, continue binding mouse handlers to terminal
2023-12-05 12:07:17 -08:00
Conrad Irwin
8d1518d70c
Fix stateful elements in Components
...
Previously a component assumed its element was stateless, this was
incorrect!
2023-11-28 20:47:11 -07:00
Antonio Scandurra
3b918bfee8
Merge branch 'main' into rename-element-traits
...
# Conflicts:
# crates/gpui2/src/elements/uniform_list.rs
# crates/ui2/src/components/context_menu.rs
# crates/ui2/src/components/list.rs
2023-11-23 12:47:46 +01:00
Mikayla
eb74ad7caa
Fix failing test
2023-11-22 13:41:48 -08:00
Nathan Sobo
c23f17ee0b
Reorganize element-related traits
2023-11-22 11:19:43 -07:00
Mikayla
469b05684f
Fix a few identity mixups in GPUI
...
co-authored-by: nathan <nathan@zed.dev>
2023-11-21 17:12:32 -08:00
Conrad Irwin
d0dd44faad
Merge branch 'main' into callback-handles
2023-11-20 12:21:42 -07:00
Mikayla
88024ca7c9
Remove V parameter on elements
2023-11-19 18:32:31 -08:00
Nathan Sobo
33cd6f520a
Clean compile with redesigned element traits
2023-11-18 21:51:47 -07:00
Nathan Sobo
adc355a1e6
Element refinement passing on ui2
2023-11-18 20:05:47 -07:00
Nathan Sobo
be33f000e2
WIP: Lots of errors, starting on resurrecting derive Element
2023-11-18 00:27:40 -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
Nathan Sobo
2515bbf990
Move self in Element::paint
...
Remove mutable state borrows in favor of state ownership in render processes to streamline element rendering.
2023-11-17 23:32:55 -07:00
Nathan Sobo
0069dd5ce6
WIP
2023-11-17 20:05:37 -07:00
Julia
3655a96e54
Merge branch 'main' into unborked-git-zed2-diagnostics-view
2023-11-17 16:32:35 -05:00
Julia
a464a7da2a
Merge branch 'main' into unborked-git-zed2-diagnostics-view
2023-11-17 16:32:35 -05:00
Julia
f4eb219c75
Get diagnostics view almost building in the zed2 world
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-11-17 16:32:35 -05:00
Nathan Sobo
9558da8681
Separate WrappedLines from ShapedLines
...
ShapedLines are never wrapped, whereas WrappedLines are optionally wrapped if
they are associated with a wrap width. I tried to combine everything because
wrapping is inherently optional for the Text element, but we have a bunch of
APIs that don't make sense on a line that may wrap, so we need a distinct type
for that case.
2023-11-16 23:10:51 -07:00
Nathan Sobo
c6b374ebc9
Remove initialize method from Element trait
2023-11-15 14:11:19 -07:00
Antonio Scandurra
33a808a49b
WIP
2023-11-15 20:41:09 +01:00
Antonio Scandurra
17b8e4a684
Handle clicking folded ranges
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-11-15 18:19:26 +01:00
Nathan Sobo
27fb381cca
Checkpoint
2023-11-14 01:15:48 -07:00
Nathan Sobo
044d9679ab
Checkpoint
2023-11-13 21:40:02 -07:00
Nathan Sobo
922bb3195b
WIP
2023-11-13 18:58:42 -07:00
Nathan Sobo
76754c559c
WIP
2023-11-13 18:18:25 -07:00
Antonio Scandurra
23fd1e19dc
Ignore element offset when manually drawing AnyElement
2023-11-10 11:35:57 +01:00
Antonio Scandurra
5d15886675
Render code actions indicator
...
Co-Authored-By: Nathan <nathan@zed.dev>
2023-11-09 18:43:26 +01:00
Antonio Scandurra
cfee1401ed
Extract AnyElement::{measure,draw}
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-11-09 17:30:41 +01:00
Nathan Sobo
7c922ad6ee
Remove comments
2023-11-08 21:49:21 -07:00
Nathan Sobo
9a022671a2
Simplify IME support
2023-11-08 21:06:00 -07:00
Max Brunsfeld
1a37d9edc6
Register text input handlers via new element hook
...
Provide element bounds to the input handler's `bounds_for_rect` method.
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-08 15:48:55 -08:00
Conrad Irwin
b804b25c21
Fix confusing error message
2023-11-07 12:04:21 -07:00
Marshall Bowers
d224f511fa
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
Marshall Bowers
ec0cff0e1a
Add map
method to Component
s ( #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
Antonio Scandurra
64ad8943ba
Remove more Send bounds and simplify view rendering
2023-11-02 09:44:16 +01:00
Max Brunsfeld
dd1a2a9e44
wip
2023-11-01 13:53:45 -06:00
Max Brunsfeld
57ffa8201e
Start removing the Send impl for App
...
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
2023-11-01 13:53:45 -06:00
Antonio Scandurra
0128079de0
WIP
2023-10-30 20:36:48 +01:00
Antonio Scandurra
637cff3ebd
WIP
2023-10-26 17:15:19 +02:00
Marshall Bowers
fccc4ca85c
Initialize element before layout
2023-10-26 15:22:48 +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
db15db45ce
WIP
2023-10-26 11:31:47 +02:00