Commit Graph

563 Commits

Author SHA1 Message Date
Nate Butler
03ebf0a5a9 Implement FixedWidth for all button types
[no-ci]

Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-12-01 16:20:39 -05:00
Nate Butler
89aa6a3726 Re-add diagnostic headers 2023-12-01 15:30:01 -05:00
Marshall Bowers
c3e7732eab
Add support for optional icon to Button (#3479)
This PR extends `Button` with support for an optional icon to be
displayed next to the label.

As part of this, the functionality for displaying an icon within a
button has been factored out into an internal `ButtonIcon` component.
`ButtonIcon` is now used by both `IconButton` and `Button` to
encapsulate the concerns of an icon that is rendered within a button.

Release Notes:

- N/A
2023-12-01 14:30:38 -05:00
Marshall Bowers
4b23c5c658
Add selected_label to Button (#3478)
This PR adds a new `selected_label` method to `Button`.

This can be used to set a different label that should be rendered when
the `Button` is selected.

Release Notes:

- N/A
2023-12-01 13:29:11 -05:00
Marshall Bowers
12b58f5b60 Add selected_icon to IconButton 2023-12-01 13:10:53 -05:00
Marshall Bowers
f09d9ef723 Clean up some ButtonLike doc comments 2023-12-01 13:09:35 -05:00
Julia
6f9e08ceea Merge branch 'main' into zed2-breadcrumbs 2023-12-01 12:28:36 -05:00
Nate Butler
85d72f63c1
Add Tinted button style placeholder and document ButtonLike (#3476)
- Adds a placeholder `ButtonStyle::Tinted`.
  - Note: Using this now will just give you a block of `gpui::red()`
- Documents ButtonLike and ButtonStyle to hopefully help make choosing a
button style easier.

Release Notes:

- N/A
2023-12-01 12:18:35 -05:00
Julia
13f4cc563c Merge branch 'main' into zed2-breadcrumbs 2023-12-01 11:02:34 -05:00
Nate Butler
88188b0c30 Merge branch 'main' into collab-ui-refinement 2023-12-01 10:50:25 -05:00
Julia
ce16e5b54a Unbreak toolbar layout & improve disabling ButtonLike 2023-12-01 10:33:44 -05:00
Marshall Bowers
6d62e6c562
Respect label_color for Buttons (#3469)
This PR makes `Button`s respect the `label_color` that is specified,
provided they are not disabled or selected.

Release Notes:

- N/A
2023-11-30 20:36:59 -05:00
Conrad Irwin
e1c8369b3d Rename menu_handle to right_click_menu and child to trigger
This makes things more in-line with `popover_menu`.
2023-11-30 16:39:43 -07:00
Conrad Irwin
ebbbeca9a6 Flesh out a popover control 2023-11-30 16:13:44 -07:00
Marshall Bowers
e5a5b1e84c
Rework ListHeader to be more open (#3467)
This PR reworks the `ListHeader` component to be more open.

The `meta` method can now be used to append meta items of any element to
the `ListHeader`, and they will be rendered with the appropriate spacing
between them.

Release Notes:

- N/A
2023-11-30 15:55:31 -05:00
Nate Butler
5098fafa02 Add v_stack and h_stack to the UI prelude
Co-Authored-By: Joseph T. Lyons <19867440+JosephTLyons@users.noreply.github.com>
Co-Authored-By: Conrad Irwin <conrad.irwin@gmail.com>
2023-11-30 15:28:18 -05:00
Nate Butler
180ba42456 WIP update popover_menu 2023-11-30 14:54:44 -05:00
Marshall Bowers
e78538e162 Implement Selectable for ListItem and ListHeader 2023-11-30 13:26:12 -05:00
Marshall Bowers
865baaa1a1 Remove unused GraphicSlot enum 2023-11-30 13:25:26 -05:00
Nate Butler
5eb89781e3 Clean up left side titlebar buttons 2023-11-30 13:11:20 -05:00
Marshall Bowers
0a8a84f656
Rename button-related enums (#3463)
This PR renames the `ButtonStyle2` and `ButtonSize2` enums to
`ButtonStyle` and `ButtonSize`, respectively.

Release Notes:

- N/A
2023-11-30 12:04:23 -05:00
Julia
428c517693 Merge branch 'main' into zed2-breadcrumbs 2023-11-30 11:38:29 -05:00
Nate Butler
82b3efa16c Update collab button styles 2023-11-30 09:12:39 -05:00
Antonio Scandurra
cc0bc444b1 Merge remote-tracking branch 'origin/main' into surfaces
# Conflicts:
#	crates/ui2/src/components/avatar.rs
2023-11-30 10:48:20 +01:00
Conrad Irwin
02174084ca
Collab panel2: Now with scrolling and keyboard (#3455)
Also introducing: .track_scroll() for non-uniform lists.

Release Notes:

- N/A
2023-11-30 00:13:52 -07:00
Conrad Irwin
90b8acfb34 Allow toggling subchannel visiblity without joining channel 2023-11-29 23:55:14 -07:00
Nate Butler
92d2048aa4 WIP 2023-11-30 00:28:05 -05:00
Marshall Bowers
9d53287341
Implement Selectable for buttons (#3451)
This PR implements the `Selectable` trait for `ButtonLike`, `Button`,
and `IconButton`.

Release Notes:

- N/A
2023-11-29 18:46:41 -05:00
Conrad Irwin
4c27f4453c Merge branch 'main' into collab-panel2 2023-11-29 16:32:25 -07:00
Marshall Bowers
04bbd107c1
Fix the selected state for the panel icons in the status bar (#3450)
This PR fixes a bug where the selected state for the panel icons in the
status bar was not correctly reflecting whether the panel was open.

It was erroneously using the `is_open` state for the context menu.

Release Notes:

- N/A
2023-11-29 18:20:08 -05:00
Marshall Bowers
b357ae4dc3
Add new Button and IconButton components (#3448)
This PR adds new `Button` and `IconButton` components built on top of
our new button abstractions.

Both of these buttons are built from the common `ButtonLike` base, and
implement the `ButtonCommon` (name TBD) trait in order to provide a
common interface.

There are still some visual tweaks that we'll need to make to the new
buttons, but those should be straightforward to make after we land this.

Release Notes:

- N/A
2023-11-29 17:41:44 -05:00
Conrad Irwin
cd60d466b1 Merge branch 'main' into collab-panel2 2023-11-29 15:40:16 -07:00
Conrad Irwin
3bdd51cb2a Availability indicators 2023-11-29 15:06:58 -07:00
Conrad Irwin
4ebae4d8bd Make LeftSlot take an element 2023-11-29 14:20:26 -07:00
Marshall Bowers
df5de47a78
Make toggle method accept impl Into<Option<bool>> (#3446)
This PR makes the `toggle` method on the various list components accept
an `impl Into<Option<bool>>` instead of just an `Option<bool>`.

This allows a caller with just a `bool` avoid having to wrap the
`Option` themselves.

Release Notes:

- N/A
2023-11-29 16:13:41 -05:00
Conrad Irwin
fb377aed73
Context menu, Dragon Drop, for collab panel (#3441)
Release Notes:

- N/A
2023-11-29 13:40:46 -07:00
Marshall Bowers
d8ed7c0721
Move GraphicSlot out of components module (#3444)
This PR moves the `GraphicSlot` definition out of the `components`
module, as it doesn't contain a component.

Release Notes:

- N/A
2023-11-29 15:29:33 -05:00
Conrad Irwin
6ab3825ab1 No moar toggleable 2023-11-29 13:25:29 -07:00
Marshall Bowers
e77846d2dc Rework Toggle into Toggleable and ToggleState 2023-11-29 14:33:52 -05:00
Marshall Bowers
6f5cc0af94 Rework Disclosure component 2023-11-29 14:07:48 -05:00
Marshall Bowers
c7b79c9aef Remove unnecessary constructor and Clone derives 2023-11-29 13:38:05 -05:00
Marshall Bowers
390b0d8d56 Reorganize list components 2023-11-29 13:34:50 -05:00
Max Brunsfeld
960ef7116d
Add a context menu to the project panel (#3393)
This PR adds a context menu to the project panel in Zed2.

* [x] Allow the context menu to extend outside of the project panel's
bounds
* [x] Add keyboard shortcuts to the context menu
* [x] Dismiss the context menu
    * [x] when running an action
    * [x] when changing selection in the project panel

Release Notes:

NA
2023-11-29 10:04:41 -08:00
Marshall Bowers
3e2c517dd1
Add Disableable trait (#3439)
This PR adds a new `Disableable` trait to use for elements that are
capable of being disabled.

Release Notes:

- N/A
2023-11-29 13:01:26 -05:00
Max Brunsfeld
dbfc7d3555 Merge branch 'main' into project-panel-context-menu 2023-11-29 09:45:31 -08:00
Max Brunsfeld
233aac5573 Make DismissEvent a unit struct
Co-authored-by: Conrad <conrad@zed.dev>
2023-11-29 09:42:54 -08:00
Marshall Bowers
043cef89eb
Remove unneeded wrapping divs in ListItem left content (#3438)
This PR removes some unneeded wrapping `div`s around the left content in
`ListItem`s.

Release Notes:

- N/A
2023-11-29 12:40:35 -05:00
Max Brunsfeld
ac34229118 Add keyboard control over context menus
Co-authored-by: Conrad <conrad@zed.dev>
2023-11-29 09:39:20 -08:00
Marshall Bowers
912c30c05b Remove unneeded .clones 2023-11-29 12:35:39 -05:00
Marshall Bowers
97e6fd295a Remove unneeded wrapping divs in ListItem left content 2023-11-29 12:29:48 -05:00
Nate Butler
a8bf0834e6
Button2 – Part1 (#3420)
## TODO

- [x] Remove `InteractionState`
- [ ] `Selectable` should use `Selection` instead of a boolean
- [x] Clean out ui2 prelude
- [ ] Build out button2 button types
- [ ] Port old buttons

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-29 12:23:09 -05:00
Conrad Irwin
5fbc60d8da Inviting/Responding/Creating Channels... etc. 2023-11-28 22:47:04 -07:00
Conrad Irwin
0d4839b973 use the right click event for buttons 2023-11-28 21:14:48 -07:00
Marshall Bowers
e36c7dd301
Remove ID hack in ListItem (#3431)
This PR removes the ID hack in `ListItem`, since the underlying issue
was fixed in #3430.

Release Notes:

- N/A
2023-11-28 23:11:29 -05: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
Max Brunsfeld
77acba9e4c Right-align key bindings in context menus
Remove extra div in `List` that prevented list items from
filling the available space.

Co-authored-by: Marshall <marshall@zed.dev>
2023-11-28 17:23:49 -08:00
Max Brunsfeld
6bf7ad71eb Show action key bindings in context menus 2023-11-28 16:07:42 -08:00
Conrad Irwin
60ce75c34a Togglable channels, the greatest since sliced bread 2023-11-28 16:52:12 -07:00
Max Brunsfeld
bcf449d3fe Add a basic context menu to the project panel 2023-11-28 15:12:46 -08:00
Marshall Bowers
5666066db4 Merge branch 'main' into collab-panel2 2023-11-28 17:07:40 -05:00
Marshall Bowers
ee027bc112
Fix tooltips not showing on IconButtons (#3427)
This PR fixes tooltips not showing on `IconButton`s.

The "fix" here is the same hack that we used to fix `on_click` handlers
for `ListItem`s, where we introduce another layer of wrapping with an
element with an ID set.

This PR also adds a story for the `IconButton` so this issue can be
tested/observed in isolation.

Release Notes:

- N/A
2023-11-28 17:01:53 -05:00
Conrad Irwin
a85e0db1f4 More progress on collab panel 2023-11-28 14:40:32 -07:00
Marshall Bowers
64376ad37a
ui2: Reference theme2 and settings2 crates without the 2 (#3424)
This PR updates the `ui2` crate to reference the `theme2` and
`settings2` crates without the `2` the way we do in our other crates.

Release Notes:

- N/A
2023-11-28 15:30:29 -05:00
Nate Butler
b24a3b8fcb Unused imports 2023-11-28 15:17:09 -05:00
Nate Butler
525fe70de6 Fix missing arrows 2023-11-28 15:15:49 -05:00
Nate Butler
21755c7d20 Update keybinding.rs 2023-11-28 15:12:40 -05:00
Nate Butler
3855413725 Merge branch 'main' into refine-keybindings 2023-11-28 15:12:22 -05:00
Marshall Bowers
070674a4fd
ui2: Unsuppress and fix warnings (#3423)
This PR unsupresses the warnings in `ui2` and summarily fixes them.

Release Notes:

- N/A
2023-11-28 14:44:19 -05:00
Nate Butler
a9cb6589dd Update keybinding.rs 2023-11-28 14:40:26 -05:00
Marshall Bowers
874fde09ab
Add inset variant to ListItem (#3422)
This PR adds an inset variant to the `ListItem` component.

We're now using this inset variant for the `ListItem`s we render in
pickers.

Release Notes:

- N/A
2023-11-28 14:27:19 -05:00
Nate Butler
f33cd3d463 Merge branch 'main' into refine-keybindings 2023-11-28 14:00:09 -05:00
Conrad Irwin
01d3432a40 Merge branch 'main' into collab-panel2 2023-11-28 11:40:58 -07:00
Marshall Bowers
9411898720
Use ListItems in the project panel (#3421)
This PR reworks the project panel to render its items using the
`ListItem` component.

There are a few hacks in here in order to get click handlers working for
the `ListItem`, but we'll want to get these fixed in GPUI.

Release Notes:

- N/A
2023-11-28 13:11:43 -05:00
Antonio Scandurra
3ac545088a WIP: preserve aspect ratio of images 2023-11-28 17:33:11 +01:00
Marshall Bowers
1ee109cec7 Use ListItem when rendering picker matches 2023-11-28 10:44:57 -05:00
Piotr Osiewicz
9fb3cb6a69 fixup! Add contact finder, change ui::List's on_click handler signature 2023-11-28 14:37:53 +01:00
Piotr Osiewicz
6c37393dd1 Add contact finder, change ui::List's on_click handler signature 2023-11-28 14:16:51 +01:00
Nate Butler
979ff70196 Update popover.rs 2023-11-27 20:12:20 -05:00
Nate Butler
ca2052b0c1 Merge branch 'main' into completions-styles 2023-11-27 19:22:07 -05:00
Conrad Irwin
4a25fae51e TEMP 2023-11-27 16:22:01 -07:00
Julia
d551b41aae zed2: Mostly port breadcrumbs & improve StyledText api
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-11-27 16:09:31 -05:00
Marshall Bowers
24f3034106
Add ListItem story (#3411)
This PR adds a story for the `ListItem` component, so we can work on it
in isolation.

Release Notes:

- N/A
2023-11-27 15:24:41 -05:00
Conrad Irwin
4f885252ab
[Zed2] Collab UI (#3403)
Release Notes:

- N/A
2023-11-27 12:40:59 -07:00
Marshall Bowers
19ecccb107 Add ListItem story 2023-11-27 14:20:33 -05:00
Conrad Irwin
82f6f77117 Use editor's overlay implementation 2023-11-27 11:49:51 -07:00
Conrad Irwin
212d9254e1 Merge branch 'main' into completions-styles 2023-11-27 11:49:39 -07:00
Nate Butler
ab83f4319b revert popover changes
[no ci]
2023-11-27 11:51:42 -05:00
Conrad Irwin
fd165206bf
gpui2: Notifications (#3407)
Release Notes:

- N/A
2023-11-27 09:22:31 -07:00
Nate Butler
8a35a02863 Checkpoint - try using overlay for completions popover
[no ci]
2023-11-27 11:22:19 -05:00
Nate Butler
1acc6b462f Start on completions styles 2023-11-27 10:29:29 -05:00
Piotr Osiewicz
5cbe8deb50 Fix up tests 2023-11-27 12:33:44 +01:00
Conrad Irwin
039c933d8e gpui2: Notifications 2023-11-26 22:28:53 -07:00
Nate Butler
6a3925c3e1 Add copilot icons 2023-11-24 09:22:31 -05:00
Nate Butler
7e61d340ce Outline some unfinished elements 2023-11-24 08:58:49 -05:00
Antonio Scandurra
56d043f671 Allow finding which ranges were clicked on an InteractiveText 2023-11-23 18:08:49 +01:00
Piotr Osiewicz
390ecb5b0c Merge branch 'main' into collab_ui-zed2 2023-11-23 15:02:55 +01:00
Piotr Osiewicz
c191943849 Add basic call/user UI in top-right corner.
Allow ui::Avatar to take custom data instead of always relying on URI resolution
2023-11-23 15:00:13 +01: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
Nathan Sobo
c23f17ee0b Reorganize element-related traits 2023-11-22 11:19:43 -07:00
Marshall Bowers
fd5793ddec Use children for ListItems 2023-11-22 12:44:51 -05:00