Commit Graph
180 Commits
Author SHA1 Message Date
fcd44e93d3 Mainline GPUI2 UI work (#3099)
This PR mainlines the current state of new GPUI2-based UI from the
`gpui2-ui` branch.

Included in this is a performance improvement to make use of the
`TextLayoutCache` when calling `layout` for `Text` elements.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2023-10-06 13:18:56 -04:00
Marshall BowersandPiotr Osiewicz 6eb1360ba6 Put Theme behind an Arc (#3017)
This PR puts the `Theme` returned from the `theme` function behind an
`Arc`.

### Motivation

While working on wiring up window focus events for the `TitleBar`
component we ran into issues where `theme` was holding an immutable
borrow to the `ViewContext` for the entirety of the `render` scope,
which prevented having mutable borrows in the same scope.

### Explanation

To avoid this, we can make `theme` return an `Arc<Theme>` to allow for
cheap clones and avoiding the issues with the borrow checker.

Release Notes:

- N/A

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2023-09-22 13:35:30 -04:00
Mikayla c4a0267642 Switch drag end event to be fired after mouse up 2023-09-21 08:58:36 -07:00
Nathan Sobo b2968c2d11 Eliminate PaintContext 2023-09-11 09:00:59 -06:00
Nathan Sobo 950ac4fbc6 Eliminate LayoutContext 2023-09-11 08:47:00 -06:00
Nathan Sobo 20da2b4621 Checkpoint 2023-09-08 16:25:10 -06:00
Nathan Sobo 3221dc9e05 Merge branch 'main' into storybook 2023-09-08 14:18:44 -06:00
Nathan Sobo a1cc229417 Move refreshing to window 2023-09-08 13:27:29 -06:00
Nathan Sobo 82fdb5f091 Add basic inspector 2023-09-07 22:24:02 -06:00
Nathan Sobo 501c4c5782 Checkpoint 2023-09-06 15:22:35 -06:00
Conrad Irwinand 204e716a5d vim . to replay
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -06:00
Nathan Sobo f7597cbd0e WIP: Icons not yet rendering 2023-09-05 16:40:52 -06:00
Nathan Sobo 99cca6a51c Checkpoint 2023-09-05 12:16:21 -06:00
Nathan Sobo 369e542607 Move views_to_notify_if_ancestors_change to Window 2023-08-29 21:58:44 -06:00
Nathan Sobo 07a33439b7 Store new_parents on Window instead of layout context 2023-08-29 21:43:48 -06:00
Nathan Sobo d38ccc2e92 Merge remote-tracking branch 'origin' into divs 2023-08-29 21:14:14 -06:00
Nathan SoboandMikayla Maki 9e0c34627f Provide themes to subtrees via context
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-08-28 16:07:26 -06:00
Nathan SoboandMikayla Maki 4022fa953c Render a titlebar you can barely see
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-08-28 14:24:27 -06:00
Nathan Sobo 187ef093dc Checkpoint 2023-08-25 23:15:58 -06:00
Nathan Sobo b3226fcea8 WIP 2023-08-25 22:19:49 -06:00
Nathan Sobo 67146964cc WIP 2023-08-25 21:41:21 -06:00
Mikayla 541f146673 Fix stuck click styling when dragging off of a button 2023-08-23 18:22:48 -07:00
Mikayla 7e5517ac29 Fix cursor and hover styles changing when dragging the mouse 2023-08-23 18:08:33 -07:00
Nathan SoboandConrad Irwin cb2b1c920c Rename Window::mouse_position to last_mouse_position
We want to encourage people to use WindowContext::mouse_position, which
requests the position from the platform.

Co-Authored-By: Conrad Irwin <conrad@zed.dev>
2023-08-23 13:28:22 -06:00
Nathan SoboandConrad Irwin 7bc14389c1 Use platform API to request mouse position
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
2023-08-23 13:10:41 -06:00
Nathan Sobo affc3b5476 Add hover styling support 2023-08-23 09:08:05 -06:00
Nathan Sobo ec9bebc7f4 Merge branch 'main' into divs 2023-08-22 16:35:56 -06:00
Nathan SoboandAntonio Scandurra 93b10e6626 Checkpoint
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-08-22 11:34:06 -06:00
Nathan Sobo e1034181ec Compiling checkpoint 2023-08-19 19:51:22 -06:00
Nathan Sobo 3330227042 Still need to wire up MouseMove with the new regions 2023-08-18 02:23:06 -06:00
Nathan Sobo 14368fd0b4 Introduce Refinement trait and derive macro 2023-08-18 01:03:46 -06:00
Mikayla 6a79716245 Add action button component for rendering the search options 2023-08-17 15:30:40 -07:00
Nathan Sobo b34afa1da9 Store generic mouse regions on window that contain their event type id 2023-08-17 08:37:55 -06:00
Nathan Sobo e97863fe37 Get basic mouse_down and mouse_up working 2023-08-16 22:21:27 -06:00
Nathan SoboandAntonio Scandurra bd7db52bc0 Get text rendering
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-08-16 12:50:35 -06:00
Nathan Sobo dc0abdbf46 Add support for a measure function to the layout engine facade 2023-08-15 22:02:56 -06:00
Nathan Sobo f533be10a2 WIP 2023-08-15 09:26:16 -06:00
Nathan SoboandMikayla Maki e862455671 Get a 50% colored box rendering
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-08-14 14:46:09 -06:00
Nathan SoboandMikayla Maki 64f61d293a Merge branch 'main' into taffy
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-08-14 13:50:21 -06:00
Nathan Sobo 13a3904ca3 Simplify adapter 2023-08-14 09:26:35 -06:00
Nathan Sobo c456402a35 Compiling checkpoint 2023-08-13 21:20:47 -06:00
Nathan Sobo 3b82dbc0c1 Put a Taffy layout engine on window 2023-08-12 00:58:11 -06:00
Nathan Sobo bb9591415f WIP 2023-08-10 10:26:48 -06:00
Nathan Sobo 7e2a227831 What if we base themes on Rose Pine 2023-08-09 20:54:30 -06:00
Mikayla Maki fcfbc7b810 Fix two mouse event bugs (#2835)
This PR fixes two bugs we discovered in Zed's mouse event handling while
investigating an interesting and mysterious bug we we were seeing, where
spurious `MouseMoved` events would continuously be dispatched after
control-clicking.

Release Notes:

- Fixed a rendering glitch that could occur after control-clicking
certain elements.
2023-08-09 09:04:32 -07:00
Nathan Sobo 22acd64aa8 Rename node to frame 2023-08-08 21:28:52 -06:00
Nathan Sobo 2ac55ed691 Merge branch 'main' into cells 2023-08-08 21:23:57 -06:00
Max BrunsfeldandMikayla 586d7cbb6c Fix failure to remove hovered region_ids on element removal
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-08 17:39:05 -07:00
Nathan Sobo ba8c733d80 Merge remote-tracking branch 'origin/main' into paint-context 2023-08-08 18:27:16 -06:00
Nathan Sobo bc83f1788b Minimize window id usage 2023-08-08 16:38:46 -06:00