ZIm/crates/ui/src/components
Nate Butler 6767e98e00
ui: Color cleanup (#26673)
This PR cleans up some color & elevation misc.

### Don't allow deriving Color from Hsla

The point of the [ui::Color] enum is to encourage consistent color
usage, and the the Color::Custom case is really only meant for cases
where we have no other choice.

`impl From<Hsla> for Color` encourages blindly passing colors into
`Color::Custom` – with this in place we might as well remove the entire
`Color` enum.

The usages that were updated due to this removal were for colors that
already exist in the Color enum, making it even more clear that it
didn't make sense to have this.

### `ElevationIndex` -> `Elevation`

This name would make more sense if we had an `Elevation` in the first
place. The new name is more clear.

#### `Button::elevation`

As part of this change I also updated button's `layer` method to
`elevation`, since it takes an elevation. This method still has the
following issue:

You want to use `Button::elevation` when it's default colors are
invisible on the layer you are rendering the button on. However, current
this method uses the elevation's `bg` color, rather than it's
`on_elevation_bg`.

Ideally when you use `Button::elevation` you want to pass the elevation
you are _on_, not choosing one that will show up the elevation you are
on.

This change will be in a separate PR, as it likely will have widespread
visual impact across the app.

Release Notes:

- N/A
2025-03-13 15:18:40 +00:00
..
button ui: Color cleanup (#26673) 2025-03-13 15:18:40 +00:00
icon git_ui: New panel design (#25821) 2025-02-28 20:00:39 +00:00
label git_ui: Prevent button overflow due to long names (#25940) 2025-03-03 18:38:15 +00:00
list gpui: Rename rounded_md to rounded_sm (#26228) 2025-03-06 17:57:31 +00:00
notification Add StatusToast & the ToastLayer (#26232) 2025-03-06 20:37:54 +00:00
stories ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
avatar.rs gpui: Rename rounded_md to rounded_sm (#26228) 2025-03-06 17:57:31 +00:00
button.rs chore: Another round of style lints fixes (#17519) 2024-09-07 02:36:55 +02:00
content_group.rs Add StatusToast & the ToastLayer (#26232) 2025-03-06 20:37:54 +00:00
context_menu.rs ui: Split up ContextMenu::render into smaller methods (#26489) 2025-03-11 22:26:22 +00:00
disclosure.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
divider.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
dropdown_menu.rs gpui: Rename rounded_md to rounded_sm (#26228) 2025-03-06 17:57:31 +00:00
facepile.rs git_ui: New panel design (#25821) 2025-02-28 20:00:39 +00:00
group.rs New commit review flow in project diff view (#25229) 2025-02-21 06:52:34 +00:00
icon.rs Improve the generate commit message design (#26233) 2025-03-07 01:21:20 +00:00
image.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
indent_guides.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
indicator.rs gpui: Rename rounded_md to rounded_sm (#26228) 2025-03-06 17:57:31 +00:00
keybinding.rs Git commit modal command (#26405) 2025-03-10 16:10:53 -06:00
keybinding_hint.rs gpui: Rename rounded_md to rounded_sm (#26228) 2025-03-06 17:57:31 +00:00
label.rs chore: Revert changes made to ui crate structure (#17516) 2024-09-06 21:38:56 +02:00
list.rs chore: Revert changes made to ui crate structure (#17516) 2024-09-06 21:38:56 +02:00
modal.rs gpui: Rename rounded_md to rounded_sm (#26228) 2025-03-06 17:57:31 +00:00
navigable.rs keymap: Update Prev to Previous for consistency (#25909) 2025-03-03 17:44:49 +05:30
notification.rs Add StatusToast & the ToastLayer (#26232) 2025-03-06 20:37:54 +00:00
numeric_stepper.rs gpui: Rename rounded_sm to rounded_xs (#26221) 2025-03-06 16:08:19 +00:00
popover.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
popover_menu.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
radio.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
right_click_menu.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
scrollbar.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
settings_container.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
settings_group.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
stack.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
stories.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
tab.rs git_ui: New panel design (#25821) 2025-02-28 20:00:39 +00:00
tab_bar.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
table.rs git_ui: New panel design (#25821) 2025-02-28 20:00:39 +00:00
toggle.rs ui: Color cleanup (#26673) 2025-03-13 15:18:40 +00:00
tooltip.rs git_ui: New panel design (#25821) 2025-02-28 20:00:39 +00:00